Sha256: 58082a30727312c2cd23ed4256e7473f417291a96ce584bd6aaec01c1d58b55f

Contents?: true

Size: 503 Bytes

Versions: 16

Compression:

Stored size: 503 Bytes

Contents

require 'spec_helper'

describe FactoryGirl::Attribute::Sequence do
  let(:sequence_name) { :name }
  let(:name)          { :first_name }
  let(:sequence)      { FactoryGirl::Sequence.new(sequence_name, 5) { |n| "Name #{n}" } }

  subject { FactoryGirl::Attribute::Sequence.new(name, sequence_name, false) }
  before  { FactoryGirl.register_sequence(sequence) }

  its(:name) { should eq name }

  it "assigns the next value in the sequence" do
    expect(subject.to_proc.call).to eq "Name 5"
  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/attribute/sequence_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/attribute/sequence_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/attribute/sequence_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/factory_girl-4.5.0/spec/factory_girl/attribute/sequence_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/factory_girl-4.4.0/spec/factory_girl/attribute/sequence_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/attribute/sequence_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/attribute/sequence_spec.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/factory_girl-4.4.0/spec/factory_girl/attribute/sequence_spec.rb
factory_girl-4.5.0 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-4.4.0 spec/factory_girl/attribute/sequence_spec.rb
factory_girl-4.3.0 spec/factory_girl/attribute/sequence_spec.rb
challah-1.0.0 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/attribute/sequence_spec.rb
challah-1.0.0.beta3 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/attribute/sequence_spec.rb
challah-1.0.0.beta2 vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/attribute/sequence_spec.rb
challah-1.0.0.beta vendor/bundle/gems/factory_girl-4.2.0/spec/factory_girl/attribute/sequence_spec.rb
factory_girl-4.2.0 spec/factory_girl/attribute/sequence_spec.rb