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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-23 10:38:24 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-23 10:38:24 +0400
commit5aaa35656edaf309354528e197a54461f584ed21 (patch)
tree9af64097a345f8683d9a98ca8364ed0bf9b9e4e1 /features
parent5b8c1767676b94f58558e6de320965c68b57de42 (diff)
parentdb88797ef9e9012238b45857dfcec15a12838305 (diff)
Merge branch 'redirect_after_login' into 'master'
Redirect after login
Diffstat (limited to 'features')
-rw-r--r--features/project/redirects.feature7
-rw-r--r--features/steps/project/redirects.rb22
2 files changed, 29 insertions, 0 deletions
diff --git a/features/project/redirects.feature b/features/project/redirects.feature
index ce197912f64..776ab83a876 100644
--- a/features/project/redirects.feature
+++ b/features/project/redirects.feature
@@ -24,3 +24,10 @@ Feature: Project Redirects
Given I sign in as a user
When I visit project "Enterprise" page
Then page status code should be 404
+
+ Scenario: I visit a public project without signing in
+ 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 cfa4ce82be3..5a4342dba30 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -31,5 +31,27 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
project = Project.find_by(name: 'Community')
visit project_path(project) + 'DoesNotExist'
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')
+ 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
+ project = Project.find_by(name: 'Community')
+ page.current_path.should == "/#{project.path_with_namespace}"
+ page.status_code.should == 200
+ end
end