1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
Commit graph

22 commits

Author SHA1 Message Date
Mandaryn
f1f7719f6e Do not add missing timestamps when using build stubbed strategy 2018-08-05 17:46:38 -04:00
Michael Koper
3db8a120ba Do not raise error for valid build_stubbed methods
decrement, increment, and toggle do not persist the toggled values, so
there is not reason to disable those methods.

Co-authored-by: Alex Tsui <alextsui05@gmail.com>
2018-08-05 17:14:46 -04:00
Oli Peate
01d81f54b5 Remove unnecessary spec_helper requires
https://github.com/rspec/rspec/wiki#rspec
2018-05-21 18:03:28 +01:00
Avielle
c716ce01b4 Replace 'girl' with 'bot' everywhere (#1051)
Also: add a deprecation warning to factory_girl, asking users to switch to
factory_bot

https://github.com/thoughtbot/factory_girl/issues/921
2017-10-20 15:20:28 -04:00
Ryan Ringler
69b72e66de Add use_parent_strategy option for building associations (#961)
This change means that:

1. The option is turned on, and
2. A Post has a User (for example), and
3. We build an association
4. Then the User is built too.

With the flag off, the User would be created, which matches current
behaviour.

See: https://github.com/thoughtbot/factory_girl/pull/749
2016-12-16 05:28:09 -05:00
Alessandro Rodi
d33f29c490 add a default updated_at column when not defined for build_stubbed (#955) 2016-12-16 05:22:13 -05:00
Milo Winningham
6f7b94b159 Clear changed attributes with build_stubbed
Fixes #837
2016-02-05 22:02:22 -05:00
Joshua Clayton
d5a3dddb46 Appraise against Rails 5.0.0.beta
Why?

With Rails' upcoming release, test against the latest beta of Rails 5.
2016-02-05 20:38:29 -05:00
Joshua Clayton
b095f24598 Convert to expect syntax 2013-01-18 13:58:36 -05:00
Ari Pollak
af282a178b Match build_stubbed's created_at type to ActiveRecord
Closes #469
2012-12-21 13:09:32 -08:00
Joshua Clayton
e85c0086aa Allow setting id for build_stubbed objects
Closes #451
2012-11-07 15:44:51 -05:00
Joshua Clayton
330eed801b Update dependency on RSpec 2012-08-02 09:54:48 -04:00
Joshua Clayton
3a8307abbe Move Timecop.return to global after 2012-06-22 17:53:20 -04:00
Joshua Clayton
4bccbb90d1 Allow created_at to be set when using build_stubbed
Closes #390
2012-06-22 14:33:37 -04:00
Joshua Clayton
dc81590a4c Change lambda {}.should to expect {}.to 2012-04-20 16:58:26 -04:00
Joshua Clayton
6c29b11477 Use 1.9 hash syntax 2012-03-16 16:43:23 -04:00
Joshua Clayton
32ff41ffbe Test against ActiveRecord 3.2.0.rc2 and fix bad test 2012-01-13 12:02:08 -05:00
Simone Carletti
4b6ada72cf Ensure the yielded value is returned when block is given.
In the following example, `FactoryGirl.create(:order)` returns 0 because the last expression returns 0.
`:order` is set to 0 causing an unexpected behavior.

    let(:order) {
      FactoryGirl.create(:order) do |order|
        order.save!
        order.total_cents = 0
      end
    }

    order
    # => 0
2011-12-30 01:20:47 -05:00
Justin Ko
f32651d9b2 Calling the syntax methods with a block yields the return object. Closes #210 2011-10-14 09:39:39 -04:00
Joshua Clayton
0b2c4da0a4 Move DefineConstant code into macro 2011-08-19 17:21:54 -04:00
Joshua Clayton
4d8d419375 Don't require a block to be passed when defining a factory 2011-06-29 14:43:20 -04:00
Joe Ferris
6c2322a11d New default syntax for using defined factories 2011-01-26 20:44:24 -05:00
Renamed from spec/acceptance/stub_spec.rb (Browse further)