2012-09-10 04:51:02 -04:00
|
|
|
class DashboardMergeRequests < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
|
2013-12-24 11:22:48 -05:00
|
|
|
step 'I should see merge requests assigned to me' do
|
|
|
|
should_see(assigned_merge_request)
|
|
|
|
should_not_see(authored_merge_request)
|
|
|
|
should_not_see(other_merge_request)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see merge requests authored by me' do
|
|
|
|
should_see(authored_merge_request)
|
|
|
|
should_not_see(assigned_merge_request)
|
|
|
|
should_not_see(other_merge_request)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see all merge requests' do
|
|
|
|
should_see(authored_merge_request)
|
|
|
|
should_see(assigned_merge_request)
|
|
|
|
should_see(other_merge_request)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have authored merge requests' do
|
|
|
|
authored_merge_request
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have assigned merge requests' do
|
|
|
|
assigned_merge_request
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have other merge requests' do
|
|
|
|
other_merge_request
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click "Authored by me" link' do
|
|
|
|
within ".scope-filter" do
|
2013-12-25 02:19:51 -05:00
|
|
|
click_link 'Created by me'
|
2013-12-24 11:22:48 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click "All" link' do
|
|
|
|
within ".scope-filter" do
|
2014-01-14 06:51:59 -05:00
|
|
|
click_link "Everyone's"
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-24 11:22:48 -05:00
|
|
|
def should_see(merge_request)
|
|
|
|
page.should have_content(merge_request.title[0..10])
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
|
2013-12-24 11:22:48 -05:00
|
|
|
def should_not_see(merge_request)
|
|
|
|
page.should_not have_content(merge_request.title[0..10])
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
|
2013-12-24 11:22:48 -05:00
|
|
|
def assigned_merge_request
|
2014-04-03 03:36:10 -04:00
|
|
|
@assigned_merge_request ||= create :merge_request, assignee: current_user, target_project: project, source_project: project
|
2013-12-24 11:22:48 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def authored_merge_request
|
2014-04-03 03:36:10 -04:00
|
|
|
@authored_merge_request ||= create :merge_request, source_branch: 'simple_merge_request', author: current_user, target_project: project, source_project: project
|
2013-12-24 11:22:48 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def other_merge_request
|
2014-04-03 03:36:10 -04:00
|
|
|
@other_merge_request ||= create :merge_request, source_branch: '2_3_notes_fix', target_project: project, source_project: project
|
2013-12-24 11:22:48 -05:00
|
|
|
end
|
2013-04-25 10:15:33 -04:00
|
|
|
|
2013-12-24 11:22:48 -05:00
|
|
|
def project
|
|
|
|
@project ||= begin
|
2014-01-22 14:03:52 -05:00
|
|
|
project =create :project
|
2013-12-24 11:22:48 -05:00
|
|
|
project.team << [current_user, :master]
|
|
|
|
project
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
end
|