Sha256: 01ec86bed7c8cc4f105c5ad8113a298ab8e095b351e02e8183fee93b0036be11

Contents?: true

Size: 707 Bytes

Versions: 88

Compression:

Stored size: 707 Bytes

Contents

require "spec_helper"

describe FactoryGirl::StrategyCalculator do
  let(:strategy) do
    define_class("MyAwesomeClass")
  end

  context "when a class" do
    subject { FactoryGirl::StrategyCalculator.new(strategy).strategy }

    it "returns the class passed" do
      subject.should == strategy
    end
  end

  context "when a symbol" do
    before  { FactoryGirl.stubs(:strategy_by_name).returns(strategy) }
    subject { FactoryGirl::StrategyCalculator.new(:build).strategy }

    it "finds the strategy by name" do
      subject
      FactoryGirl.should have_received(:strategy_by_name).with(:build)
    end

    it "returns the strategy found" do
      subject.should == strategy
    end
  end
end

Version data entries

88 entries across 79 versions & 5 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.7.4 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.7.3 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.7.2 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.7.1 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.7.0 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
challah-0.9.1.beta vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
challah-0.9.0 vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
classiccms-0.6.9 vendor/bundle/gems/factory_girl-3.3.0/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.0.0/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-3.6.1/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/factory_girl-3.6.1/spec/factory_girl/strategy_calculator_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/factory_girl-4.0.0/spec/factory_girl/strategy_calculator_spec.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.0.0/spec/factory_girl/strategy_calculator_spec.rb
challah-0.8.3 vendor/bundle/gems/factory_girl-4.1.0/spec/factory_girl/strategy_calculator_spec.rb