|
|
@ -39,18 +39,20 @@ describe ApplicationController, type: :controller do |
|
|
|
|
|
|
|
|
|
|
|
it "does not force ssl if LOCAL_HTTPS is not 'true'" do |
|
|
|
it "does not force ssl if LOCAL_HTTPS is not 'true'" do |
|
|
|
routes.draw { get 'success' => 'anonymous#success' } |
|
|
|
routes.draw { get 'success' => 'anonymous#success' } |
|
|
|
ENV['LOCAL_HTTPS'] = '' |
|
|
|
ClimateControl.modify LOCAL_HTTPS: '' do |
|
|
|
allow(Rails.env).to receive(:production?).and_return(true) |
|
|
|
allow(Rails.env).to receive(:production?).and_return(true) |
|
|
|
get 'success' |
|
|
|
get 'success' |
|
|
|
expect(response).to have_http_status(:success) |
|
|
|
expect(response).to have_http_status(:success) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "forces ssl if LOCAL_HTTPS is 'true'" do |
|
|
|
it "forces ssl if LOCAL_HTTPS is 'true'" do |
|
|
|
routes.draw { get 'success' => 'anonymous#success' } |
|
|
|
routes.draw { get 'success' => 'anonymous#success' } |
|
|
|
ENV['LOCAL_HTTPS'] = 'true' |
|
|
|
ClimateControl.modify LOCAL_HTTPS: 'true' do |
|
|
|
allow(Rails.env).to receive(:production?).and_return(true) |
|
|
|
allow(Rails.env).to receive(:production?).and_return(true) |
|
|
|
get 'success' |
|
|
|
get 'success' |
|
|
|
expect(response).to redirect_to('https://test.host/success') |
|
|
|
expect(response).to redirect_to('https://test.host/success') |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe 'helper_method :current_account' do |
|
|
|
describe 'helper_method :current_account' do |
|
|
|