Skip to content

Commit

Permalink
back to 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
querenker committed Aug 19, 2017
1 parent 7a1f6ff commit e661d72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def update
def set_contact_person
@request = Request.find(params[:request_id])
update_params = contact_person_params
if !update_params[:contact_person].nil? && @request.update(update_params)
if !update_params[:contact_person].empty? && @request.update(update_params)
redirect_to @request, notice: I18n.t('requests.notice.was_updated')
else
render :show
Expand All @@ -54,7 +54,7 @@ def set_contact_person
def set_notes
@request = Request.find(params[:request_id])
update_params = notes_params
if !update_params[:notes].nil? && @request.update(update_params)
if !update_params[:notes].empty? && @request.update(update_params)
redirect_to @request, notice: I18n.t('requests.notice.was_updated')
else
render :show
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/requests_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
context "with invalid params" do
it "re-renders the 'show' template" do
patch path, params: {request_id: @a_request.to_param, request: invalid_attributes, session: valid_session}
expect(response).to redirect_to(request_path(@a_request))
expect(response).to render_template('show')
end
end
end
Expand Down

0 comments on commit e661d72

Please sign in to comment.