我希望这些测试不会“失败”,而是被标记为“挂起”。也许我没有使用挂起或正确的指令,特别是对Capybara?
feature 'Tenant Scoping ' do
scenario "displays only Tenant A's things" do
pending
end
scenario "displays only Tenant B's things" do
pending
end
end以下是运行时的输出:
Tenant Scoping
displays only Tenant A's things (FAILED - 1)
displays only Tenant B's things (FAILED - 2)
Failures:
1) Tenant Scoping displays only Tenant A's things FIXED
Expected pending 'No reason given' to fail. No Error was raised.
# ./spec/features/tenants/scopingtest_spec.rb:3
2) Tenant Scoping displays only Tenant B's things FIXED
Expected pending 'No reason given' to fail. No Error was raised.
# ./spec/features/tenants/scopingtest_spec.rb:7
Finished in 0.04047 seconds (files took 1.62 seconds to load)
2 examples, 2 failures发布于 2014-08-01 01:11:42
在RSpec 3中,挂起的示例如果通过,就被认为是失败的。尝试使用skip而不是pending完全跳过这些规范。
有关更多信息,请参见Notable Changes in RSpec 3。
发布于 2015-03-18 20:02:47
只需将“场景”替换为“x场景”即可。
唯一的缺点是它将整个特性标记为挂起,而不是每个单独的规范。我还没有找到解决这个问题的办法。
https://stackoverflow.com/questions/25071369
复制相似问题