diff options
-rw-r--r-- | features/project/redirects.feature | 1 | ||||
-rw-r--r-- | features/steps/project/redirects.rb | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/features/project/redirects.feature b/features/project/redirects.feature index 10e5fbf55c7..776ab83a876 100644 --- a/features/project/redirects.feature +++ b/features/project/redirects.feature @@ -29,4 +29,5 @@ Feature: Project Redirects When I visit project "Community" page And I should see project "Community" home page And I click on "Sign In" + And Authenticate Then I should be redirected to "Community" page diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 2ce0e836119..5a4342dba30 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -33,7 +33,19 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps end step 'I click on "Sign In"' do - click_link "Sign in" + within '.pull-right' do + click_link "Sign in" + end + end + + step 'Authenticate' do + admin = create(:admin) + project = Project.find_by(name: 'Community') + find(:xpath, "//input[@id='return_to']").set "/#{project.path_with_namespace}" + fill_in "user_login", with: admin.email + fill_in "user_password", with: admin.password + click_button "Sign in" + Thread.current[:current_user] = admin end step 'I should be redirected to "Community" page' do |