summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-18 20:32:04 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-18 20:32:04 +0200
commit25741c97a2ae1446fe03b86cc5e0bd5f49b41cf6 (patch)
tree2922907900e997697632d48ec717228d52fdde38 /features
parent1c61ac1c64e136b391d472a24bbc5538352e299d (diff)
parent4f6b570fbe6e87befd9242f19acee1f14a28574e (diff)
downloadgitlab-ce-25741c97a2ae1446fe03b86cc5e0bd5f49b41cf6.tar.gz
Merge pull request #6350 from tudorpavel/filter-by-multiple-labels
Add feature to filter issues by multiple labels
Diffstat (limited to 'features')
-rw-r--r--features/project/issues/filter_labels.feature26
-rw-r--r--features/steps/project/project_filter_labels.rb70
2 files changed, 96 insertions, 0 deletions
diff --git a/features/project/issues/filter_labels.feature b/features/project/issues/filter_labels.feature
new file mode 100644
index 00000000000..8df7a119e84
--- /dev/null
+++ b/features/project/issues/filter_labels.feature
@@ -0,0 +1,26 @@
+Feature: Project Filter Labels
+ Background:
+ Given I sign in as a user
+ And I own project "Shop"
+ And project "Shop" has issue "Bugfix1" with tags: "bug", "feature"
+ And project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement"
+ And project "Shop" has issue "Feature1" with tags: "feature"
+ Given I visit project "Shop" issues page
+
+ Scenario: I should see project issues
+ Then I should see "bug" in labels filter
+ And I should see "feature" in labels filter
+ And I should see "enhancement" in labels filter
+
+ Scenario: I filter by one label
+ Given I click link "bug"
+ Then I should see "Bugfix1" in issues list
+ And I should see "Bugfix2" in issues list
+ And I should not see "Feature1" in issues list
+
+ Scenario: I filter by two labels
+ Given I click link "bug"
+ And I click link "feature"
+ Then I should see "Bugfix1" in issues list
+ And I should not see "Bugfix2" in issues list
+ And I should not see "Feature1" in issues list
diff --git a/features/steps/project/project_filter_labels.rb b/features/steps/project/project_filter_labels.rb
new file mode 100644
index 00000000000..d507d3417e4
--- /dev/null
+++ b/features/steps/project/project_filter_labels.rb
@@ -0,0 +1,70 @@
+class ProjectFilterLabels < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
+ Then 'I should see "bug" in labels filter' do
+ within ".list-group" do
+ page.should have_content "bug"
+ end
+ end
+
+ And 'I should see "feature" in labels filter' do
+ within ".list-group" do
+ page.should have_content "feature"
+ end
+ end
+
+ And 'I should see "enhancement" in labels filter' do
+ within ".list-group" do
+ page.should have_content "enhancement"
+ end
+ end
+
+ Then 'I should see "Bugfix1" in issues list' do
+ within ".issues-list" do
+ page.should have_content "Bugfix1"
+ end
+ end
+
+ And 'I should see "Bugfix2" in issues list' do
+ within ".issues-list" do
+ page.should have_content "Bugfix2"
+ end
+ end
+
+ And 'I should not see "Bugfix2" in issues list' do
+ within ".issues-list" do
+ page.should_not have_content "Bugfix2"
+ end
+ end
+
+ And 'I should not see "Feature1" in issues list' do
+ within ".issues-list" do
+ page.should_not have_content "Feature1"
+ end
+ end
+
+ Given 'I click link "bug"' do
+ click_link "bug"
+ end
+
+ Given 'I click link "feature"' do
+ click_link "feature"
+ end
+
+ And 'project "Shop" has issue "Bugfix1" with tags: "bug", "feature"' do
+ project = Project.find_by(name: "Shop")
+ create(:issue, title: "Bugfix1", project: project, label_list: ['bug', 'feature'])
+ end
+
+ And 'project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement"' do
+ project = Project.find_by(name: "Shop")
+ create(:issue, title: "Bugfix2", project: project, label_list: ['bug', 'enhancement'])
+ end
+
+ And 'project "Shop" has issue "Feature1" with tags: "feature"' do
+ project = Project.find_by(name: "Shop")
+ create(:issue, title: "Feature1", project: project, label_list: 'feature')
+ end
+end