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
507 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
2013-01-18 13:27:57 -05:00
its(:name) { should eq name }
2009-04-11 11:27:23 -04:00
it "returns the value when executing the proc" do
2013-01-18 13:27:57 -05:00
expect(subject.to_proc.call).to eq 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) }
2013-01-18 13:27:57 -05:00
its(:name) { should eq :name }
2009-04-11 11:27:23 -04:00
end