Commit 95791316 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Lets fix tests

parent e45179c9
%ul.bordered-list %ul.bordered-list
= render @snippets = render partial: 'snippet', collection: @snippets
- if @snippets.empty? - if @snippets.empty?
%li %li
%h3.nothing_here_message Nothing here. %h3.nothing_here_message Nothing here.
......
...@@ -31,6 +31,7 @@ Feature: Project Team management ...@@ -31,6 +31,7 @@ Feature: Project Team management
Scenario: Import team from another project Scenario: Import team from another project
Given I own project "Website" Given I own project "Website"
And "Mike" is "Website" reporter And "Mike" is "Website" reporter
When I visit project "Shop" team page
And I click link "Import team from another project" And I click link "Import team from another project"
When I submit "Website" project for import team And I submit "Website" project for import team
Then I should see "Mike" in team list as "Reporter" Then I should see "Mike" in team list as "Reporter"
...@@ -29,7 +29,7 @@ class Dashboard < Spinach::FeatureSteps ...@@ -29,7 +29,7 @@ class Dashboard < Spinach::FeatureSteps
Given 'user with name "John Doe" joined project "Shop"' do Given 'user with name "John Doe" joined project "Shop"' do
user = create(:user, {name: "John Doe"}) user = create(:user, {name: "John Doe"})
project = Project.find_by_name "Shop" project.team << [user, :master]
Event.create( Event.create(
project: project, project: project,
author_id: user.id, author_id: user.id,
...@@ -38,12 +38,11 @@ class Dashboard < Spinach::FeatureSteps ...@@ -38,12 +38,11 @@ class Dashboard < Spinach::FeatureSteps
end end
Then 'I should see "John Doe joined project at Shop" event' do Then 'I should see "John Doe joined project at Shop" event' do
page.should have_content "John Doe joined project at Shop" page.should have_content "John Doe joined project at #{project.name_with_namespace}"
end end
And 'user with name "John Doe" left project "Shop"' do And 'user with name "John Doe" left project "Shop"' do
user = User.find_by_name "John Doe" user = User.find_by_name "John Doe"
project = Project.find_by_name "Shop"
Event.create( Event.create(
project: project, project: project,
author_id: user.id, author_id: user.id,
...@@ -52,7 +51,7 @@ class Dashboard < Spinach::FeatureSteps ...@@ -52,7 +51,7 @@ class Dashboard < Spinach::FeatureSteps
end end
Then 'I should see "John Doe left project at Shop" event' do Then 'I should see "John Doe left project at Shop" event' do
page.should have_content "John Doe left project at Shop" page.should have_content "John Doe left project at #{project.name_with_namespace}"
end end
And 'I have group with projects' do And 'I have group with projects' do
...@@ -83,4 +82,8 @@ class Dashboard < Spinach::FeatureSteps ...@@ -83,4 +82,8 @@ class Dashboard < Spinach::FeatureSteps
Then 'I should see 1 project at group list' do Then 'I should see 1 project at group list' do
page.find('span.last_activity/span').should have_content('1') page.find('span.last_activity/span').should have_content('1')
end end
def project
@project ||= Project.find_by_name "Shop"
end
end end
...@@ -79,7 +79,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -79,7 +79,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end end
Given 'I own project "Website"' do Given 'I own project "Website"' do
@project = create(:project, name: "Website") @project = create(:project, name: "Website", namespace: @user.namespace)
@project.team << [@user, :master] @project.team << [@user, :master]
end end
...@@ -94,7 +94,8 @@ class ProjectTeamManagement < Spinach::FeatureSteps ...@@ -94,7 +94,8 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end end
When 'I submit "Website" project for import team' do When 'I submit "Website" project for import team' do
select 'Website', from: 'source_project_id' project = Project.find_by_name("Website")
select project.name_with_namespace, from: 'source_project_id'
click_button 'Import' click_button 'Import'
end end
......
...@@ -42,7 +42,7 @@ module SharedProject ...@@ -42,7 +42,7 @@ module SharedProject
Then 'I should see project "Shop" activity feed' do Then 'I should see project "Shop" activity feed' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}" page.should have_content "#{@user.name} pushed new branch new_design at #{project.name_with_namespace}"
end end
Then 'I should see project settings' do Then 'I should see project settings' do
......
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