Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-15 02:06:26 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 19:58:27 +0300
commit3c2aaec1f2624ad4817e7ac52120985682afa448 (patch)
tree45832f21636e5a33557f715a5d95c36c6be290a9 /spec/factories/labels.rb
parent99e928f103182b58156edb107b55344eaafc6772 (diff)
Fix sorting by label priorities
Diffstat (limited to 'spec/factories/labels.rb')
-rw-r--r--spec/factories/labels.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/factories/labels.rb b/spec/factories/labels.rb
index 5c789d72bac..3e8822faf97 100644
--- a/spec/factories/labels.rb
+++ b/spec/factories/labels.rb
@@ -3,6 +3,16 @@ FactoryGirl.define do
sequence(:title) { |n| "label#{n}" }
color "#990000"
project
+
+ transient do
+ priority nil
+ end
+
+ after(:create) do |label, evaluator|
+ if evaluator.priority
+ label.priorities.create(project: label.project, priority: evaluator.priority)
+ end
+ end
end
factory :group_label, class: GroupLabel do