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/acceptance/private_attributes_spec.rb

19 lines
337 B
Ruby

describe "setting private attributes" do
it "raises a NoMethodError" do
define_class("User") do
private
attr_accessor :foo
end
FactoryBot.define do
factory :user do
foo { 123 }
end
end
expect do
FactoryBot.build(:user)
end.to raise_error NoMethodError, /foo=/
end
end