diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-02-29 13:16:00 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-01 12:13:04 +0100 |
commit | 9052086d7b6c46d148854932ac5ee71462936568 (patch) | |
tree | d6ce41d704c1e0cb40fa6d6af9fe530aad9105fb | |
parent | 5c8f6ba3ddc71f98e91b5679797e565e66f29b1b (diff) | |
download | gitlab-ce-9052086d7b6c46d148854932ac5ee71462936568.tar.gz |
Merge branch 'issue_13621' into 'master'
Don't repeat labels listed on Labels tab.
Fixes #13622
See merge request !2924
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/models/milestone.rb | 2 | ||||
-rw-r--r-- | features/project/milestone.feature | 1 | ||||
-rw-r--r-- | features/steps/project/project_milestone.rb | 6 |
4 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index 91d1a5ef67d..a55298c2e53 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.5.2 - Fix sidebar overlapping content when screen width was below 1200px + - Don't repeat labels listed on Labels tab - Bring the "branded appearance" feature from EE to CE - Fix error 500 when commenting on a commit - Update Rails to 4.2.5.2 diff --git a/app/models/milestone.rb b/app/models/milestone.rb index cbe65d70997..8f99e3bef9b 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -27,7 +27,7 @@ class Milestone < ActiveRecord::Base belongs_to :project has_many :issues - has_many :labels, through: :issues + has_many :labels, -> { distinct.reorder('labels.title') }, through: :issues has_many :merge_requests has_many :participants, through: :issues, source: :assignee diff --git a/features/project/milestone.feature b/features/project/milestone.feature index e0f4c0e9d7c..713f0f3b979 100644 --- a/features/project/milestone.feature +++ b/features/project/milestone.feature @@ -13,6 +13,7 @@ Feature: Project Milestone Given I visit project "Shop" milestones page And I click link "v2.2" Then I should see the labels "bug", "enhancement" and "feature" + And I should see the "bug" label listed only once @javascript Scenario: Listing labels from labels tab diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb index ec881c0d8fc..2508c09e36d 100644 --- a/features/steps/project/project_milestone.rb +++ b/features/steps/project/project_milestone.rb @@ -41,6 +41,12 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps end end + step 'I should see the "bug" label listed only once' do + page.within('#tab-labels') do + expect(page).to have_content('bug', count: 1) + end + end + step 'I click link "v2.2"' do click_link "v2.2" end |