Most of this was fixed by adding the `attribute-defined-statically-cop`
branch of `thoughtbot/rubocop-rspec` to the Gemfile and running:
```sh
rubocop \
--require rubocop-rspec \
--only FactoryBot/AttributeDefinedStatically \
--auto-correct
```
I had to update the cucumber tests manually, and I realized our changes
don't handle `ignore` blocks or blocks with arity 1 that use the yielded
DefinitionProxy. I will update
https://github.com/rubocop-hq/rubocop-rspec/pull/666to handle these
cases.
In the following example, `FactoryGirl.create(:order)` returns 0 because the last expression returns 0.
`:order` is set to 0 causing an unexpected behavior.
let(:order) {
FactoryGirl.create(:order) do |order|
order.save!
order.total_cents = 0
end
}
order
# => 0