noidedmedia / ImageHex

An artwork network
https://www.imagehex.com/
GNU Affero General Public License v3.0
2 stars 0 forks source link

Collection spec potential false-positive #341

Closed connorshea closed 7 years ago

connorshea commented 8 years ago

This error has been bugging me for a while now, occurs when you run our test suite.

WARNING: Using the `raise_error` matcher without providing a specific error or message
risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`,
`NameError` or `ArgumentError`, potentially allowing the expectation to pass without even
executing the method you are intending to call. Actual error raised was
#<ActiveRecord::RecordInvalid: Validation failed: Image has already been taken>.
Instead consider providing a specific error class or message. This message can be supressed by setting:
`RSpec::Expectations.configuration.warn_about_potential_false_positives = false`.
Called from /home/ubuntu/ImageHex/spec/models/collection_spec.rb:40:in `block (2 levels) in <top (required)>'.