mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
24 lines
416 B
Ruby
24 lines
416 B
Ruby
require 'spec_helper'
|
|
|
|
describe "default strategy" do
|
|
it "uses create when not specified" do
|
|
define_model('User')
|
|
|
|
FactoryGirl.define do
|
|
factory :user
|
|
end
|
|
|
|
Factory(:user).should_not be_new_record
|
|
end
|
|
|
|
it "can be overridden" do
|
|
define_model('User')
|
|
|
|
FactoryGirl.define do
|
|
factory :user, :default_strategy => :build
|
|
end
|
|
|
|
Factory(:user).should be_new_record
|
|
end
|
|
end
|
|
|