forked from openSUSE/open-build-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide some labels for helping in development
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'factory_bot' | ||
|
||
namespace :dev do | ||
namespace :label_templates do | ||
desc 'Create label templates for the home:Admin project' | ||
task :data, [:repetitions] => :development_environment do |_t, args| | ||
include FactoryBot::Syntax::Methods | ||
|
||
args.with_defaults(repetitions: 1) | ||
repetitions = args.repetitions.to_i | ||
|
||
repetitions.times do | ||
project = Project.find_by_name('home:Admin') | ||
create(:label_template, project: project) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FactoryBot.define do | ||
factory :label_template do | ||
name { Faker::Lorem.word.capitalize } | ||
color { "##{(rand * 0xffffff).to_i.to_s(16)}" } # Random value from 0x000000 - 0xffffff | ||
end | ||
end |