diff options
author | David Yip <yipdw@member.fsf.org> | 2018-01-07 13:30:52 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2018-01-07 13:30:52 -0600 |
commit | f7c4d4464ba3b3729d707c54c4d2aa7515a9fe57 (patch) | |
tree | b9dff90611207ec3dd075ca73fac32896dbab292 /spec | |
parent | 70c99a9f34b645baa65982dfec5351869c1924fe (diff) | |
parent | c2e1bfd9ae3f5fe65c4918a37143d48a2cc12bb3 (diff) |
Merge remote-tracking branch 'personal/merge/tootsuite/master' into gs-master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 20 | ||||
-rw-r--r-- | spec/rails_helper.rb | 2 |
2 files changed, 9 insertions, 13 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 6a54a78c5..51c0e3c70 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -47,22 +47,18 @@ describe ApplicationController, type: :controller do include_examples 'respond_with_error', 422 end - it "does not force ssl if LOCAL_HTTPS is not 'true'" do + it "does not force ssl if Rails.env.production? is not 'true'" do routes.draw { get 'success' => 'anonymous#success' } - ClimateControl.modify LOCAL_HTTPS: '' do - allow(Rails.env).to receive(:production?).and_return(true) - get 'success' - expect(response).to have_http_status(:success) - end + allow(Rails.env).to receive(:production?).and_return(false) + get 'success' + expect(response).to have_http_status(:success) end - it "forces ssl if LOCAL_HTTPS is 'true'" do + it "forces ssl if Rails.env.production? is 'true'" do routes.draw { get 'success' => 'anonymous#success' } - ClimateControl.modify LOCAL_HTTPS: 'true' do - allow(Rails.env).to receive(:production?).and_return(true) - get 'success' - expect(response).to redirect_to('https://test.host/success') - end + allow(Rails.env).to receive(:production?).and_return(true) + get 'success' + expect(response).to redirect_to('https://test.host/success') end describe 'helper_method :current_account' do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 67c6b9205..4f7399505 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -46,7 +46,7 @@ RSpec.configure do |config| config.include ActiveSupport::Testing::TimeHelpers config.before :each, type: :feature do - https = Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true' + https = ENV['LOCAL_HTTPS'] == 'true' Capybara.app_host = "http#{https ? 's' : ''}://#{ENV.fetch('LOCAL_DOMAIN')}" end |