Sha256: 53cbb0d12f8444c4f75ed57564ef223dadd1f1c35bfc9a4f24c15de7586b0371

Contents?: true

Size: 597 Bytes

Versions: 15

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

FactoryGirl.define do
  factory :api_subject, class: API::APISubject do
    x509_cn { Faker::Lorem.word }
    description { Faker::Lorem.sentence }
    contact_name { Faker::Name.name }
    contact_mail { Faker::Internet.email }
    enabled true

    trait :authorized do
      transient { permission '*' }

      after(:create) do |api_subject, attrs|
        role = create :role
        permission = create :permission, value: attrs.permission, role: role
        role.permissions << permission
        role.api_subjects << api_subject
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
aaf-gumboot-2.6.3 spec/factories/api_subjects.rb
aaf-gumboot-2.6.2 spec/factories/api_subjects.rb
aaf-gumboot-2.6.1 spec/factories/api_subjects.rb
aaf-gumboot-2.6.0 spec/factories/api_subjects.rb
aaf-gumboot-2.5.1 spec/factories/api_subjects.rb
aaf-gumboot-2.5.0 spec/factories/api_subjects.rb
aaf-gumboot-2.4.0 spec/factories/api_subjects.rb
aaf-gumboot-2.2.0 spec/factories/api_subjects.rb
aaf-gumboot-2.1.4 spec/factories/api_subjects.rb
aaf-gumboot-2.1.3 spec/factories/api_subjects.rb
aaf-gumboot-2.1.1 spec/factories/api_subjects.rb
aaf-gumboot-2.1.0 spec/factories/api_subjects.rb
aaf-gumboot-2.0.1 spec/factories/api_subjects.rb
aaf-gumboot-1.2.0 spec/factories/api_subjects.rb
aaf-gumboot-1.1.0 spec/factories/api_subjects.rb