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
2012-02-10 18:19:17 -05:00

16 lines
516 B
Ruby

require 'spec_helper'
describe FactoryGirl::Attribute do
let(:name) { "user" }
subject { FactoryGirl::Attribute.new(name, false) }
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)
end
end