加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 如何将Capybara功能测试标记为待定?

发布时间:2020-12-16 22:38:12 所属栏目:百科 来源:网络整理
导读:我希望这些测试不会“失败”,但会被标记为待处理.也许我没有使用正确的或正确的指令为水豚专门吗? feature 'Tenant Scoping ' do scenario "displays only Tenant A's things" do pending end scenario "displays only Tenant B's things" do pending enden
我希望这些测试不会“失败”,但会被标记为待处理.也许我没有使用正确的或正确的指令为水豚专门吗?
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

解决方法

从RSpec 3起,如果通过,未决的示例将被视为失败.尝试使用skip而不是pending来完全跳过这些规范.

有关更多信息,请参阅Notable Changes in RSpec 3.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读