Skip to content

Commit

Permalink
Assign package only on factories that are not workflow
Browse files Browse the repository at this point in the history
Also add scm_token to the token workflow factory.
  • Loading branch information
saraycp committed May 27, 2021
1 parent 72bf81a commit 05fceef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/api/spec/factories/tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
factory :token do
string { Faker::Lorem.characters(number: 32) }
user
package
object_to_authorize { package }

factory :service_token, class: 'Token::Service' do
package
object_to_authorize { package }
type { 'Token::Service' }
end

factory :rss_token, class: 'Token::Rss' do
package
object_to_authorize { package }
type { 'Token::Rss' }
end

factory :rebuild_token, class: 'Token::Rebuild' do
package
object_to_authorize { package }
type { 'Token::Rebuild' }
end

factory :release_token, class: 'Token::Release' do
package
object_to_authorize { package }
type { 'Token::Release' }
end

factory :workflow_token, class: 'Token::Workflow' do
type { 'Token::Workflow' }
scm_token { Faker::Lorem.characters(number: 32) }
end
end
end

0 comments on commit 05fceef

Please sign in to comment.