这是我的测试:
require "rspec"
describe HomeController do
render_views
it "should renders the home" do
get :home
response.should render_template("home")
find('H1').should have_content("Simulate Circuits Online")
end
end
但我得到:
1) HomeController should renders the home
Failure/Error: find('H1').should have_content("Simulate Circuits Online")
Capybara::ElementNotFound:
Unable to find css "H1"
# ./spec/controllers/home_controller_spec.rb:9:in `block (2 levels) in <top (required)>'
# (eval):6:in `block in fork'
如何找到标签、ID 或 CSS ?