Sha256: f758a66830dbd9653b3d64b2a59382bbf4117c86928083ef3e1732ee4124b89a

Contents?: true

Size: 577 Bytes

Versions: 3

Compression:

Stored size: 577 Bytes

Contents

FactoryGirl.define do
  factory :user do
    email { Faker::Internet.email }
    password 'password'
    first_name { Faker::Name.first_name }
    last_name { Faker::Name.last_name }

    after(:build) do |user|
      user.stub(:push_to_mailchimp).and_return(false)
    end
  end

  factory :user_in_organization, :parent => :user do
    after(:create) do |user|
      org = FactoryGirl.create(:organization)
      user.organizations << org
      user.stub(:current_organization).and_return(org)
      user.reload

      org.make_owner(user)
      org.reload
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.23 spec/factories/user_factories.rb
artfully_ose-1.2.0.pre.21 spec/factories/user_factories.rb
artfully_ose-1.2.0.pre.20 spec/factories/user_factories.rb