Re: [rspec] Class does not implement: method_name issue

2021-02-09 Thread Jon Rowe
Your original error comes from our verifying doubles feature, which you must have turned on as part of the upgrade process, you can turn it off if Mongoid isn't playing nicely with it with: ``` RSpec.configure do |config| config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = false

Re: [rspec] Class does not implement: method_name issue

2021-02-08 Thread Abhinay Rao
That is because you are calling *invoke_additional_tasks* method on User instance. The test case in my example is for *test_method* which is a Class method. Please add Class method called *test_method* in User model to reproduce the issue. *user.rb* class User attr_accessor :name class <<

Re: [rspec] Class does not implement: method_name issue

2021-02-08 Thread Phil Pirozhkov
I can't reproduce the failure with a slightly simplified version. class User attr_accessor :name def invoke_additional_tasks(test) { success: true } end private class << self def validate_something(params) { success: true } end end end RSpec.describe User do

[rspec] Class does not implement: method_name issue

2021-02-08 Thread Abhinay Rao
I have updated rspec from 2.9 to 3.5. After the update test cases are failing where I stub the some method and expect presence on another method. *User.rb* class User include Mongoid::Document field :name, type: String class << self def test_method rv = validate_something("test") return rv if