Sha256: bcc122d49877029ef5fd04b79a9dc432ed67121699ff0a0c4a605f5d6f5c89da
Contents?: true
Size: 780 Bytes
Versions: 23
Compression:
Stored size: 780 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require 'factory_girl/syntax/make' describe "a factory using make syntax" do before do Factory.define :user do |factory| factory.first_name 'Bill' factory.last_name 'Nye' factory.email 'science@guys.net' end end after do Factory.factories.clear end describe "after making an instance" do before do @instance = User.make(:last_name => 'Rye') end it "should use attributes from the factory" do @instance.first_name.should == 'Bill' end it "should use attributes passed to make" do @instance.last_name.should == 'Rye' end it "should save the record" do @instance.should_not be_new_record end end end
Version data entries
23 entries across 23 versions & 13 rubygems