Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # RSpecを使ったRailsのテストの分類
- 今のところの理解
- ## feature spec
- `bin/rails g rspec:feature hoge`
- capybaraを使ってログイン等のユーザの操作を想定したシナリオテストを行う。別名E2Eテスト。
- ## request spec
- `bin/rails g integration_test hoge`
- model, controller, viewを統合したテストを行う。また、APIの機能テストもrequest specで行う。
- ## unit test
- `bin/rails g rspec:model hoge` ...etc
- model, controller, view, helperを単体でテストする。ただし、controllerやviewのunit testは上位のspecでカバーする場合もある(viewの場合は特に)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement