diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-22 22:42:06 +0400 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-22 22:42:06 +0400 |
commit | 42abdf69d59ecf28688af5994ff2e324c50a6d33 (patch) | |
tree | 3f7f9a2f43547af2de67641eee87d98304e35129 /features/steps/group | |
parent | 83dc5f936290cd928362c56959a40b906a2acd15 (diff) |
More group tests with spinach
Diffstat (limited to 'features/steps/group')
-rw-r--r-- | features/steps/group/group.rb | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index 798c62c3a11..51581a1ec7b 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -2,10 +2,6 @@ class Groups < Spinach::FeatureSteps include SharedAuthentication include SharedPaths - When 'I visit group page' do - visit group_path(current_group) - end - Then 'I should see projects list' do current_user.projects.each do |project| page.should have_link project.name @@ -24,9 +20,43 @@ class Groups < Spinach::FeatureSteps page.should have_content 'closed issue' end + Then 'I should see issues from this group assigned to me' do + assigned_to_me(:issues).each do |issue| + page.should have_content issue.title + end + end + + Then 'I should see merge requests from this group assigned to me' do + assigned_to_me(:merge_requests).each do |issue| + page.should have_content issue.title + end + end + + Given 'project from group has issues assigned to me' do + create :issue, + project: project, + assignee: current_user, + author: current_user + end + + Given 'project from group has merge requests assigned to me' do + create :merge_request, + project: project, + assignee: current_user, + author: current_user + end + protected def current_group @group ||= Group.first end + + def project + current_group.projects.first + end + + def assigned_to_me key + project.send(key).where(assignee_id: current_user.id) + end end |