Rubocop spec/controllers/widget_controller_spec.rb

This commit is contained in:
Eric Schultz 2021-02-24 11:51:38 -06:00 committed by Eric Schultz
parent fa0acf9791
commit ba7dfa5c21
2 changed files with 13 additions and 14 deletions

View file

@ -634,7 +634,6 @@ AllCops:
- 'spec/controllers/campaigns_spec.rb'
- 'spec/controllers/roles_spec.rb'
- 'spec/controllers/direct_debit_details_spec.rb'
- 'spec/controllers/widget_controller_spec.rb'
- 'spec/controllers/emails_spec.rb'
- 'spec/controllers/ticket_levels_spec.rb'
- 'spec/controllers/concerns/supporter/current_spec.rb'

View file

@ -7,17 +7,17 @@ require 'rails_helper'
RSpec.describe WidgetController, type: :controller do
describe 'v2' do
it 'accepts requests without a CORS error' do
expect {get :v2, format: :js }.to_not raise_error
expect { get :v2, format: :js }.to_not raise_error
end
it 'has a cache-control header of 10 minutes' do
get :v2, format: :js
expect(response.headers["Cache-Control"]).to include "max-age=600"
expect(response.headers['Cache-Control']).to include 'max-age=600'
end
it 'does redirect' do
get :v2, format: :js
expect(response.headers.has_key?("Location")).to eq true
expect(response.headers.has_key?('Location')).to eq true
end
end
end