Sha256: 5f98c7847adb71396b44d34860f9df1800bf75176b8011e5c1b1145490724844
Contents?: true
Size: 1.03 KB
Versions: 59
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' require 'factory_girl/syntax/make' describe "a factory using make syntax" do before do define_model('User', first_name: :string, last_name: :string) FactoryGirl.define do factory :user do first_name 'Bill' last_name 'Nye' end end end describe "after make" do before do @instance = User.make(last_name: 'Rye') end it "uses attributes from the factory" do @instance.first_name.should == 'Bill' end it "uses attributes passed to make" do @instance.last_name.should == 'Rye' end it "builds the record" do @instance.should be_new_record end end describe "after make!" do before do @instance = User.make!(last_name: 'Rye') end it "uses attributes from the factory" do @instance.first_name.should == 'Bill' end it "uses attributes passed to make" do @instance.last_name.should == 'Rye' end it "saves the record" do @instance.should_not be_new_record end end end
Version data entries
59 entries across 59 versions & 4 rubygems