Sha256: 1959f4c85e9770ae70a27fbd982784f5bd63860900f2d5f6764608a3dafafd31

Contents?: true

Size: 887 Bytes

Versions: 201

Compression:

Stored size: 887 Bytes

Contents

require 'spec_helper'

describe FactoryGirl::Attribute::Association do
  let(:name)        { :author }
  let(:factory)     { :user }
  let(:overrides)   { { first_name: "John" } }
  let(:association) { stub("association") }

  subject { FactoryGirl::Attribute::Association.new(name, factory, overrides) }
  before  { subject.stubs(association: association) }

  it         { should be_association }
  its(:name) { should == name }

  it "builds the association when calling the proc" do
    subject.to_proc.call.should == association
  end

  it "builds the association when calling the proc" do
    subject.to_proc.call
    subject.should have_received(:association).with(factory, overrides)
  end
end

describe FactoryGirl::Attribute::Association, "with a string name" do
  subject    { FactoryGirl::Attribute::Association.new("name", :user, {}) }
  its(:name) { should == :name }
end

Version data entries

201 entries across 93 versions & 7 rubygems

Version Path
classiccms-0.6.0 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.6.0 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
challah-0.8.1 vendor/bundle/gems/factory_girl-4.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.17 vendor/bundle/gems/factory_girl-3.2.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.16 vendor/bundle/gems/factory_girl-3.2.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.15 vendor/bundle/gems/factory_girl-3.2.0/spec/factory_girl/attribute/association_spec.rb
factory_girl-4.1.0 spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.2.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.14 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.13 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.13 vendor/bundle/gems/factory_girl-3.2.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.13 vendor/bundle/gems/factory_girl-3.0.0/spec/factory_girl/attribute/association_spec.rb
classiccms-0.5.12 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/attribute/association_spec.rb