Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. # RSpecを使ったRailsのテストの分類
  2.  
  3. 今のところの理解
  4.  
  5. ## feature spec
  6.  
  7. `bin/rails g rspec:feature hoge`
  8.  
  9. capybaraを使ってログイン等のユーザの操作を想定したシナリオテストを行う。別名E2Eテスト。
  10.  
  11. ## request spec
  12.  
  13. `bin/rails g integration_test hoge`
  14.  
  15. model, controller, viewを統合したテストを行う。また、APIの機能テストもrequest specで行う。
  16.  
  17. ## unit test
  18.  
  19. `bin/rails g rspec:model hoge` ...etc
  20.  
  21. model, controller, view, helperを単体でテストする。ただし、controllerやviewのunit testは上位のspecでカバーする場合もある(viewの場合は特に)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement