Ruby on rails URI::使用rspec+测试时出现InvalidURIError;水豚
我正在用RSpec+capybara进行测试,但我发现了一个错误: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
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'