From 9836017c709ee5179575647e8d93065eeb854137 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 2 Sep 2015 16:45:34 +0300 Subject: [PATCH] satisfy rubocop --- ..._login_form.feature => login_form.feature} | 2 +- features/steps/crowd_login_form.rb | 21 ---------------- features/steps/login_form.rb | 25 +++++++++++++++++++ 3 files changed, 26 insertions(+), 22 deletions(-) rename features/{crowd_login_form.feature => login_form.feature} (59%) delete mode 100644 features/steps/crowd_login_form.rb create mode 100644 features/steps/login_form.rb diff --git a/features/crowd_login_form.feature b/features/login_form.feature similarity index 59% rename from features/crowd_login_form.feature rename to features/login_form.feature index d5a347b5fd5..b4d95754482 100644 --- a/features/crowd_login_form.feature +++ b/features/login_form.feature @@ -1,4 +1,4 @@ -Feature: Crowd login form +Feature: Login form Scenario: I see crowd form Given Crowd integration enabled When I visit sign in page diff --git a/features/steps/crowd_login_form.rb b/features/steps/crowd_login_form.rb deleted file mode 100644 index 31bc6eea3c9..00000000000 --- a/features/steps/crowd_login_form.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Spinach::Features::CrowdLoginForm < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - include SharedUser - include SharedSearch - - step 'Crowd integration enabled' do - Gitlab::OAuth::Provider.should_receive(:providers).and_return([:crowd]) - allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_return(root_path) - Gitlab.config.omniauth.should_receive(:enabled).and_return(true) - end - - step 'I should see Crowd login form' do - expect(page).to have_selector '#tab-crowd form' - end - - step 'I visit sign in page' do - visit new_user_session_path - end -end \ No newline at end of file diff --git a/features/steps/login_form.rb b/features/steps/login_form.rb new file mode 100644 index 00000000000..b9ff6ae67fd --- /dev/null +++ b/features/steps/login_form.rb @@ -0,0 +1,25 @@ +class Spinach::Features::LoginForm < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedSnippet + include SharedUser + include SharedSearch + + step 'Crowd integration enabled' do + @providers_orig = Gitlab::OAuth::Provider.providers + @omniauth_conf_orig = Gitlab.config.omniauth.enabled + expect(Gitlab::OAuth::Provider).to receive(:providers).and_return([:crowd]) + allow_any_instance_of(ApplicationHelper).to receive(:user_omniauth_authorize_path).and_return(root_path) + expect(Gitlab.config.omniauth).to receive(:enabled).and_return(true) + end + + step 'I should see Crowd login form' do + expect(page).to have_selector '#tab-crowd form' + Gitlab::OAuth::Provider.stub(:providers).and_return(@providers_orig) + Gitlab.config.omniauth.stub(:enabled).and_return(@omniauth_conf_orig) + end + + step 'I visit sign in page' do + visit new_user_session_path + end +end -- GitLab