@ -38,7 +38,7 @@ class CaseLogsController < ApplicationController
else
previous_question = params[:previous_question]
answer = params[previous_question]
@case_log.update(previous_question => answer)
@case_log.update!(previous_question => answer)
NEXT_QUESTION[previous_question]
end
render result, locals: { case_log_id: @case_log.id }
@ -16,10 +16,9 @@ RSpec.describe CaseLogsController, type: :controller do
expect {
post :create, params: {}, session: valid_session
}.to change(CaseLog, :count).by(1)
it 'redirects to that case log' do
it "redirects to that case log" do
expect(response.status).to eq(302)