From 35df8c84b14c3ee09176b0238ea7e2306c0f3706 Mon Sep 17 00:00:00 2001 From: Ted Date: Tue, 24 May 2022 16:49:34 +0100 Subject: [PATCH] Added test for non matching logs --- spec/features/log_spec.rb | 2 +- spec/requests/case_logs_controller_spec.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/features/log_spec.rb b/spec/features/log_spec.rb index 46d21e1e5..d0e8a9f26 100644 --- a/spec/features/log_spec.rb +++ b/spec/features/log_spec.rb @@ -32,7 +32,7 @@ RSpec.describe "Log Features" do end end - context "using log tenancy_code" do + context "using log tenancy code" do it "it displays log matching the tenancy code" do fill_in("search-field", with: log_to_search.tenancy_code) click_button("Search") diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index 3952349b6..f32e3d166 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -192,7 +192,17 @@ RSpec.describe CaseLogsController, type: :request do expect(page).to have_content(logs.first.id) expect(page).not_to have_content(logs.last.id) end + + context "no match is found" do + it "shows case logs matching the search word" do + get "/logs?search-field=777", headers: headers, params: {} + logs.each do |log| + expect(page).not_to have_content(log.id) + end + end + end end + context "when filtering" do context "with status filter" do