Top "Rspec2" questions

RSpec 2 is a version of the Behaviour-Driven Development tool for Ruby programmers.

Unable to stub helper method with rspec

I am trying to stub a method on a helper that is defined in my controller. For example: class ApplicationController &…

ruby-on-rails ruby-on-rails-3 rspec rspec2 rspec-rails
In RSpec, what's the difference between before(:suite) and before(:all)?

The before and after hook documentation on Relish only shows that before(:suite) is called prior to before(:all). When …

rspec rspec2
How to get rspec-2 to give the full trace associated with a test failure?

Right now if I run my test suite using rake spec I get an error: 1) SegmentsController GET 'index' should work …

ruby ruby-on-rails-3 testing rspec rspec2
Rspec testing redirect_to :back

How do you test redirect_to :back in rspec? I get ActionController::RedirectBackError: No HTTP_REFERER was set in the …

ruby-on-rails redirect rspec rspec2
Rails / RSpec: How to test #initialize method?

How can I specify #initialize behaviour with RSpec? For example here: generator.rb class Generator attr_accessor :seed def initialize(…

ruby rspec2
`require': cannot load such file -- spec_helper (LoadError)

I am creating bundler gem --test=rspec MyGem. in which I'm getting the repository structure. When I try to run …

ruby rspec rspec2 rspec-rails rspec3
"Could not find a valid mapping for #<User ...>" only on second and successive tests

I'm trying to write a request test that asserts that the proper links appear on the application layout depending in …

devise integration-testing rspec2 factory-bot
How to create test objects with nested attributes with FactoryGirl in Ruby on Rails?

I have an Invoice model that may contain a number of Items as well: class Invoice < ActiveRecord::Base attr_…

ruby-on-rails ruby-on-rails-3 rspec rspec2 factory-bot
Turn off transactional fixtures for one spec with RSpec 2

How do I turn off transactional fixtures for only one spec (or Steak scenario) with RSpec 2? I tried some things …

ruby-on-rails ruby-on-rails-3 rspec rspec2
rspec not_to change from not behaving as expected

I am experiencing some baffling behavior in rspec and rspec-rails 2.11.0. I have reproduced the behavior on a co-worker's app running 2.7.1 (…

ruby-on-rails rspec2 rspec-rails