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_bot/attribute_spec.rb
Daniel Colson 5b31b56d65 Remove warning about setter methods
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.
2018-09-28 16:59:48 -04:00

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