Skip to content

Commit

Permalink
Create Talk admin roles for copied projects
Browse files Browse the repository at this point in the history
  • Loading branch information
zwolf committed Oct 18, 2023
1 parent 30b8a29 commit 2db3c35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/project_copier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def copy
# to keep the translations system working with these copied resources
setup_associated_primary_language_translations(copied_project)

# Creates Talk roles via background worker
TalkAdminCreateWorker.perform_async(copied_project.id)

# return the newly copied project
copied_project
end
Expand Down
7 changes: 7 additions & 0 deletions spec/lib/project_copier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
expect(copied_project.configuration['source_project_id']).to be(project.id)
end

it 'creates Talk roles for the new project and its owner' do
expect(TalkAdminCreateWorker)
.to receive(:perform_async)
.with(be_kind_of(Integer))
copied_project
end

context 'when a project has active_worklfows' do
it 'creates a valid workflow copy' do
expect(copied_project.active_workflows.first).to be_valid
Expand Down

0 comments on commit 2db3c35

Please sign in to comment.