From b297ce7fc7596b04f71510a8f883baf9002668ef Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 22 Oct 2021 12:07:22 +0100 Subject: [PATCH] Adjust error in spec --- Gemfile.lock | 10 +++++----- spec/requests/case_log_controller_spec.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 176bb4202..b48165040 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rspec/rspec-core.git - revision: 053fcfeb6b0b6627edf7261737553a6f7df8cc14 + revision: d57c371ee92b16211b80ac7b0b025968438f5297 branch: main specs: rspec-core (3.11.0.pre) @@ -198,7 +198,7 @@ GEM public_suffix (4.0.6) puma (5.5.2) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-mini-profiler (2.3.3) rack (>= 1.2.0) @@ -279,7 +279,7 @@ GEM sass (~> 3.5, >= 3.5.5) scss_lint-govuk (0.2.0) scss_lint - selenium-webdriver (4.0.0) + selenium-webdriver (4.0.3) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2) @@ -300,7 +300,7 @@ GEM stimulus-rails (0.7.1) rails (>= 6.0.0) thor (1.1.0) - turbo-rails (7.1.0) + turbo-rails (7.1.1) rails (>= 6.0.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) @@ -323,7 +323,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.5.1) PLATFORMS x86_64-darwin-19 diff --git a/spec/requests/case_log_controller_spec.rb b/spec/requests/case_log_controller_spec.rb index dc67b76e1..89a5592b4 100644 --- a/spec/requests/case_log_controller_spec.rb +++ b/spec/requests/case_log_controller_spec.rb @@ -66,7 +66,7 @@ RSpec.describe CaseLogsController, type: :request do it "validates case log parameters" do json_response = JSON.parse(response.body) expect(response).to have_http_status(:unprocessable_entity) - expect(json_response["errors"]).to match_array(["Tenant age must be between 0 and 120", "Property number of times relet must be between 0 and 20"]) + expect(json_response["errors"]).to match_array([["property_number_of_times_relet", ["Must be between 0 and 20"]], ["tenant_age", ["Tenant age must be between 0 and 120"]]]) end end @@ -157,7 +157,7 @@ RSpec.describe CaseLogsController, type: :request do it "returns an error message" do json_response = JSON.parse(response.body) - expect(json_response["errors"]).to eq(["Tenant age must be between 0 and 120"]) + expect(json_response["errors"]).to eq({ "tenant_age" => ["Tenant age must be between 0 and 120"] }) end end