【问题标题】:Run single system test运行单系统测试
【发布时间】:2017-04-03 15:13:23
【问题描述】:

要在 Rails 中运行单个测试,我们通常会这样做:

rails test TEST=test/system/invitation_test.rb

但这不适用于系统测试。这也不起作用:

rails test:system TEST=test/system/invitation_test.rb

使用上述两个突击队,所有系统测试(文件)都会运行。

所以我的问题是,如何运行单个系统测试?


附带说明,要在 Rails 中运行(所有)系统测试,you need to append:systemtest

rails test:system

【问题讨论】:

    标签: ruby-on-rails testing ruby-on-rails-5 system-testing ruby-on-rails-5.1


    【解决方案1】:

    虽然rails test 如果您想运行系统测试(您需要使用 :system 附加测试)似乎不起作用,但如果您只想运行单个测试,它可以似乎工作:

    rails test test/system/my_little_test.rb
    

    【讨论】:

    • 不知道为什么之前没有考虑过?
    猜你喜欢
    • 1970-01-01
    • 2022-09-11
    • 2011-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-09
    • 2011-02-22
    相关资源
    最近更新 更多