Sha256: a350d64ad857e220937f3a95336a5b38518eaaf86b8abda2f84e6af4ba977456

Contents?: true

Size: 605 Bytes

Versions: 86

Compression:

Stored size: 605 Bytes

Contents

FactoryGirl.define do

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

    initialize_with { Ddr::Auth::Roles::Role.build(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

86 entries across 86 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/factories/role_factories.rb
ddr-models-2.10.2 spec/factories/role_factories.rb
ddr-models-2.10.1 spec/factories/role_factories.rb
ddr-models-2.10.0 spec/factories/role_factories.rb
ddr-models-2.10.0.rc2 spec/factories/role_factories.rb
ddr-models-2.10.0.rc1 spec/factories/role_factories.rb
ddr-models-2.9.2 spec/factories/role_factories.rb
ddr-models-2.9.1 spec/factories/role_factories.rb
ddr-models-2.9.0 spec/factories/role_factories.rb
ddr-models-2.9.0.rc1 spec/factories/role_factories.rb
ddr-models-2.8.0 spec/factories/role_factories.rb
ddr-models-2.8.0.rc1 spec/factories/role_factories.rb
ddr-models-2.7.6 spec/factories/role_factories.rb
ddr-models-2.7.5 spec/factories/role_factories.rb
ddr-models-2.7.4 spec/factories/role_factories.rb
ddr-models-2.7.3 spec/factories/role_factories.rb
ddr-models-2.7.2 spec/factories/role_factories.rb
ddr-models-2.7.1 spec/factories/role_factories.rb
ddr-models-2.7.0 spec/factories/role_factories.rb
ddr-models-2.7.0.rc1 spec/factories/role_factories.rb