From 766fff0834eaa7e4b2c53fa3fd8f6b25aed2637d Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 24 May 2022 11:14:14 +0100 Subject: [PATCH] failing feature for searching logs --- spec/features/log_spec.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/features/log_spec.rb diff --git a/spec/features/log_spec.rb b/spec/features/log_spec.rb new file mode 100644 index 000000000..2328d57d4 --- /dev/null +++ b/spec/features/log_spec.rb @@ -0,0 +1,24 @@ +require "rails_helper" + +RSpec.describe "Log Features" do + context "Searching for specific logs" do + context "I am logged in" do + let!(:user) { FactoryBot.create(:user, last_sign_in_at: Time.zone.now) } + let!(:log) { FactoryBot.create(:case_log) } + let!(:unwanted_logs) { FactoryBot.create_list(:case_log, 4) } + + before do + visit("/logs") + fill_in("user[email]", with: user.email) + fill_in("user[password]", with: "pAssword1") + click_button("Sign in") + end + + context "I can search for a specific log" do + it "there is a search bar for logs" do + expect(page).to have_field("search-field") + end + end + end + end +end