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
2013-01-18 13:58:36 -05:00

16 lines
512 B
Ruby

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