mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
5b31b56d65
This warning made sense when we had static attributes, since somebody might try to write something like: ```rb factory :composer do self.name = "Daniel" end ``` That would create a static declaration when the factory was defined, then raise the error about avoiding writers when the factory was run. Now this code will raise a NoMethodError right away when the factory is being defined.
7 lines
195 B
Ruby
7 lines
195 B
Ruby
describe FactoryBot::Attribute do
|
|
let(:name) { "user" }
|
|
subject { FactoryBot::Attribute.new(name, false) }
|
|
|
|
its(:name) { should eq name.to_sym }
|
|
it { should_not be_association }
|
|
end
|