Code Monkey home page Code Monkey logo

Comments (3)

zenspider avatar zenspider commented on June 21, 2024

Example of this going bad:

#>>> puts exception
unexpected invocation: #<Api::V2::TicketFieldsController:0x3c528>.statsd_client()
unsatisfied expectations:
- expected exactly once, invoked never: #<Api::V2::TicketFieldsController:0x3c528>.statsd_client(any_parameters)
...

the stubbed method on the controller in still the mocha bypass, but with the mockery nilled out the call is "unexpected".

from mocha.

floehopper avatar floehopper commented on June 21, 2024

I'm dealing with a family bereavement at the moment, so I don't have much time to investigate this.

I've been using controller tests in a Rails 7 project recently and haven't come across this issue, although to be fair I can't be sure we did any stubbing of controller methods.

Making multiple requests in a single controller test method seems somewhat unusual to me - perhaps that's what makes your use case different - or have I misunderstood?

If you can share a minimal example of code that reproduces the problem, I'll try to find some time to investigate.

from mocha.

floehopper avatar floehopper commented on June 21, 2024

@zenspider Is this still causing a problem for you?

from mocha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.