Browse Source

failing test getting searched logs

pull/608/head
JG 3 years ago
parent
commit
7db9dae287
  1. 12
      spec/requests/case_logs_controller_spec.rb

12
spec/requests/case_logs_controller_spec.rb

@ -8,7 +8,7 @@ RSpec.describe CaseLogsController, type: :request do
let(:api_password) { "test_password" } let(:api_password) { "test_password" }
let(:basic_credentials) do let(:basic_credentials) do
ActionController::HttpAuthentication::Basic ActionController::HttpAuthentication::Basic
.encode_credentials(api_username, api_password) .encode_credentials(api_username, api_password)
end end
let(:headers) do let(:headers) do
@ -184,6 +184,16 @@ RSpec.describe CaseLogsController, type: :request do
expect(page).to have_content("UA984") expect(page).to have_content("UA984")
end end
context "with a search bar" do
let!(:logs) { FactoryBot.create_list(:case_log, 5) }
it "shows case logs mathing the search word" do
get "/logs?search-field=#{logs.first.id}", headers: headers, params: {}
expect(page).to have_content(logs.first.id)
expect(page).not_to have_content(logs.last.id)
end
end
context "when filtering" do context "when filtering" do
context "with status filter" do context "with status filter" do
let(:organisation_2) { FactoryBot.create(:organisation) } let(:organisation_2) { FactoryBot.create(:organisation) }

Loading…
Cancel
Save