Commit 217810433b332a55b9620fcfe016735f33f8637d
1 parent
2cf5a9ef
Exists in
master
and in
4 other branches
Better cucumber coverage for dashboard
Showing
3 changed files
with
84 additions
and
0 deletions
Show diff stats
features/step_definitions/dashboard_steps.rb
@@ -65,3 +65,71 @@ Given /^I search for "(.*?)"$/ do |arg1| | @@ -65,3 +65,71 @@ Given /^I search for "(.*?)"$/ do |arg1| | ||
65 | fill_in "dashboard_search", :with => arg1 | 65 | fill_in "dashboard_search", :with => arg1 |
66 | click_button "Search" | 66 | click_button "Search" |
67 | end | 67 | end |
68 | + | ||
69 | +Given /^I visit dashboard issues page$/ do | ||
70 | + visit dashboard_issues_path | ||
71 | +end | ||
72 | + | ||
73 | +Then /^I should see issues assigned to me$/ do | ||
74 | + issues = @user.issues | ||
75 | + issues.each do |issue| | ||
76 | + page.should have_content(issue.title[0..10]) | ||
77 | + page.should have_content(issue.project.name) | ||
78 | + end | ||
79 | +end | ||
80 | + | ||
81 | +Given /^I visit dashboard merge requests page$/ do | ||
82 | + visit dashboard_merge_requests_path | ||
83 | +end | ||
84 | + | ||
85 | +Then /^I should see my merge requests$/ do | ||
86 | + merge_requests = @user.merge_requests | ||
87 | + merge_requests.each do |mr| | ||
88 | + page.should have_content(mr.title[0..10]) | ||
89 | + page.should have_content(mr.project.name) | ||
90 | + end | ||
91 | +end | ||
92 | + | ||
93 | +Given /^I have assigned issues$/ do | ||
94 | + project1 = Factory :project, | ||
95 | + :path => "project1", | ||
96 | + :code => "TEST1" | ||
97 | + | ||
98 | + project2 = Factory :project, | ||
99 | + :path => "project2", | ||
100 | + :code => "TEST2" | ||
101 | + | ||
102 | + project1.add_access(@user, :read, :write) | ||
103 | + project2.add_access(@user, :read, :write) | ||
104 | + | ||
105 | + issue1 = Factory :issue, | ||
106 | + :author => @user, | ||
107 | + :assignee => @user, | ||
108 | + :project => project1 | ||
109 | + | ||
110 | + issue2 = Factory :issue, | ||
111 | + :author => @user, | ||
112 | + :assignee => @user, | ||
113 | + :project => project2 | ||
114 | +end | ||
115 | + | ||
116 | +Given /^I have authored merge requests$/ do | ||
117 | + project1 = Factory :project, | ||
118 | + :path => "project1", | ||
119 | + :code => "TEST1" | ||
120 | + | ||
121 | + project2 = Factory :project, | ||
122 | + :path => "project2", | ||
123 | + :code => "TEST2" | ||
124 | + | ||
125 | + project1.add_access(@user, :read, :write) | ||
126 | + project2.add_access(@user, :read, :write) | ||
127 | + | ||
128 | + merge_request1 = Factory :merge_request, | ||
129 | + :author => @user, | ||
130 | + :project => project1 | ||
131 | + | ||
132 | + merge_request2 = Factory :merge_request, | ||
133 | + :author => @user, | ||
134 | + :project => project2 | ||
135 | +end |