Skip to content

Commit

Permalink
Move associations and trait inside base token factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Dany Marcoux committed Apr 26, 2021
1 parent 8ee65ed commit e7f4d57
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/api/spec/factories/tokens.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FactoryBot.define do
factory :token do
string { Faker::Lorem.characters(number: 32) }
user
package

trait :with_package_from_association_or_param do
package_from_association_or_params { package }
end

factory :service_token, class: 'Token::Service' do
type { 'Token::Service' }
user
package
trait :with_package_from_association_or_param do
package_from_association_or_params { package }
end
end

factory :rss_token, class: 'Token::Rss' do
Expand All @@ -17,20 +18,10 @@

factory :rebuild_token, class: 'Token::Rebuild' do
type { 'Token::Rebuild' }
user
package
trait :with_package_from_association_or_param do
package_from_association_or_params { package }
end
end

factory :release_token, class: 'Token::Release' do
type { 'Token::Release' }
user
package
trait :with_package_from_association_or_param do
package_from_association_or_params { package }
end
end
end
end

0 comments on commit e7f4d57

Please sign in to comment.