RSpec expect(…).to receive(…).with(…) return error unexpected arguments with same variables
class Foo def fizz(user) puts user end end let(:user){create(:user)} it do expect(Foo).to receive(:fizz).with(user) end I run this test in RSpec of Rails app. Test fails with below result Foo received :fizz with unexpected arguments -[#<User id: 1, .. , created_at: “2024-09-18 10:39:41.403908004 +0900”, updated_at: “2024-09-18 10:39:41.579679422 +0900”] + [#<User id: 1, .. , created_at: “2024-09-18 […]
RSpec expect(…).to receive(…).with(…) return error unexpected arguments with same variables
class Foo def fizz(user) puts user end end let(:user){create(:user)} it do expect(Foo).to receive(:fizz).with(user) end I run this test in RSpec of Rails app. Test fails with below result Foo received :fizz with unexpected arguments -[#<User id: 1, .. , created_at: “2024-09-18 10:39:41.403908004 +0900”, updated_at: “2024-09-18 10:39:41.579679422 +0900”] + [#<User id: 1, .. , created_at: “2024-09-18 […]
Rspec expect to receive not acknoledging a call
I am trying to check a service is called in a test. Here is the error message :
Rspec expect to receive not acknoledging a call
I am trying to check a service is called in a test. Here is the error message :
How can I rearrange my test to allow me to access the referral
I have a simple request spec and am trying to test that :notify_referrer
is called.