更新 2 - 添加before(:each)
块
before(:each) do
...
post_via_redirect(
sub_domain(
path: login_view_path(
@p
),
subdomain: @account.subdomain
),
first_name: "Capybara",
last_name: "RSpec"
)
expect(response).to render_template(:show)
end
更新
response.body
有我正在寻找的数据,
但page.html
只有一个文档类型。
原来的
我正在尝试做一些集成测试。我有这个:
require "spec_helper"
feature "Tracking without Javascript" do
...
scenario "when navigating to a content" do
...
# this passes so I know there is a body
expect(response.body).to include(c.name)
find(:xpath, "/html") # see if xpath works...
end
end
我得到了错误:
Failure/Error: find(:xpath, "/html")
Capybara::ElementNotFound:
Unable to find xpath "/html"
有任何想法吗?