rspec:type的有效值是什么?

时间:2018-11-14 23:10:17

标签: ruby-on-rails rspec

rspec测试中,可以指定测试类型,例如

it 'should behave', type: :system do
   ...
end

:type的有效值是什么,如果是,在哪里记录下来。

1 个答案:

答案 0 :(得分:0)

Relish documentation

- Model specs: type: `:model`
- Controller specs: type: `:controller`
- Request specs: type: `:request`
- Feature specs: type: `:feature`
- View specs: type: `:view`
- Helper specs: type: `:helper`
- Mailer specs: type: `:mailer`
- Routing specs: type: `:routing`
- Job specs: type: `:job`
- System specs: type: `:system`

此外,正如arieljuod所说,您可以拥有custom spec types