Using the resource routes, you can do things like url_for(@apple) to get a url to that particular resources \"show\" method. However, in testing, using Mocha to mock up my objects, I\'m having trouble
Is it possible to stub an entire chain using Mocha? For example, I want to stub: User.first.posts.find(params[:id])
I\'m fairly new to RoR and recently started learning BDD/Rspec for testing my application.I\'ve been l开发者_如何学JAVAooking for a way to spec an AJAX request, but so far I haven\'t found much docume
While writing functional tests for a controller, I came across a scenario where I have a before_filter requesting some information from the database that one of my tests requires. I\'m using Factory_g
I have this example: # GET New context \"on get to new\" do it \"should assign cardset\" do @profile.cardsets.expects(:build).once.returns(Factory.stub(:cardset))
I am trying to specify in my RSpec tests that my controller should use current_user.projects.find() instead of Project.find() I am using the Mocha mocking framework and was trying something like this:
I have this controller code: # GET /cardsets/1 def show @cardset = current_user.cardsets.find_by_id(params[:id])
I am pretty new to using rspec and am trying to write my tests for my controllers. I have this controller (I am using mocha for stubbing):
I am doing some controller testing with RSpec and Mocha. Here is an example describe MenuItemsController, \"creating a new menu item\" do