Sha256: 93cd742f802868e82373fa85651497842a5a716cf601ac9c6e9c0f5c484adb42

Contents?: true

Size: 576 Bytes

Versions: 7

Compression:

Stored size: 576 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

7 entries across 7 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 spec/factories/user_factories.rb
artfully_ose-1.2.0.beta.1 spec/factories/user_factories.rb
artfully_ose-1.2.0.alpha.2 spec/factories/user_factories.rb
artfully_ose-1.2.0.alpha.1 spec/factories/user_factories.rb
artfully_ose-1.2.0.pre.27 spec/factories/user_factories.rb
artfully_ose-1.2.0.pre.26 spec/factories/user_factories.rb
artfully_ose-1.2.0.pre.24 spec/factories/user_factories.rb