Commit db88797e authored by Marin Jankovski's avatar Marin Jankovski

Fix test

parent 26d1bd7c
...@@ -29,4 +29,5 @@ Feature: Project Redirects ...@@ -29,4 +29,5 @@ Feature: Project Redirects
When I visit project "Community" page When I visit project "Community" page
And I should see project "Community" home page And I should see project "Community" home page
And I click on "Sign In" And I click on "Sign In"
And Authenticate
Then I should be redirected to "Community" page Then I should be redirected to "Community" page
...@@ -33,8 +33,20 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps ...@@ -33,8 +33,20 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
end end
step 'I click on "Sign In"' do step 'I click on "Sign In"' do
within '.pull-right' do
click_link "Sign in" click_link "Sign in"
end 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 step 'I should be redirected to "Community" page' do
project = Project.find_by(name: 'Community') project = Project.find_by(name: 'Community')
......
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