mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
25 lines
455 B
Ruby
25 lines
455 B
Ruby
require 'spec_helper'
|
|
require 'acceptance/acceptance_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
|
|
|