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/static_spec.rb
Joshua Clayton 3282eea658 Move class creation/handling to an anonymous evaluator
This allows for Attribute#to_proc to not require a proxy to be passed to
return a Proc. It also allows for removal of Attribute#add_to
2011-11-30 20:56:58 -05:00

19 lines
503 B
Ruby

require 'spec_helper'
describe FactoryGirl::Attribute::Static do
let(:name) { :first_name }
let(:value) { "John" }
subject { FactoryGirl::Attribute::Static.new(name, value, false) }
its(:name) { should == name }
it "returns the value when executing the proc" do
subject.to_proc.call.should == value
end
end
describe FactoryGirl::Attribute::Static, "with a string name" do
subject { FactoryGirl::Attribute::Static.new("name", nil, false) }
its(:name) { should == :name }
end