How to check for a JSON response using RSpec?

后端 未结 14 1307
谎友^
谎友^ 2020-11-29 16:03

I have the following code in my controller:

format.json { render :json => { 
        :flashcard  => @flashcard,
        :lesson     => @lesson,
             


        
14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 16:44

    There's also the json_spec gem, which is worth a look

    https://github.com/collectiveidea/json_spec

提交回复
热议问题