我想用scenario
和Rails内置系统测试。由于Rails系统和RSpec功能测试几乎相同,我希望它可以互换,但我得到了:
undefined method 'scenario' for RSpec::ExampleGroups::Authentication:Class
。
我错过了什么或目前不可能吗?
scenario
是一种宝石水豚的方法。相当于情景的Rspec是it
。
您可以在RSpec测试中使用scenario
。但这是Capybara的方法。所以你需要先加载这个gem。
为此,您需要添加到您的Gemfile
group :test do
gem 'capybara'
end
在此之后
$ bundle install