如何在RSpec中使用功能和方案

时间:2015-11-09 20:14:22

标签: ruby rspec

根据这篇文章,featuredescribe可以互换:

How to add context in a feature rspec?

但是,当我使用以下内容时,它会起作用,但当我用describe替换feature时会出错:

RSpec.describe "Billing UI Flows" do

    describe "User logs in and creates a new Billing Profile with PayPal" do

        context "User is new" do

        end
    end

    describe "User adds a site" do


    end


end

1 个答案:

答案 0 :(得分:1)

  

..当我用describe错误替换feature

feature方法由rspec-rails gem提供。因此,您可能只需要安装rspec-rails

  

功能规格是高级测试.. [通过其外部接口驱动应用程序..   特征和场景DSL分别对应于describe和it。   这些方法只是一些别名,允许功能规格更多地读取   客户和验收测试。   https://www.relishapp.com/rspec/rspec-rails/docs/feature-specs/feature-spec

相关问题