rspec-rails
How can I use RSpec to test the response code on a CanCan failed authorization?
I\'m working on a rails project in which I use CanCan to authorize my resources. When a user is not signed in and tries to submit a \"talk\" (via an ajax form submission), CanCan correctly raises a 40[详细]
2023-04-11 13:27 分类:问答is view spec necessary with cucumber
Is it necessary to use view spec even if I am using cucumber? I think cucumber takes care of the view and the flow.So is it required to use view spec?[详细]
2023-04-09 11:42 分类:问答validates_confirmation_of :password doesn't get triggered
I have a very basic Admin model: class Admin < ActiveRecord::Base has_secure_password 开发者_运维问答validates_uniqueness_of :email[详细]
2023-04-06 23:31 分类:问答rspec mocking "undefined method `stub_model' for #<Class:0x007ff9c339bd80> (NoMethodError)"
I\'m using Rails 3.1 and I wanted to add some stubs and mocks to my specs but I get a NoMethodError: undefined method `stub_model\' for #<Class:0x007ff9c339bd80> (NoMethodError)[详细]
2023-04-06 20:04 分类:问答Testing nested resources with RSpec
I am trying to create tests for nested resources in Rails. The relevant route definition is: resources :communities do[详细]
2023-04-06 10:54 分类:问答rspec / rake issue - Rake::DSL global methods are clobbering my model somehow
I\'m working through the upgrade to 3.1, and hit a snag. I have a model (using Mongoid) that is having it\'s \'link\' method overwritten by Rake, apparently.I\'m getting this message:[详细]
2023-04-06 00:25 分类:问答Testing Rails 3.1 mountable engine with Rspec
I started making a Rails 3.1 engine, and I\'m having a hard time testing it using rspec. First of all, if I run rails g integration_test whatever it creates a regular integration test in tests/integr[详细]
2023-04-06 00:24 分类:问答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 分类:问答Railstutorial.org Validating presence tests
I\'ve been working through the tutorials at railstutorial.org, and I was a little stumped by the author\'s code for section -- 6.2.1 Validating presence.[详细]
2023-04-04 11:55 分类:问答Testing after_create hooks with rspec
I have code in my model (RoR 3.0.x) that is more or less like this: class Message after_create :notify protected[详细]
2023-04-02 15:26 分类:问答