Tag Archives: [:ja]テスト[:en]Test[:]

I’ve Written Cover Story 2 in WEB+DB PRESS Vol. 109


I’ve written cover story 2, “[Practical] Kotlin”, in WEB+DB PRESS Vol. 109. My parts are chapter 2, 3 and 5.

WEB+DB PRESS Vol.109
Continue reading I’ve Written Cover Story 2 in WEB+DB PRESS Vol. 109

RSpec: Test Helper Method using current_user function


I’ll introduce the way to test rails helper code that uses current_user method provided by device gem.

Environment

  • Ruby 2.2.2
  • Rails 4.1.8
  • RSpec 3.1.0

Test Target

The function we are going to test is below. It compare the return value of current_user method and user_id given as argument, and check the argument user_id is of current login user or not.

Continue reading RSpec: Test Helper Method using current_user function