testing-rails icon indicating copy to clipboard operation
testing-rails copied to clipboard

Deprecated static attributes are still used in factories.rb

Open ryanzidago opened this issue 6 years ago • 1 comments

Depracted static attributes are still used in factories.rb:

  factory :link do
    title "Testing Rails"
    url "http://testingrailsbook.com"

    trait :invalid do
      title nil
    end
  end
end

Instead, the code should look like this with dynamic attributes:

  factory :link do
    title { "Testing Rails" }
    url { "http://testingrailsbook.com" }

    trait :invalid do
      title { nil }
    end
  end
end

ryanzidago avatar Jul 20 '19 20:07 ryanzidago

If this is changed, the example app should probably be updated to use 4.11.0 or a higher version of the factory_bot gem:

https://github.com/thoughtbot/factory_bot/blob/master/NEWS.md#4110-august-15-2018

andyw8 avatar Jul 21 '19 17:07 andyw8