2014-09-22 10:30:25 -04:00
|
|
|
class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
|
2013-12-24 12:04:57 -05:00
|
|
|
step 'I should see issues assigned to me' do
|
|
|
|
should_see(assigned_issue)
|
|
|
|
should_not_see(authored_issue)
|
|
|
|
should_not_see(other_issue)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see issues authored by me' do
|
|
|
|
should_see(authored_issue)
|
|
|
|
should_not_see(assigned_issue)
|
|
|
|
should_not_see(other_issue)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see all issues' do
|
|
|
|
should_see(authored_issue)
|
|
|
|
should_see(assigned_issue)
|
|
|
|
should_see(other_issue)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have authored issues' do
|
|
|
|
authored_issue
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have assigned issues' do
|
|
|
|
assigned_issue
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have other issues' do
|
|
|
|
other_issue
|
|
|
|
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'
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-24 12:04:57 -05:00
|
|
|
step 'I click "All" link' do
|
|
|
|
within ".scope-filter" do
|
2014-01-14 06:51:59 -05:00
|
|
|
click_link "Everyone's"
|
2013-12-24 12:04:57 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def should_see(issue)
|
|
|
|
page.should have_content(issue.title[0..10])
|
|
|
|
end
|
|
|
|
|
|
|
|
def should_not_see(issue)
|
|
|
|
page.should_not have_content(issue.title[0..10])
|
|
|
|
end
|
|
|
|
|
|
|
|
def assigned_issue
|
|
|
|
@assigned_issue ||= create :issue, assignee: current_user, project: project
|
|
|
|
end
|
|
|
|
|
|
|
|
def authored_issue
|
|
|
|
@authored_issue ||= create :issue, author: current_user, project: project
|
|
|
|
end
|
|
|
|
|
|
|
|
def other_issue
|
|
|
|
@other_issue ||= create :issue, project: project
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
|
2013-12-24 12:04:57 -05:00
|
|
|
def project
|
|
|
|
@project ||= begin
|
2014-01-22 14:03:52 -05:00
|
|
|
project =create :project
|
2013-12-24 12:04:57 -05:00
|
|
|
project.team << [current_user, :master]
|
|
|
|
project
|
|
|
|
end
|
2012-09-10 04:51:02 -04:00
|
|
|
end
|
|
|
|
end
|