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
2013-01-18 13:58:36 -05:00

19 lines
507 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 eq name }
it "returns the value when executing the proc" do
expect(subject.to_proc.call).to eq value
end
end
describe FactoryGirl::Attribute::Static, "with a string name" do
subject { FactoryGirl::Attribute::Static.new("name", nil, false) }
its(:name) { should eq :name }
end