Sha256: 4f2cca88a74f35d0abf012270e270abaa1732aa961c63f3ae74d83dd2dadef3d

Contents?: true

Size: 635 Bytes

Versions: 16

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe FactoryGirl::Strategy::Create do
  it_should_behave_like "strategy with association support", :create
  it_should_behave_like "strategy with callbacks", :after_build, :before_create, :after_create

  it "runs a custom create block" do
    evaluation_class = Class.new do
      def initialize
        @block_run = false
      end

      attr_reader :block_run

      def create(*instance)
        @block_run = true
      end
    end

    evaluation = evaluation_class.new
    evaluation.stubs(object: nil, notify: nil)
    subject.result(evaluation)
    expect(evaluation.block_run).to be_true
  end
end

Version data entries

16 entries across 13 versions & 5 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/factory_girl-4.5.0/spec/factory_girl/strategy/create_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/strategy/create_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/strategy/create_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/strategy/create_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/spec/factory_girl/strategy/create_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/spec/factory_girl/strategy/create_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/spec/factory_girl/strategy/create_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/spec/factory_girl/strategy/create_spec.rb
factory_girl-4.5.0 spec/factory_girl/strategy/create_spec.rb
factory_girl-4.4.0 spec/factory_girl/strategy/create_spec.rb
factory_girl-4.3.0 spec/factory_girl/strategy/create_spec.rb
challah-1.0.0 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/strategy/create_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/strategy/create_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/strategy/create_spec.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/strategy/create_spec.rb
factory_girl-4.2.0 spec/factory_girl/strategy/create_spec.rb