Sha256: 09e12b206122845a11488f92b12bc9c74caa82323d78251eadf464902a7adb20

Contents?: true

Size: 542 Bytes

Versions: 13

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'

describe FactoryGirl::Attribute::Sequence do
  before do
    @name     = :first_name
    @sequence = :name
    FactoryGirl.register_sequence(FactoryGirl::Sequence.new(@sequence, 5) { |n| "Name #{n}" })
    @attr  = FactoryGirl::Attribute::Sequence.new(@name, @sequence)
  end

  it "should have a name" do
    @attr.name.should == @name
  end

  it "assigns the next value in the sequence" do
    proxy = "proxy"
    stub(proxy).set
    @attr.add_to(proxy)
    proxy.should have_received.set(@name, "Name 5")
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
factory_girl-2.0.4 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.3 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.2 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.1 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.rc4 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.rc3 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.rc2 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.rc1 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.beta5 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.beta4 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-2.0.0.beta3 spec/factory_girl/attribute/sequence_spec.rb
factory_girl_kibiz0r-2.0.0.beta3 spec/factory_girl/attribute/sequence_spec.rb
factory_girl_kibiz0r-2.0.0.beta2 spec/factory_girl/attribute/sequence_spec.rb