allow_any_instance_of(ServicesController).to receive(A::B.auth(a, b, c, d)).and_return({value: true])
I cannot get my rspec test to mock method A::B.auth.
Using rspec 3 and rails 3.2. Test type: controller.
I want the mock to return a simple hash: {value: true}. Is this possible?
allow(A::B).to receive(:auth).and_return({value: true})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With