Commit bc0bb9c1 authored by Dmitry Kovalenok's avatar Dmitry Kovalenok

testing

parent 507dda03
......@@ -4,7 +4,7 @@
<%= link_to oauth_google_path do %>
<%= button_tag class: 'button-login' do %>
<%= image_tag('/plugin_assets/redmine_omniauth_google/images/google_login_icon.jpg', class: 'button-login-icon', alt: l(:login_via_google)) %>
<%= content_tag :div, 'Login_via_google', class: 'button-login-text' %>
<%= content_tag :div, l(:login_via_google), class: 'button-login-text' %>
<% end %>
<% end %>
<% end %>
\ No newline at end of file
.button-login {
position: absolute;
left: 40%;
position: relative;
left: 45%;
display: inline-block;
border: 1px solid #999;
border-radius: 2px;
margin-top: 5px;
margin-top: 10px;
width: 135px;
height: 25px;
padding: 0;
......
......@@ -90,12 +90,27 @@ class RedmineOauthControllerTest < ActionController::TestCase
end
def test_oauth_google_callback_with_new_user_created_with_manual_activation
Setting.self_registration = '2'
set_response_body_stub
get :oauth_google_callback
assert_redirected_to :signin
user = User.find_by_mail(@default_user_credentials[:mail])
assert user
assert_equal User::STATUS_REGISTERED, user.status
Setting.self_registration = '2'
set_response_body_stub
get :oauth_google_callback
assert_redirected_to :signin
user = User.find_by_mail(@default_user_credentials[:mail])
assert user
assert_equal User::STATUS_REGISTERED, user.status
end
def test_oauth_google_callback_with_not_allowed_email_domain
Setting.plugin_redmine_omniauth_google[:allowed_domains] = "twinslash.com"
set_response_body_stub
get :oauth_google_callback
assert_redirected_to :signin
end
def test_oauth_google_callback_with_allowed_email_domain
Setting.self_registration = '3'
Setting.plugin_redmine_omniauth_google[:allowed_domains] = parse_email(@default_response_body[:email])[:domain]
set_response_body_stub
get :oauth_google_callback
assert_redirected_to controller: 'my', action: 'account'
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment