From d8f9295dbff19d9794428a70528cd05203e2ae91 Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 24 May 2022 11:23:48 +0100 Subject: [PATCH] failing test when searching for logs --- spec/features/log_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/features/log_spec.rb b/spec/features/log_spec.rb index 2d9e72bfd..dea44052b 100644 --- a/spec/features/log_spec.rb +++ b/spec/features/log_spec.rb @@ -15,11 +15,19 @@ RSpec.describe "Log Features" do end context "I can search for a specific log" do - it "there is a search bar for logs" do + it "there is a search bar with a message and search button for logs" do expect(page).to have_field("search-field") expect(page).to have_content("Search by log ID, tenant code, property reference or postcode") expect(page).to have_button("Search") end + + it "displays log matching the search" do + fill_in("search-field", with: log.id ) + click_button("Search") + + expect(page).to have_content(log.id) + expect(page).not_to have_content(unwanted_logs.first.id) + end end end end