Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/project/redirects.rb')
-rw-r--r--features/steps/project/redirects.rb37
1 files changed, 36 insertions, 1 deletions
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index cfa4ce82be3..25d37fd7888 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -31,5 +31,40 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
project = Project.find_by(name: 'Community')
visit project_path(project) + 'DoesNotExist'
end
-end
+ step 'I click on "Sign In"' do
+ within '.pull-right' do
+ click_link "Sign in"
+ end
+ end
+
+ step 'Authenticate' do
+ admin = create(:admin)
+ project = Project.find_by(name: 'Community')
+ 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
+ project = Project.find_by(name: 'Community')
+ page.current_path.should == "/#{project.path_with_namespace}"
+ page.status_code.should == 200
+ end
+
+ step 'I get redirected to signin page where I sign in' do
+ admin = create(:admin)
+ project = Project.find_by(name: 'Enterprise')
+ 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 "Enterprise" page' do
+ project = Project.find_by(name: 'Enterprise')
+ page.current_path.should == "/#{project.path_with_namespace}"
+ page.status_code.should == 200
+ end
+end