diff --git a/lib/omniauth/failure_endpoint.rb b/lib/omniauth/failure_endpoint.rb index 9b6b866..d9edbcc 100644 --- a/lib/omniauth/failure_endpoint.rb +++ b/lib/omniauth/failure_endpoint.rb @@ -17,7 +17,7 @@ module OmniAuth end def call - raise_out! if OmniAuth.config.failure_raise_out_environments.include?(ENV['RACK_ENV']) + raise_out! if OmniAuth.config.failure_raise_out_environments.include?(ENV['RACK_ENV'].to_s) redirect_to_failure end diff --git a/spec/helper.rb b/spec/helper.rb index c2d530a..7b02da4 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -13,7 +13,6 @@ require 'omniauth' require 'omniauth/test' OmniAuth.config.logger = Logger.new("/dev/null") -ENV['RACK_ENV'] ||= 'test' RSpec.configure do |config| config.include Rack::Test::Methods diff --git a/spec/omniauth/failure_endpoint_spec.rb b/spec/omniauth/failure_endpoint_spec.rb index 45ff18f..e4f5cf4 100644 --- a/spec/omniauth/failure_endpoint_spec.rb +++ b/spec/omniauth/failure_endpoint_spec.rb @@ -5,6 +5,9 @@ describe OmniAuth::FailureEndpoint do context "raise-out environment" do before do + @rack_env = ENV['RACK_ENV'] + ENV['RACK_ENV'] = 'test' + @default = OmniAuth.config.failure_raise_out_environments OmniAuth.config.failure_raise_out_environments = ['test'] end @@ -20,6 +23,7 @@ describe OmniAuth::FailureEndpoint do end after do + ENV['RACK_ENV'] = @rack_env OmniAuth.config.failure_raise_out_environments = @default end end