2010-06-10 13:37:51 -04:00
|
|
|
require 'spec_helper'
|
2009-04-11 11:27:23 -04:00
|
|
|
|
2010-06-24 09:45:57 -04:00
|
|
|
describe FactoryGirl::Attribute::Static do
|
2011-08-13 01:03:12 -04:00
|
|
|
let(:name) { :first_name }
|
|
|
|
let(:value) { "John" }
|
2009-04-11 11:27:23 -04:00
|
|
|
|
2011-10-07 18:19:27 -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
|
|
|
|
2011-11-22 18:01:01 -05: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
|
2011-08-13 01:03:12 -04:00
|
|
|
end
|
2009-04-11 11:27:23 -04:00
|
|
|
|
2011-08-13 01:03:12 -04:00
|
|
|
describe FactoryGirl::Attribute::Static, "with a string name" do
|
2011-10-07 18:19:27 -04:00
|
|
|
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
|