Skip to content

Commit

Permalink
Add a factory for staging workflow manager groups
Browse files Browse the repository at this point in the history
We need to ensure that there are no conflicts between the
generated group titles, to be able to create multiple staging
workflow factories.
  • Loading branch information
bgeuken committed Nov 19, 2018
1 parent 0b8bad4 commit 80f7378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/api/spec/factories/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
group.groups_users.create(user: evaluator.user)
end
end

factory :staging_workflow_group do
sequence(:title) { |n| "staging-workflow-managers-#{n}" }
end
end
end
2 changes: 1 addition & 1 deletion src/api/spec/factories/staging_workflow.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :staging_workflow, class: 'Staging::Workflow' do
project
association :managers_group, factory: :group, title: 'staging-workflow-managers'
association :managers_group, factory: :staging_workflow_group

factory :staging_workflow_with_staging_projects do
initialize_with { new(attributes) }
Expand Down

0 comments on commit 80f7378

Please sign in to comment.