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