Fix invalid reference to @controller

pull/4945/head
Oliver Günther 8 years ago
parent 6388a70831
commit 499d504c6a
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 23
      spec_legacy/support/legacy_assertions.rb

@ -265,17 +265,8 @@ module LegacyAssertionsAndHelpers
it { should respond_with failure_code }
it { should_respond_with_content_type_based_on_url(url) }
it 'include correct www_authenticate_header' do
# the 3.0.9 implementation of head leads to Www as the method capitalizes each
# word split by a hyphen.
# this is fixed in 3.1.0 http://apidock.com/rails/v3.1.0/ActionController/Head/head
# remove this switch once on 3.1.0
if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 0
assert @controller.response.headers.has_key?('Www-Authenticate')
assert_equal 'Session realm="OpenProject API"', @controller.response.headers['Www-Authenticate']
else
assert @controller.response.headers.has_key?('WWW-Authenticate')
assert_equal 'Session realm="OpenProject API"', @controller.response.headers['WWW-Authenticate']
end
assert response.headers.has_key?('WWW-Authenticate')
assert_equal 'Session realm="OpenProject API"', response.headers['WWW-Authenticate']
end
end
end
@ -327,15 +318,7 @@ module LegacyAssertionsAndHelpers
it { should respond_with failure_code }
it { should_respond_with_content_type_based_on_url(url) }
it 'include_www_authenticate_header' do
# the 3.0.9 implementation of head leads to Www as the method capitalizes each
# word split by a hyphen.
# this is fixed in 3.1.0 http://apidock.com/rails/v3.1.0/ActionController/Head/head
# remove this switch once on 3.1.0
if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR == 0
assert @controller.response.headers.has_key?('Www-Authenticate')
else
assert @controller.response.headers.has_key?('WWW-Authenticate')
end
assert response.headers.has_key?('WWW-Authenticate')
end
end
end

Loading…
Cancel
Save