mocha.js
Moching rails association methods
Here is my helper method which I want to test. def posts_correlation(name) if name.present? author = User.find_by_name(name)[详细]
2023-04-02 20:29 分类:问答setting expectation on user instance in integration test with mocha and capybara
So I am trying to ensure that a callback happens on save...My test is: user = create_user login user visit new_post_path[详细]
2023-03-23 15:34 分类:问答Rails 2.3.x - How to stub a helper method (that gets called from a view) in a functional test (no RSpec)?
Please don\'t tell me \"search more\" or other stuff cause all solutions for similar question fail. Simple:[详细]
2023-03-06 23:58 分类:问答Mocha not mocking a class method in a functional test (Rails 3)
In a rails 3 app, I\'m using mocha to do some mocking in my functional tests. However it doesn\'t seem tomock a class method in the functional controller.[详细]
2023-03-05 09:46 分类:问答Is there a good way to test `before_validation` callbacks with an `:on` argument in Rails?
I have a before_validation :do_something, :on => :create in one of my models. I want to t开发者_如何学Goest that this happens, and doesn\'t happen on :save.[详细]
2023-02-22 04:21 分类:问答Using mocha for controller in functional test with RSPEC
I\'m doing some tests here using Rspec and I would like to assure that the controller is calling the log method in some actions. I\'m also using mocha.[详细]
2023-02-18 10:08 分类:问答How do I add a mocha expectation that a helper method will be called?
I\'m moving a method from a controller into a helper; the method will now be called from the view.Previously, in my controller I had[详细]
2023-01-30 11:59 分类:问答Testing if a function is called using Mocha
In my current Rails 3 app, I\'m doing some unit testing to make sure that calls to update S3 are only done under certain situations. I don\'t want to update S3 during tests, so I\'m using Mocha to stu[详细]
2023-01-29 09:13 分类:问答MochaUI tutorial [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a[详细]
2023-01-27 13:23 分类:问答Testing association methods with Mocha
I have a Rails app with an Order and a Refund model. Order has_many :refunds. All well and good. I\'m trying to write a functional test for refund logic in a controller. Here\'s what I have right now:[详细]
2023-01-25 00:08 分类:问答