rspec2
How to generate multiple asscoated records for the same parent record in factory_girl?
Here is the definition for model user and user_level. A user has many user levels and a user level belongs to a user.[详细]
2023-04-05 09:59 分类:问答Rails3 - RSpec - How to set request.env?
I try to stub my request.env require \'spec_helper\' describe AuthenticationController do render_views include Devise::TestHelpers[详细]
2023-04-05 06:28 分类:问答RSpec seems to break when the route 'match' statement has a subdirectory (or nested route) listed
it \"should match login for existing account\" do { :get =>开发者_JS百科 \'http://www.\' + @business.subdomain + \'.lvh.me:3000/login\' }.should route_to({:controller => \"go\", :action => \"[详细]
2023-04-05 04:11 分类:问答How to test a search controller action which has filters in Rails with RSpec?
We have a bar with filters in almost all of our table-based views in a rails app and we need to test the controller action.[详细]
2023-04-05 03:50 分类:问答How would I test this controller action with Rspec
How should I spec this class FlagsController def like flag = current_user.flags.find_or_initialize_by_flaggable_type_and_flaggable_id(params[:like_type], params[:like_id])[详细]
2023-04-05 01:05 分类:问答Loading errors for running rspec
Am trying to run Rails 3.0 and Ruby 1.9.2 and am running Rspec 2.6.0 which I just downloaded. When I try to run Rspec, I get the following error message:[详细]
2023-04-05 00:49 分类:问答cant get capybara-webkit to work
I am using capybara to do integration testing on my rails 3 app. When i add :js => true to a scenario my tests work with selenium but when i change to use the webkit driver for js i get errors for ea[详细]
2023-04-04 14:56 分类:问答Model passes validation of :presence => true and still nil in database
user_type is a column in user model and it has to be :presence => true. It rejects in rspec when passing a nil to use开发者_Go百科r_type. However the factory_girl can store a nil user_type into the fi[详细]
2023-04-04 12:20 分类:问答RSpec should_receive macro that includes id of what needs to be tested
How can I write this so it passes without hardcoding 1. Chicken and the egg. @sender = Factory(:user) @receiver = Factory(:user)[详细]
2023-04-04 05:31 分类:问答Factory_girl and Factory_girl_rails conflict error
The following is the error message running rspec spec: /factory_girl-2.1.0/lib/factory_girl/registry.rb:38:in `add_as\': Already defined: user (FactoryGirl::DuplicateDefinitionError)[详细]
2023-04-04 04:45 分类:问答