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_girl/attribute/sequence_spec.rb
Joshua Clayton 554e6ab378 rr => mocha
2011-08-13 00:12:47 -04:00

20 lines
548 B
Ruby

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 = stub("proxy", :set => nil)
@attr.add_to(proxy)
proxy.should have_received(:set).with(@name, "Name 5")
end
end