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

23 lines
591 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" }
let(:proxy) { stub("proxy") }
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 "sets its static value on a proxy" do
proxy.stubs(:set)
subject.add_to(proxy)
proxy.should have_received(:set).with(subject, 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