Sha256: e4aa7b1da4377418c3c0cfc665452457f4255ec9978ad4c9414e873b0f39cb0d
Contents?: true
Size: 1.33 KB
Versions: 5
Compression:
Stored size: 1.33 KB
Contents
FactoryBot.define do factory :account, class: Pageflow::Account do name 'Account Name' after(:build) do |account| account.default_theming ||= build(:theming, account: account) end transient do with_member nil with_previewer nil with_editor nil with_publisher nil with_manager nil with_feature nil end after(:create) do |account, evaluator| create(:membership, entity: account, user: evaluator.with_member, role: :member) if evaluator.with_member create(:membership, entity: account, user: evaluator.with_previewer, role: :previewer) if evaluator.with_previewer create(:membership, entity: account, user: evaluator.with_editor, role: :editor) if evaluator.with_editor create(:membership, entity: account, user: evaluator.with_publisher, role: :publisher) if evaluator.with_publisher create(:membership, entity: account, user: evaluator.with_manager, role: :manager) if evaluator.with_manager end after(:build) do |entry, evaluator| entry.features_configuration = entry.features_configuration.merge(evaluator.with_feature => true) end end end
Version data entries
5 entries across 5 versions & 1 rubygems