How to use HTTP status code symbols in RSpec?

后端 未结 4 374
误落风尘
误落风尘 2020-12-29 20:30

I use HTTP status code symbols in code in a controller such as:

render json: {
    auth_token: user.authentication_t         


        
4条回答
  •  情话喂你
    2020-12-29 20:48

    this works for me:

    expect(response.response_code).to eq(Rack::Utils::SYMBOL_TO_STATUS_CODE[:not_found])
    

提交回复
热议问题