Browse Source

Rubocop

pull/21/head
baarkerlounger 3 years ago
parent
commit
5392248e35
  1. 2
      app/controllers/case_logs_controller.rb
  2. 3
      spec/controllers/case_logs_controller_spec.rb

2
app/controllers/case_logs_controller.rb

@ -38,7 +38,7 @@ class CaseLogsController < ApplicationController
else else
previous_question = params[:previous_question] previous_question = params[:previous_question]
answer = params[previous_question] answer = params[previous_question]
@case_log.update(previous_question => answer) @case_log.update!(previous_question => answer)
NEXT_QUESTION[previous_question] NEXT_QUESTION[previous_question]
end end
render result, locals: { case_log_id: @case_log.id } render result, locals: { case_log_id: @case_log.id }

3
spec/controllers/case_logs_controller_spec.rb

@ -16,10 +16,9 @@ RSpec.describe CaseLogsController, type: :controller do
expect { expect {
post :create, params: {}, session: valid_session post :create, params: {}, session: valid_session
}.to change(CaseLog, :count).by(1) }.to change(CaseLog, :count).by(1)
end end
it 'redirects to that case log' do it "redirects to that case log" do
post :create, params: {}, session: valid_session post :create, params: {}, session: valid_session
expect(response.status).to eq(302) expect(response.status).to eq(302)
end end

Loading…
Cancel
Save