From 703f91b5643629cf23632cfdefc60fdde942c4bb Mon Sep 17 00:00:00 2001 From: JG Date: Tue, 24 May 2022 16:28:43 +0100 Subject: [PATCH] refactored feature and correct id --- app/models/case_log.rb | 4 ++-- spec/features/log_spec.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/case_log.rb b/app/models/case_log.rb index a2183cb82..dbb41990d 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -52,8 +52,8 @@ class CaseLog < ApplicationRecord } scope :search_by_id, ->(id) { where(id: id) } - scope :search_by_tenant_code, ->(code) { where(tenant_code: code) } - scope :search_by, ->(param) { search_by_id(param.to_i).or(search_by_tenant_code(param)) } + scope :search_by_tenancy_code, ->(code) { where(tenancy_code: code) } + scope :search_by, ->(param) { search_by_id(param.to_i).or(search_by_tenancy_code(param)) } AUTOGENERATED_FIELDS = %w[id status created_at updated_at discarded_at].freeze OPTIONAL_FIELDS = %w[first_time_property_let_as_social_housing tenant_code propcode].freeze diff --git a/spec/features/log_spec.rb b/spec/features/log_spec.rb index b3b8970ed..1580a37c6 100644 --- a/spec/features/log_spec.rb +++ b/spec/features/log_spec.rb @@ -34,7 +34,6 @@ RSpec.describe "Log Features" do context "using log tenancy_code" do it "it displays log matching the tenancy code" do - visit("/logs") fill_in("search-field", with: log_to_search.tenancy_code) click_button("Search") expect(page).to have_content(log_to_search.id)