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/callback_spec.rb

24 lines
533 B
Ruby
Raw Normal View History

require 'spec_helper'
2009-10-10 00:46:19 -04:00
describe Factory::Attribute::Callback do
before do
@name = :after_create
@block = proc{ 'block' }
@attr = Factory::Attribute::Callback.new(@name, @block)
end
it "should have a name" do
@attr.name.should == @name
end
it "should set its callback on a proxy" do
@proxy = "proxy"
mock(@proxy).add_callback(@name, @block)
@attr.add_to(@proxy)
end
it "should convert names to symbols" do
Factory::Attribute::Callback.new('name', nil).name.should == :name
end
end