On Feb 25, 2011, at 4:19 PM, Radhesh Kamath wrote: > Craig Demyanovich wrote in post #983991: >> On Fri, Feb 25, 2011 at 4:30 PM, Radhesh Kamath >> <li...@ruby-forum.com>wrote: >> >>> Which version of rspec-rails should I use for Rails 2.3.8? >> >> >> rspec-rails 1.3.3 is currently the latest release for Rails 2.3.x. >> > > I am getting this error with my current setup, which I think, should not > happen: > > Failure/Error: non_uniq_agg.should have(2).errors_on(:name) > NoMethodError: > undefined method `errors_on' for #<Aggregate:0x383fe1aa> > > where 'Aggregate' is a model I am testing. > > My gem list looks like so: > > *** LOCAL GEMS *** > > abstract (1.0.0) > actionmailer (2.3.8) > actionpack (2.3.8) > activerecord (2.3.8) > activerecord-jdbc-adapter (1.1.1) > activerecord-jdbcmysql-adapter (1.1.1) > activeresource (2.3.8) > activesupport (2.3.8) > backports (1.18.2) > bouncy-castle-java (1.5.0145.2) > builder (2.1.2) > columnize (0.3.1) > diff-lcs (1.1.2) > erubis (2.6.6) > facets (2.9.1) > i18n (0.4.0) > ipaddress (0.7.0) > jdbc-mysql (5.1.13) > jruby-openssl (0.7.3) > macaddr (1.0.0) > rack (1.2.1, 1.1.0) > rack-mount (0.6.13) > rack-test (0.5.7) > rails (2.3.8) > rake (0.8.7) > rspec (2.5.0, 1.3.1) > rspec-core (2.5.1) > rspec-expectations (2.5.0) > rspec-mocks (2.5.0) > rspec-rails (1.3.3) > ruby-debug (0.10.3) > ruby-debug-base (0.10.3.2) > sources (0.0.1) > thor (0.14.6) > tzinfo (0.3.24) > uuid (2.3.1) > > And my spec_helper looks like so: > > ENV["RAILS_ENV"] ||= 'development' > require File.expand_path("../../config/environment", __FILE__) > > # Requires supporting ruby files with custom matchers and macros, etc, > # in spec/support/ and its subdirectories. > Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} > > RSpec.configure do |config|
If you're using rspec-rails-1.3.3, this line ^^ should raise an error since the RSpec constant wasn't introduced until rspec-2.0. I'm guessing that the rails app is not correctly configured to use rspec-rails-1.3.3. What's in config/environment.rb? Are you using bundler? If so, what's in Gemfile? > # == Mock Framework > # > # If you prefer to use mocha, flexmock or RR, uncomment the > appropriate line: > # > # config.mock_with :mocha > # config.mock_with :flexmock > # config.mock_with :rr > config.mock_with :rspec > > # Remove this line if you're not using ActiveRecord or ActiveRecord > fixtures > #config.fixture_path = "#{::Rails.root}/spec/fixtures" > > # If you're not using ActiveRecord, or you'd prefer not to run each of > your > # examples within a transaction, remove the following line or assign > false > # instead of true. > #config.use_transactional_fixtures = true > end > > Is there something else I should be including? > >> Regards, >> Craig > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users Cheers, David _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users