shoulda
rails3, rspec2 ActiveRecord#changes error in specs
I\'m upgrading my rails 2 app to rails 3. I use rspec, shoulda and factory girl in the test suite. One particular pattern is causing an error I\'m having a really hard time both researching and solvi[详细]
2023-03-07 06:47 分类:问答How to include ActiveRecord in gem tests?
I\'m trying to use Model < ActiveRecord::Base in one of my gem tests with shoulda and I\'m getting the following error[详细]
2023-03-06 17:01 分类:问答How do I make one line tests in Rspec without Shoulda?
I have a bunch of very repetitive rspec tests that all have the same format: it \"inserts the correct ATTRIBUTE_NAME\" do[详细]
2023-02-24 06:27 分类:问答Is there a good way to test `before_validation` callbacks with an `:on` argument in Rails?
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.[详细]
2023-02-22 04:21 分类:问答How to use shoulda matchers to test a polymorphic association?
I\'m using shoulda-matchers with rails and I\'m creating a model called \"comments\" and another model called \"post\". Comments is polymorphic.[详细]
2023-02-16 04:46 分类:问答How do I test that a before_filter will redirect for all Rails controller actions?
I have a fairly typical require_no_user as a before_filter in one of my controllers. I need to test that a logge开发者_如何学Pythond in user is redirected by this filter if they try to access any of t[详细]
2023-02-13 00:02 分类:问答What's the use of writing tests matching configuration-like code line by line?
I have been wondering about the usefulness of writing tests that match code one-by-one. Just an example: in Rails, you can define 7 restful routes in one line in routes.rb using:[详细]
2023-02-09 13:55 分类:问答Integration tests with webrat and Rails3
I\'m upgrading a Rails 2.3.5 app to Rails 3.0.3. But my integration tests aren\'t working. I\'m getting this error:[详细]
2023-02-08 03:29 分类:问答how do I set up factory_girl in my test_helper.rb file to use with shoulda?
I have the following: 1 ENV[\"RAILS_ENV\"] = \"test\" 2 require File.expand_path(File.dirname(__FILE__) + \"/../config/environment\")[详细]
2023-02-04 10:54 分类:问答How to create unit test for Paperclip::Geometry?
I\'m writing unit test for a image uploader that uses paperclip. It\'s being bumpy and I was slowly moving thought the hurdles till I got stuck in the paperclip::geometry class[详细]
2023-02-02 12:26 分类:问答