diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-10-27 21:26:56 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-10-27 21:26:56 -0300 |
commit | 7bd6ff03d8cc08673497e3b574efce1648f27da0 (patch) | |
tree | bb7022f70629314644270849c5c40da01ecf3f8e /spec/models/concerns | |
parent | 20a7db4483904c7280093a0309a63dfd1b7ef72e (diff) | |
download | gitlab-ce-7bd6ff03d8cc08673497e3b574efce1648f27da0.tar.gz |
Fix and improve `Sortable.highest_label_priority`23928-sortable-highest_label_priority-is-bugged
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 60e4bbc8564..a59d30687f6 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -298,6 +298,20 @@ describe Issue, "Issuable" do end end + describe '.order_labels_priority' do + let(:label_1) { create(:label, title: 'label_1', project: issue.project, priority: 1) } + let(:label_2) { create(:label, title: 'label_2', project: issue.project, priority: 2) } + + subject { Issue.order_labels_priority(excluded_labels: ['label_1']).first.highest_priority } + + before do + issue.labels << label_1 + issue.labels << label_2 + end + + it { is_expected.to eq(2) } + end + describe ".with_label" do let(:project) { create(:project, :public) } let(:bug) { create(:label, project: project, title: 'bug') } |