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_spec.rb

17 lines
516 B
Ruby
Raw Normal View History

require 'spec_helper'
2009-04-11 11:27:23 -04:00
describe FactoryGirl::Attribute do
let(:name) { "user" }
subject { FactoryGirl::Attribute.new(name, false) }
2009-04-11 11:27:23 -04:00
its(:name) { should == name.to_sym }
it { should_not be_association }
it "raises an error when defining an attribute writer" do
error_message = %{factory_girl uses 'f.test value' syntax rather than 'f.test = value'}
expect {
FactoryGirl::Attribute.new('test=', false)
}.to raise_error(FactoryGirl::AttributeDefinitionError, error_message)
2009-04-11 11:27:23 -04:00
end
end