Sha256: dedbab99fdaf88436587ed0e4f17adaad43d6b6be14ff70a3d5b13b1ebc616a0
Contents?: true
Size: 722 Bytes
Versions: 11
Compression:
Stored size: 722 Bytes
Contents
require 'spec_helper' describe "create multiple instances" do before do define_model('Post', title: :string, position: :integer) FactoryGirl.define do factory(:post) do |post| post.title "Through the Looking Glass" post.position { rand(10**4) } end end end context "without default attributes" do subject { FactoryGirl.create_pair(:post) } its(:length) { should eq 2 } it "creates all the posts" do subject.each do |record| expect(record).not_to be_new_record end end it "uses the default factory values" do subject.each do |record| expect(record.title).to eq "Through the Looking Glass" end end end end
Version data entries
11 entries across 8 versions & 4 rubygems