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

20 lines
503 B
Ruby
Raw Normal View History

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