Sha256: 6a0d5ec233e0615a158e67a6a1f3970326349d543b9acf66a84bf379fc2ec6a4

Contents?: true

Size: 655 Bytes

Versions: 20

Compression:

Stored size: 655 Bytes

Contents

FactoryGirl.define do
  factory :profile, :class => Profile do |f|
    f.user_group_id {UserGroup.first.id}
    f.required_role_id {Role.where(name: 'User').first.id}
    f.sequence(:user_number){|n| "user_number_#{n}"}
    f.library_id 2
    f.locale "ja"
    factory :librarian_profile, :class => Profile do |profile|
      profile.required_role_id {Role.where(name: 'Librarian').first.id}
      profile.association :user, factory: :librarian
    end
    factory :admin_profile, :class => Profile do |profile|
      profile.required_role_id {Role.where(name: 'Administrator').first.id}
      profile.association :user, factory: :admin
    end
  end
end

Version data entries

20 entries across 18 versions & 3 rubygems

Version Path
enju_seed-0.2.2 spec/factories/profile.rb
enju_leaf-1.2.1 spec/factories/profile.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.1/spec/factories/profile.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_seed-0.2.0/spec/factories/profile.rb
enju_seed-0.2.1 spec/factories/profile.rb
enju_search_log-0.2.0 spec/factories/profile.rb
enju_leaf-1.2.0 spec/factories/profile.rb
enju_seed-0.2.0 spec/factories/profile.rb
enju_leaf-1.2.0.beta.4 spec/factories/profile.rb
enju_seed-0.2.0.beta.7 spec/factories/profile.rb
enju_search_log-0.2.0.beta.3 spec/factories/profile.rb
enju_leaf-1.2.0.beta.3 spec/factories/profile.rb
enju_seed-0.2.0.beta.6 spec/factories/profile.rb
enju_seed-0.2.0.beta.5 spec/factories/profile.rb
enju_seed-0.2.0.beta.4 spec/factories/profile.rb
enju_leaf-1.2.0.beta.2 spec/factories/profile.rb
enju_seed-0.2.0.beta.3 spec/factories/profile.rb
enju_seed-0.2.0.beta.2 spec/factories/profile.rb
enju_seed-0.2.0.beta.1 spec/factories/profile.rb
enju_leaf-1.2.0.beta.1 spec/factories/profile.rb