Advertisement
4tolexx

solution to active model errors

Jan 23rd, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. Failure/Error: expect(image_series.errors.messages).to include(visit: ['The visits patient is different from this image series\' patient'])
  2.  
  3. expected #<ActiveModel::DeprecationHandlingMessageHash({:visit => #<ActiveModel::DeprecationHandlingMessageArray(["The visits patient is different from this image series' patient"])>})> to include {:visit => ["The visits patient is different from this image series' patient"]}
  4. Diff:
  5. @@ -1 +1 @@
  6. -:visit => ["The visits patient is different from this image series' patient"],
  7. +{:visit=>["The visits patient is different from this image series' patient"]}
  8.  
  9. # ./spec/models/image_series_spec.rb:189:in `block (2 levels) in <main>'
  10. # ./spec/spec_helper.rb:276:in `block (3 levels) in <top (required)>'
  11. # /usr/local/bundle/gems/database_cleaner-core-2.0.1/lib/database_cleaner/strategy.rb:30:in `cleaning'
  12. # /usr/local/bundle/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:34:in `block (2 levels) in cleaning'
  13. # /usr/local/bundle/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:35:in `cleaning'
  14. # ./spec/spec_helper.rb:275:in `block (2 levels) in <top (required)>'
  15. # /usr/local/bundle/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
  16.  
  17. i solved the above error by reading up and following ideas from the links below
  18.  
  19. * https://api.rubyonrails.org/classes/ActiveModel/Errors.html.
  20. * https://code.lulalala.com/2020/0531-1013.html.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement