You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it 'defines all required states' do
expect(task).to define_enum_for(:status)
.with_values(%w[validating review processing completed completed_with_errors failed cancelled])
end
throws a failure of
Expected Task to define :status as an enum backed by an integer, mapping
‹"validating"› to ‹0›, ‹"review"› to ‹1›, ‹"processing"› to ‹2›,
‹"completed"› to ‹3›, ‹"completed_with_errors"› to ‹4›, ‹"failed"› to
‹5›, and ‹"cancelled"› to ‹6›. (we can't tell which).
using shoulda-matcher 5.1.0 this test passes, using 5.2.0 it fails
It appears the latest version of shoulda-matchers 5.2.0 change the way they implemented
#define_enum_for
with#with_values
causing specs to fail.in the model (task)
in the spec
throws a failure of
using shoulda-matcher 5.1.0 this test passes, using 5.2.0 it fails
It appears it is because they changed one of the checks in define_enum_for in 5.1.0
https://github.com/thoughtbot/shoulda-matchers/blob/781ecd06f2611b58585cb4f9d2be38326e88fcc5/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb#L389
to this in 5.2.0
https://github.com/thoughtbot/shoulda-matchers/blob/8a701024bd0a1a3219d1a5786ca3dd928f827436/lib/shoulda/matchers/active_record/define_enum_for_matcher.rb#L423
The text was updated successfully, but these errors were encountered: