Commit 21781043 authored by randx's avatar randx

Better cucumber coverage for dashboard

parent 2cf5a9ef
Feature: Dashboard Issues
Background:
Given I signin as a user
And I have assigned issues
And I visit dashboard issues page
Scenario: I should see issues list
Then I should see issues assigned to me
Feature: Dashboard MR
Background:
Given I signin as a user
And I have authored merge requests
And I visit dashboard merge requests page
Scenario: I should see projects list
Then I should see my merge requests
......@@ -65,3 +65,71 @@ Given /^I search for "(.*?)"$/ do |arg1|
fill_in "dashboard_search", :with => arg1
click_button "Search"
end
Given /^I visit dashboard issues page$/ do
visit dashboard_issues_path
end
Then /^I should see issues assigned to me$/ do
issues = @user.issues
issues.each do |issue|
page.should have_content(issue.title[0..10])
page.should have_content(issue.project.name)
end
end
Given /^I visit dashboard merge requests page$/ do
visit dashboard_merge_requests_path
end
Then /^I should see my merge requests$/ do
merge_requests = @user.merge_requests
merge_requests.each do |mr|
page.should have_content(mr.title[0..10])
page.should have_content(mr.project.name)
end
end
Given /^I have assigned issues$/ do
project1 = Factory :project,
:path => "project1",
:code => "TEST1"
project2 = Factory :project,
:path => "project2",
:code => "TEST2"
project1.add_access(@user, :read, :write)
project2.add_access(@user, :read, :write)
issue1 = Factory :issue,
:author => @user,
:assignee => @user,
:project => project1
issue2 = Factory :issue,
:author => @user,
:assignee => @user,
:project => project2
end
Given /^I have authored merge requests$/ do
project1 = Factory :project,
:path => "project1",
:code => "TEST1"
project2 = Factory :project,
:path => "project2",
:code => "TEST2"
project1.add_access(@user, :read, :write)
project2.add_access(@user, :read, :write)
merge_request1 = Factory :merge_request,
:author => @user,
:project => project1
merge_request2 = Factory :merge_request,
:author => @user,
:project => project2
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