mocha.js
Using Mocha in Rails to test form_for path generation
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[详细]
2023-01-23 05:45 分类:问答RoR: Chained Stub using Mocha
Is it possible to stub an entire chain using Mocha? For example, I want to stub: User.first.posts.find(params[:id])[详细]
2023-01-22 03:57 分类:问答How do you test an AJAX request with RSpec/RoR?
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[详细]
2023-01-20 16:50 分类:问答Mocking/Stubbing an Application Controller method with Mocha (Using Shoulda, Rails 3)
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[详细]
2023-01-19 03:49 分类:问答Mocha expectation on association build call failing
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))[详细]
2023-01-06 17:18 分类:问答Force controller to use current_user with mocking
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:[详细]
2023-01-06 03:16 分类:问答Expectation for find not working, but expectation for find_by_id is
I have this controller code: # GET /cardsets/1 def show @cardset = current_user.cardsets.find_by_id(params[:id])[详细]
2023-01-05 21:16 分类:问答RSpec on Controller and Stubbing
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):[详细]
2023-01-05 18:33 分类:问答Variable Passing in Rails Controller Tests
I am doing some controller testing with RSpec and Mocha. Here is an example describe MenuItemsController, \"creating a new menu item\" do[详细]
2022-12-10 18:32 分类:问答
加载中,请稍侯......