Here is my helper method which I want to test. def posts_correlation(name) if name.present? author = User.find_by_name(name)
So I am trying to ensure that a callback happens on save...My test is: user = create_user login user visit new_post_path
Please don\'t tell me \"search more\" or other stuff cause all solutions for similar question fail. Simple:
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.
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.
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.
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
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
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
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: