rspec2
With RSpec, is there a way to define a before(:each) for a describe block?
Right now my rpsec goes like this: describe Ability do before(:each) do end describe \'xxx\' do it \"should xxx\" do[详细]
2023-04-04 04:23 分类:问答Error in Factory_girl: NoMethodError: undefined method - rspec and rails 3.1.0
I am having a problem with factory_girl. Here is the error with rspec. \"Failure/Error: customer = Factory(:customer, :name => nil)[详细]
2023-04-04 04:03 分类:问答Rspec2 testing a before_validation method
I have the following to remove the spaces on a specific attribute. #before_validation :strip_whitespace[详细]
2023-04-03 22:51 分类:问答RSpec 2 testing uniqueness
I know I should be testing validations, but I\'m learning so would like to know why my code doesn\'t work.[详细]
2023-04-03 14:02 分类:问答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 分类:问答How to test a validation with conditional?
How should I test a validation with a conditional like this: validates :age, :numericality => true, :if => :age?[详细]
2023-04-01 18:15 分类:问答Testing pure Ruby bin/my_app.rb application with RSpec?
I have a command line (NON-RAILS) application written in pure Ruby that I\'m driving out through Cucumber and RSpec.It follows the typical application hierarchy of lib, bin, spec, and feature director[详细]
2023-04-01 12:08 分类:问答With capybara, how to use page.should render_template
I have the following test: it \"I can Sign Up with Facebook\" do visit new_user_registration_path click_link_or_button \'Sign up with Facebook\'[详细]
2023-04-01 01:28 分类:问答autotest does not work with rspec shared examples
My tests look like this: <<< spec/models/user_shared.rb shared_examples_for \"a user\" do end <<< spec/models/worker_spec.rb[详细]
2023-03-31 07:57 分类:问答rspec 2: detect call to method but still have it perform its function
I want to check if a method was called exactly(n) times, but I still want that method to perform its original function. Consider a simple thumbnailing system that caches the thumbnail file and make su[详细]
2023-03-30 20:16 分类:问答