markhallen
11/25/2017 - 7:48 PM

From https://stackoverflow.com/questions/19731295/ruby-on-rails-rspec-controller-tests-are-failing-but-shouldnt

respond_to do |format|
  if @restaurant.save
    format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' }
    format.json { render action: 'show', status: :created, location: @restaurant }
  else
    puts @restaurant.errors.full_messages
    format.html { render action: 'new' }
    format.json { render json: @restaurant.errors, status: :unprocessable_entity }
  end
end