lib/meibo/factory_bot/user.rb in meibo-0.8.0 vs lib/meibo/factory_bot/user.rb in meibo-0.9.0
- old
+ new
@@ -16,15 +16,17 @@
sequence(:username) {|n| "user#{n}@example.com" }
sequence(:given_name) {|n| "John#{n}" }
sequence(:family_name) {|n| "Doe#{n}" }
agent_sourced_ids { agents&.map(&:sourced_id) }
primary_org_sourced_id { primary_organization&.sourced_id }
- end
- factory :meibo_jp_user, class: 'Meibo::JapanProfile::User', parent: :meibo_user do
- transient do
- homeroom { nil }
- end
+ trait :jp do
+ initialize_with { Meibo::JapanProfile::User.new(**attributes) }
- home_class { homeroom&.sourced_id }
+ transient do
+ homeroom { nil }
+ end
+
+ home_class { homeroom&.sourced_id }
+ end
end
end