1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec/factory_bot/attribute/sequence_spec.rb

15 lines
471 B
Ruby
Raw Permalink Normal View History

describe FactoryBot::Attribute::Sequence do
let(:sequence_name) { :name }
let(:name) { :first_name }
let(:sequence) { FactoryBot::Sequence.new(sequence_name, 5) { |n| "Name #{n}" } }
subject { FactoryBot::Attribute::Sequence.new(name, sequence_name, false) }
before { FactoryBot::Internal.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