diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/issues.feature | 8 | ||||
-rw-r--r-- | features/dashboard/merge_requests.feature | 8 | ||||
-rw-r--r-- | features/step_definitions/dashboard_steps.rb | 68 |
3 files changed, 84 insertions, 0 deletions
diff --git a/features/dashboard/issues.feature b/features/dashboard/issues.feature new file mode 100644 index 00000000000..c3361bb313f --- /dev/null +++ b/features/dashboard/issues.feature @@ -0,0 +1,8 @@ +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 diff --git a/features/dashboard/merge_requests.feature b/features/dashboard/merge_requests.feature new file mode 100644 index 00000000000..90b8749c5a7 --- /dev/null +++ b/features/dashboard/merge_requests.feature @@ -0,0 +1,8 @@ +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 diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb index 7133d799995..bd9d69b8531 100644 --- a/features/step_definitions/dashboard_steps.rb +++ b/features/step_definitions/dashboard_steps.rb @@ -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 |