エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
How to check for a JSON response using RSpec?
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
How to check for a JSON response using RSpec?
I have the following code in my controller: format.json { render :json => { :flashcard => @flashc... I have the following code in my controller: format.json { render :json => { :flashcard => @flashcard, :lesson => @lesson, :success => true } In my RSpec controller test I want to verify that a certain scenario does receive a success json response so I had the following line: controller.should_receive(:render).with(hash_including(:success => true)) Although when I run my tests I get the following e