mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fixing OmniAuth integration tests since now it has support for failure scenarios
This commit is contained in:
parent
4f093574da
commit
15d195d2f0
1 changed files with 13 additions and 17 deletions
|
@ -119,24 +119,20 @@ class OmniauthableIntegrationTest < ActionController::IntegrationTest
|
||||||
assert_equal '/q/users/auth/facebook', current_url
|
assert_equal '/q/users/auth/facebook', current_url
|
||||||
end
|
end
|
||||||
|
|
||||||
# The following two tests are commented because OmniAuth's test
|
test "handles callback error parameter according to the specification" do
|
||||||
# support is not yet able to support failure scenarios.
|
OmniAuth.config.mock_auth[:facebook] = :access_denied
|
||||||
#
|
visit "/users/auth/facebook/callback?error=access_denied"
|
||||||
# test "handles callback error parameter according to the specification" do
|
assert_current_url "/users/sign_in"
|
||||||
# visit "/users/auth/facebook/callback?error=access_denied"
|
assert_contain 'Could not authorize you from Facebook because "Access denied".'
|
||||||
# assert_current_url "/users/sign_in"
|
end
|
||||||
# assert_contain 'Could not authorize you from Facebook because "Access denied".'
|
|
||||||
# end
|
|
||||||
|
|
||||||
# test "handles other exceptions from omniauth" do
|
test "handles other exceptions from omniauth" do
|
||||||
# Devise::OmniAuth.stub!(:facebook) do |b|
|
OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
|
||||||
# b.post('/oauth/access_token') { [401, {}, {}.to_json] }
|
|
||||||
# end
|
|
||||||
|
|
||||||
# visit "/users/sign_in"
|
visit "/users/sign_in"
|
||||||
# click_link "Sign in with facebook"
|
click_link "Sign in with facebook"
|
||||||
|
|
||||||
# assert_current_url "/users/sign_in"
|
assert_current_url "/users/sign_in"
|
||||||
# assert_contain 'Could not authorize you from Facebook because "Invalid credentials".'
|
assert_contain 'Could not authorize you from Facebook because "Invalid credentials".'
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue