ruby on rails - URI::InvalidURIError while i am testing with rspec+capybara -


i testing rspec+capybara, i've got error:

failure/error: page.should have_selector('title', :text => "yourpos | about")    expected  #has_selector?("title", {:text=>"yourpos | about"}) return true, got false  # ./spec/requests/static_pages_spec.rb:14:in `block (3 levels) in <top (required)>' 

and static_pages_spec.rb

require 'spec_helper'  describe "static pages"     describe "about page"      "should have title 'about' "         visit '/static_pages/about'         page.should have_selector('title', :text => "yourpos | about")     end   end  end 

and app/views/static_pages/about.html.erb

<!doctype html> <html>     <head>         <title>yourpos | about</title>     </head>     <body>         <p>find me in app/views/static_pages/home.html.erb</p>     </body> </html> 

wish me, lot.

try changing

visit 'static_pages/about' 

to

visit '/static_pages/about' 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -