diff --git a/app/views/hooks/_view_account_login_bottom.html.erb b/app/views/hooks/_view_account_login_bottom.html.erb index 969cc2439ecc154221e60b71de1d9ed6ae803468..df2ee0aaade9d3fdb2f749c85d02dc78ccf58e9b 100644 --- a/app/views/hooks/_view_account_login_bottom.html.erb +++ b/app/views/hooks/_view_account_login_bottom.html.erb @@ -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 diff --git a/assets/stylesheets/buttons.css b/assets/stylesheets/buttons.css index 91cbada4a9b408ef5bd41d531880d84c675663de..eb6d338c9ae3bfe6a3f925f5e275002f62458586 100644 --- a/assets/stylesheets/buttons.css +++ b/assets/stylesheets/buttons.css @@ -1,10 +1,10 @@ .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; diff --git a/test/functional/redmine_oauth_controller_test.rb b/test/functional/redmine_oauth_controller_test.rb index 757a542bba0a2570e608c43d6cb012c05fa51dda..e584dd24134607732fbc632a690d68c7e8a82142 100644 --- a/test/functional/redmine_oauth_controller_test.rb +++ b/test/functional/redmine_oauth_controller_test.rb @@ -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