Commit 593dfc40 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

FIx userteams tests

parent 48e5dff9
...@@ -131,9 +131,7 @@ class Userteams < Spinach::FeatureSteps ...@@ -131,9 +131,7 @@ class Userteams < Spinach::FeatureSteps
Given 'project from team has merge requests assigned to me' do Given 'project from team has merge requests assigned to me' do
team = UserTeam.last team = UserTeam.last
team.projects.each do |project| team.projects.each do |project|
team.members.each do |member| create(:merge_request, assignee: current_user, project: project)
3.times { create(:merge_request, assignee: member, project: project) }
end
end end
end end
...@@ -145,31 +143,17 @@ class Userteams < Spinach::FeatureSteps ...@@ -145,31 +143,17 @@ class Userteams < Spinach::FeatureSteps
Then 'I should see merge requests from this team assigned to me' do Then 'I should see merge requests from this team assigned to me' do
team = UserTeam.last team = UserTeam.last
team.projects.each do |project| team.projects.each do |project|
team.members.each do |member| project.merge_requests.each do |merge_request|
project.issues.assigned(member).each do |merge_request|
page.should have_content merge_request.title page.should have_content merge_request.title
end end
end end
end end
end
Given 'project from team has merge requests assigned to team members' do Given 'project from team has merge requests assigned to team members' do
team = UserTeam.last team = UserTeam.last
team.projects.each do |project| team.projects.each do |project|
team.members.each do |member| member = team.members.sample
3.times { create(:merge_request, assignee: member, project: project) } create(:merge_request, assignee: member, project: project)
end
end
end
Then 'I should see merge requests from this team assigned to me' do
team = UserTeam.last
team.projects.each do |project|
team.members.each do |member|
project.issues.assigned(member).each do |merge_request|
page.should have_content merge_request.title
end
end
end end
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