summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-06-19 16:46:01 +0200
committerMarin Jankovski <marin@gitlab.com>2014-06-19 16:51:36 +0200
commitdb88797ef9e9012238b45857dfcec15a12838305 (patch)
treee92d02b6ea149ea7509a4f74a72d3d021491b570
parent26d1bd7c2a285da734ed0b8eab5c31cd5237caa4 (diff)
downloadgitlab-ce-db88797ef9e9012238b45857dfcec15a12838305.tar.gz
Fix test
-rw-r--r--features/project/redirects.feature1
-rw-r--r--features/steps/project/redirects.rb14
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