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
2011-08-19 17:21:14 -04:00

22 lines
574 B
Ruby

require 'spec_helper'
describe FactoryGirl::Attribute::Static do
let(:name) { :first_name }
let(:value) { "John" }
let(:proxy) { stub("proxy") }
subject { FactoryGirl::Attribute::Static.new(name, value) }
its(:name) { should == name }
it "sets its static value on a proxy" do
proxy.stubs(:set)
subject.add_to(proxy)
proxy.should have_received(:set).with(name, value)
end
end
describe FactoryGirl::Attribute::Static, "with a string name" do
subject { FactoryGirl::Attribute::Static.new("name", nil) }
its(:name) { should == :name }
end