diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-15 00:32:44 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 19:58:27 +0300 |
commit | 67314e95ae836365fa1989439a6379aac781a0b4 (patch) | |
tree | 7f364243353cbc8ac311fc54119ad64ec41452b0 /spec | |
parent | 297892011330ecdd2fa7cbe47fbc6fd4f3b62171 (diff) |
Add support to group labels prioritization on project level
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/labels/update_prioritization_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/label_priority_spec.rb | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 84a12a38c26..c9fa8315e79 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -35,7 +35,7 @@ feature 'Prioritize labels', feature: true do end scenario 'user can unprioritize a group label', js: true do - feature.update(priority: 1) + create(:label_priority, project: project, label: feature, priority: 1) visit namespace_project_labels_path(project.namespace, project) @@ -70,7 +70,7 @@ feature 'Prioritize labels', feature: true do end scenario 'user can unprioritize a project label', js: true do - bug.update(priority: 1) + create(:label_priority, project: project, label: bug, priority: 1) visit namespace_project_labels_path(project.namespace, project) @@ -89,8 +89,8 @@ feature 'Prioritize labels', feature: true do end scenario 'user can sort prioritized labels and persist across reloads', js: true do - bug.update(priority: 1) - feature.update(priority: 2) + create(:label_priority, project: project, label: bug, priority: 1) + create(:label_priority, project: project, label: feature, priority: 2) visit namespace_project_labels_path(project.namespace, project) diff --git a/spec/models/label_priority_spec.rb b/spec/models/label_priority_spec.rb index 5f7fa3aa047..d18c2f7949a 100644 --- a/spec/models/label_priority_spec.rb +++ b/spec/models/label_priority_spec.rb @@ -9,7 +9,6 @@ describe LabelPriority, models: true do describe 'validations' do it { is_expected.to validate_presence_of(:project) } it { is_expected.to validate_presence_of(:label) } - it { is_expected.to validate_presence_of(:priority) } it { is_expected.to validate_numericality_of(:priority).only_integer.is_greater_than_or_equal_to(0) } it 'validates uniqueness of label_id scoped to project_id' do |