diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-06-30 16:18:26 +0200 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-06-30 16:18:26 +0200 |
commit | 3e52517da1c506885c06c13ff59ff5863bcb68ea (patch) | |
tree | 42e24badc647d7d4240e01a50d0c1b1d038251ea /features/steps/group | |
parent | eb5182ac8da38e0eadd87cee7385965f05dabc9d (diff) | |
download | gitlab-ce-3e52517da1c506885c06c13ff59ff5863bcb68ea.tar.gz |
Add feature tests for group milestone.
Diffstat (limited to 'features/steps/group')
-rw-r--r-- | features/steps/group/group.rb | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index f321428592f..85276f04dd2 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -164,6 +164,36 @@ class Groups < Spinach::FeatureSteps end end + step 'I click on group milestones' do + click_link 'Milestones' + end + + step 'I should see group milestones index page has no milestones' do + page.should have_content('No milestones to show') + end + + step 'Group has projects with milestones' do + group_milestone + end + + step 'I should see group milestones index page with milestones' do + page.should have_content('Version 7.2') + page.should have_content('GL-113') + page.should have_link('2 Issues', href: group_milestone_path("owned", "version-7-2", title: "Version 7.2")) + page.should have_link('3 Merge Requests', href: group_milestone_path("owned", "gl-113", title: "GL-113")) + end + + step 'I click on one group milestone' do + click_link 'GL-113' + end + + step 'I should see group milestone with all issues and MRs assigned to that milestone' do + page.should have_content('Milestone GL-113') + page.should have_content('Progress: 0 closed – 4 open') + page.should have_link(@issue1.title, href: project_issue_path(@project1, @issue1)) + page.should have_link(@mr3.title, href: project_merge_request_path(@project3, @mr3)) + end + protected def assigned_to_me key @@ -173,4 +203,68 @@ class Groups < Spinach::FeatureSteps def project Group.find_by(name: "Owned").projects.first end + + def group_milestone + group = Group.find_by(name: "Owned") + + @project1 = create :project, + group: group + project2 = create :project, + path: 'gitlab-ci', + group: group + @project3 = create :project, + path: 'cookbook-gitlab', + group: group + milestone1_project1 = create :milestone, + title: "Version 7.2", + project: @project1 + milestone1_project2 = create :milestone, + title: "Version 7.2", + project: project2 + milestone1_project3 = create :milestone, + title: "Version 7.2", + project: @project3 + milestone2_project1 = create :milestone, + title: "GL-113", + project: @project1 + milestone2_project2 = create :milestone, + title: "GL-113", + project: project2 + milestone2_project3 = create :milestone, + title: "GL-113", + project: @project3 + @issue1 = create :issue, + project: @project1, + assignee: current_user, + author: current_user, + milestone: milestone2_project1 + issue2 = create :issue, + project: project2, + assignee: current_user, + author: current_user, + milestone: milestone1_project2 + issue3 = create :issue, + project: @project3, + assignee: current_user, + author: current_user, + milestone: milestone1_project1 + mr1 = create :merge_request, + source_project: @project1, + target_project: @project1, + assignee: current_user, + author: current_user, + milestone: milestone2_project1 + mr2 = create :merge_request, + source_project: project2, + target_project: project2, + assignee: current_user, + author: current_user, + milestone: milestone2_project2 + @mr3 = create :merge_request, + source_project: @project3, + target_project: @project3, + assignee: current_user, + author: current_user, + milestone: milestone2_project3 + end end |