rspec
Confused about simplecov and rspec in rails
This is code in 开发者_运维知识库a model: def find_tech Category.find_by_name(\"tech\") end and this is the rspec test:[详细]
2023-04-05 19:04 分类:问答RSpec's failing because it thinks ActiveRecord objects aren't equal
Very simple spec... @post.user.should == @user Spec fails even though both objects are identical in every way except their object_id. ActiveRecord objects should equal (==) if their id\'s are the s[详细]
2023-04-05 18:53 分类:问答Ruby on Rails allow mass assignment for an RSpec test
I\'m testing my Rails application with RSpec, but then I ran into a problem. I want a consistent database, therefore I imposed a constraint that some columns can not be null.[详细]
2023-04-05 18:36 分类:问答Trouble on specifying explicit 'subject's?
I am using Ruby on Rails 3.0.9 and RSpect 2. I am trying to refactoring some spec file in the following way (in order to test with less code similar User cl开发者_JS百科ass object attribute values):[详细]
2023-04-05 18:23 分类:问答Trouble on using multiple class object instances?
I am using Ruby on Rails 3.0.9 and RSpect 2. I am trying to refactoring some spec file in the following way (in order to test with less code similar User class object attribute values):[详细]
2023-04-05 18:19 分类:问答How to stub ApplicationController method in request spec
I am needing to stub the response of a current_user method in an Rspec/capybara request spec. The method is defined in ApplicationController and is using helper_method. The method should simply return[详细]
2023-04-05 15:46 分类:问答How to write specs for rails associations?
They say the perfect test just includes the test framework and the class being tested; everything else should be mocked. Then, what about associations?[详细]
2023-04-05 15:40 分类:问答Trouble on rspecting a FactoryGirl object
I am using Ruby on Rails 3.0.10, RSpec 2 and FactoryGirl. I have the following scenario: In the models/user_spec.rb file I have[详细]
2023-04-05 15:23 分类:问答What "validation logic" should I test?
I am using Ruby on Rails 3.0.9 and RSpec 2. I would like to know what \"validation logic\" I should test. That is, if in my model I have:[详细]
2023-04-05 08:46 分类:问答How can\should I test a conditional validation?
I am using Rub开发者_如何学编程y on Rails 3.0.9 and RSpec 2. I would like to know how I can\\should run test for the following validation mathod:[详细]
2023-04-05 08:38 分类:问答