Reputation: 292
I'm following the Ruby on Rails Tutorial by Example by Michael Hartl but I got stuck.
Everytime I try to run the following test I got an huge error
$ bundle exec rspec spec/requests/static_pages_spec.rb
No DRb server is running. Running in local process instead ...
/home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load': cannot load such file -- /home/almeidamarcell/rails_projects/sample_app/spec/requests/static_pages_spec.rb (LoadError)
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:77:in `rescue in run'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:73:in `run'
from /home/almeidamarcell/.rvm/gems/ruby-2.1.0@railstutorial_rails_4_0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
I've tried all solutions I could find at stackoverflow and Google. I just don't know what to do now. I understand testing it's really important and I wanna fix this. Also, I have nothing under the directory "/requests/static_pages_spec.rb" maybe that is the problem? If yes, what I have to create there? I don't even have the requests directory created.
The tutorial doesn't say anything about creating this folder so I think rails spec should created automatically?
Gemfile http://pastebin.com/4bvy7GrW
spec_helper http://pastebin.com/F9yJTFqv
Upvotes: 0
Views: 707
Reputation: 491
I'm not sure if you posted the wrong link, but the code you have for static_pages_spec.rb should be located in your spec/spec_helper.rb file. The request spec for static pages has the following format
require 'spec_helper'
describe "Static pages" do
#Insert More describe blocks and Tests here
end
Certainly if it there is no folder created, you should create it manually and name it accordingly
Upvotes: 1
Reputation: 8772
You should have a 'requests' folder inside the 'spec' folder. Inside this 'requests' folder you should have your file 'static_pages_spec.rb'. The tutorial not saying anything about creating this folder is probably a small oversight on behalf of the author.
Upvotes: 1