Commit 2c362688 authored by Marin Jankovski's avatar Marin Jankovski

Test the redirect after sign in.

parent a1eb1ad1
......@@ -24,3 +24,9 @@ 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 sign in as a user
Then I should be redirected to "Community" page
......@@ -31,5 +31,11 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
project = Project.find_by(name: 'Community')
visit project_path(project) + 'DoesNotExist'
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment