Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/53.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails URI::使用rspec+测试时出现InvalidURIError;水豚_Ruby On Rails_Rspec - Fatal编程技术网

Ruby on rails URI::使用rspec+测试时出现InvalidURIError;水豚

Ruby on rails URI::使用rspec+测试时出现InvalidURIError;水豚,ruby-on-rails,rspec,Ruby On Rails,Rspec,我正在用RSpec+capybara进行测试,但我发现了一个错误: Failure/Error: page.should have_selector('title', :text => "YourPos | About") expected #has_selector?("title", {:text=>"YourPos | About"}) to return true, got false # ./spec/requests/static_pages_spec.rb:1

我正在用RSpec+capybara进行测试,但我发现了一个错误:

Failure/Error: page.should have_selector('title', :text => "YourPos | About")
   expected  #has_selector?("title", {:text=>"YourPos | About"}) to return true, got false
 # ./spec/requests/static_pages_spec.rb:14:in `block (3 levels) in <top (required)>'
和我的应用程序/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>

关于
在app/views/static_pages/home.html.erb中查找我

希望有人能帮助我,非常感谢。

试试换衣服

visit 'static_pages/about'

试着改变

visit 'static_pages/about'


我做到了,但我又犯了一个错误。我改变了问题的细节,现在有什么问题?它告诉你你要找的文本不在返回的页面上。正常访问页面时会发生什么情况?请尝试页面。页面上应该有“YourPos”About“OK,那么您的应用程序似乎有问题,因为上面的代码应该正常工作。你是在开Spork还是什么?Spork?不,我不知道我做了那种事,但我又犯了一个错误。我改变了问题的细节,现在有什么问题?它告诉你你要找的文本不在返回的页面上。正常访问页面时会发生什么情况?请尝试页面。页面上应该有“YourPos”About“OK,那么您的应用程序似乎有问题,因为上面的代码应该正常工作。你是在开Spork还是什么?Spork?不,我不知道那种事
visit '/static_pages/about'