mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
3282eea658
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
19 lines
503 B
Ruby
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
|