Commit 641340016df125a73ca46c19ec9c71d9358a8eaf
1 parent
ddc5125d
Adds public controller tests
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
plugins/oauth_client/test/functional/oauth_client_plugin_public_controller_test.rb
@@ -65,6 +65,14 @@ class OauthClientPluginPublicControllerTest < ActionController::TestCase | @@ -65,6 +65,14 @@ class OauthClientPluginPublicControllerTest < ActionController::TestCase | ||
65 | assert session[:external].present? | 65 | assert session[:external].present? |
66 | end | 66 | end |
67 | 67 | ||
68 | + should 'not create an user when performing external login' do | ||
69 | + request.env["omniauth.params"] = {"action" => "external_login"} | ||
70 | + | ||
71 | + assert_no_difference 'User.count' do | ||
72 | + get :callback | ||
73 | + end | ||
74 | + end | ||
75 | + | ||
68 | should 'not perform external login when the provider is disabled' do | 76 | should 'not perform external login when the provider is disabled' do |
69 | request.env["omniauth.params"] = {"action" => "external_login"} | 77 | request.env["omniauth.params"] = {"action" => "external_login"} |
70 | provider.update_attribute(:enabled, false) | 78 | provider.update_attribute(:enabled, false) |
plugins/oauth_client/views/auth/_oauth_login.html.erb
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <% if OauthClientPlugin::Config.instance.allow_external_login %> | 8 | <% if OauthClientPlugin::Config.instance.allow_external_login %> |
9 | <%= _('Login with:') %> | 9 | <%= _('Login with:') %> |
10 | <div> | 10 | <div> |
11 | - <%= render :partial => 'auth/generate_providers_links', :locals => {:providers => providers, :action => "external_login"} %> | 11 | + <%= render :partial => 'auth/generate_providers_links', :locals => {:providers => providers, :action => "external_login"} %> |
12 | </div> | 12 | </div> |
13 | <% end %> | 13 | <% end %> |
14 | </div> | 14 | </div> |