Sha256: c8044aeae42fdf406f7606dc2995a875a00d3eb9d41e6ca4b51ddc38ec7b680f

Contents?: true

Size: 603 Bytes

Versions: 31

Compression:

Stored size: 603 Bytes

Contents

FactoryGirl.define do

  factory :role, class: Ddr::Auth::Roles::Role do

    initialize_with { Ddr::Auth::Roles::Role.new(attributes) }

    Ddr::Auth::Roles.role_types.each do |rt|
      trait rt.to_s.downcase.to_sym do
        role_type rt.to_s
      end
    end

    trait :person do
      sequence(:agent) { |n| "person#{n}@example.com" }
    end

    trait :group do
      sequence(:agent) { |n| "Group#{n}" }
    end

    trait :public do
      agent Ddr::Auth::Groups::PUBLIC
    end

    Ddr::Auth::Roles::SCOPES.each do |s|
      trait s.to_sym do
        scope s
      end
    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.16 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.15 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.14 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.13 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.12 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.11 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.10 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.9 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.8 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.7 spec/factories/role_factories.rb
ddr-models-3.0.0.beta.6 spec/factories/role_factories.rb