Sha256: f4a18a1e39f7e19ce2df21df0014d626092c4b51414ee8871cc3299cd461a8be

Contents?: true

Size: 612 Bytes

Versions: 13

Compression:

Stored size: 612 Bytes

Contents

require 'spec_helper'

describe FactoryGirl::Strategy::AttributesFor do
  let(:result)             { { :name => "John Doe", :gender => "Male", :admin => false } }
  let(:attribute_assigner) { stub("attribute assigner", :hash => result) }

  it_should_behave_like "strategy without association support"

  it "returns the hash from the attribute assigner" do
    subject.result(attribute_assigner, lambda {|item| item }).should == result
  end

  it "does not run the to_create block" do
    expect do
      subject.result(attribute_assigner, lambda {|item| raise "failed" })
    end.to_not raise_error
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/factory_girl-2.6.4/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.6.2 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.6.1 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.6.0 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.5.4 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.5.3 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.5.2 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
factory_girl-2.6.4 spec/factory_girl/strategy/attributes_for_spec.rb
factory_girl-2.6.3 spec/factory_girl/strategy/attributes_for_spec.rb
factory_girl-2.6.2 spec/factory_girl/strategy/attributes_for_spec.rb
challah-0.5.1 vendor/bundle/gems/factory_girl-2.6.1/spec/factory_girl/strategy/attributes_for_spec.rb
factory_girl-2.6.1 spec/factory_girl/strategy/attributes_for_spec.rb
factory_girl-2.6.0 spec/factory_girl/strategy/attributes_for_spec.rb