0

I cant really get going with my Rspec-gem :) Unfortunately. It seems like the Rspec-rails gem works differently now? Any idea? This is my error Im getting:

testing_rspec/spec/models/transport_spec.rb:2:in `<top (required)>': uninitialized constant Transport (NameError)
    from /Users/yoniPacheko/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load'

My spec file:

require 'spec_helper'
describe Transport do

end

This is my file

Thanks for yr time!

1 Answer 1

1

If this is a newly-generated app, you should be using require 'rails_helper', instead of requiring spec_helper.

rspec-rails 3 has split the two out so that spec_helper can be used for standalone Ruby code, and rails_helper (which includes spec_helper) can be used for testing code that relies on Rails.

Sign up to request clarification or add additional context in comments.

4 Comments

Hi there! It doesn't work properly Im getting this: pastie.org/9436574 any idea? Im getting green at the end of this bunch of code...?
that's okay - those are just ruby warnings. You can disable those by removing --warnings from your .rspec file.
funny! are those warnings always there uhn?
they've always been there - it's just recent versions of rspec-rails that have enabled their display.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.