diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-28 13:13:11 -0500 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-02-02 17:47:18 -0500 |
commit | d618e9c8f819053c9c3122cfa1baa4f61d0aebce (patch) | |
tree | 81705040f36fd80f859d7aabba716a47613ff8fb /features | |
parent | 0a08b105801dd9eb0c32e2619a905650e7fe46e5 (diff) | |
download | gitlab-ce-d618e9c8f819053c9c3122cfa1baa4f61d0aebce.tar.gz |
Add specs.
Diffstat (limited to 'features')
-rw-r--r-- | features/project/milestone.feature | 23 | ||||
-rw-r--r-- | features/steps/project/project_milestone.rb | 53 |
2 files changed, 76 insertions, 0 deletions
diff --git a/features/project/milestone.feature b/features/project/milestone.feature new file mode 100644 index 00000000000..e0f4c0e9d7c --- /dev/null +++ b/features/project/milestone.feature @@ -0,0 +1,23 @@ +Feature: Project Milestone + Background: + Given I sign in as a user + And I own project "Shop" + And project "Shop" has labels: "bug", "feature", "enhancement" + And project "Shop" has milestone "v2.2" + And milestone has issue "Bugfix1" with labels: "bug", "feature" + And milestone has issue "Bugfix2" with labels: "bug", "enhancement" + + + @javascript + Scenario: Listing issues from issues tab + Given I visit project "Shop" milestones page + And I click link "v2.2" + Then I should see the labels "bug", "enhancement" and "feature" + + @javascript + Scenario: Listing labels from labels tab + Given I visit project "Shop" milestones page + And I click link "v2.2" + And I click link "Labels" + Then I should see the list of labels + And I should see the labels "bug", "enhancement" and "feature" diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb new file mode 100644 index 00000000000..ec881c0d8fc --- /dev/null +++ b/features/steps/project/project_milestone.rb @@ -0,0 +1,53 @@ +class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps + include SharedAuthentication + include SharedProject + include SharedPaths + + step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do + project = Project.find_by(name: "Shop") + milestone = project.milestones.find_by(title: 'v2.2') + issue = create(:issue, title: "Bugfix1", project: project, milestone: milestone) + issue.labels << project.labels.find_by(title: 'bug') + issue.labels << project.labels.find_by(title: 'feature') + end + + step 'milestone has issue "Bugfix2" with labels: "bug", "enhancement"' do + project = Project.find_by(name: "Shop") + milestone = project.milestones.find_by(title: 'v2.2') + issue = create(:issue, title: "Bugfix2", project: project, milestone: milestone) + issue.labels << project.labels.find_by(title: 'bug') + issue.labels << project.labels.find_by(title: 'enhancement') + end + + step 'project "Shop" has milestone "v2.2"' do + project = Project.find_by(name: "Shop") + milestone = create(:milestone, + title: "v2.2", + project: project, + description: "# Description header" + ) + 3.times { create(:issue, project: project, milestone: milestone) } + end + + step 'I should see the list of labels' do + expect(page).to have_selector('ul.manage-labels-list') + end + + step 'I should see the labels "bug", "enhancement" and "feature"' do + page.within('#tab-issues') do + expect(page).to have_content 'bug' + expect(page).to have_content 'enhancement' + expect(page).to have_content 'feature' + end + end + + step 'I click link "v2.2"' do + click_link "v2.2" + end + + step 'I click link "Labels"' do + page.within('.nav-links') do + page.find(:xpath, "//a[@href='#tab-labels']").click + end + end +end |