diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb
index 0c1e3524a..d81ec41ef 100644
--- a/spec/requests/case_logs_controller_spec.rb
+++ b/spec/requests/case_logs_controller_spec.rb
@@ -163,12 +163,26 @@ RSpec.describe CaseLogsController, type: :request do
get "/logs", headers: headers, params: {}
end
+ it "shows a table of logs" do
+ expect(CGI.unescape_html(response.body)).to match(/
/)
+ expect(CGI.unescape_html(response.body)).to match(/logs/)
+ end
+
it "only shows case logs for your organisation" do
expected_case_row_log = "#{case_log.id}"
unauthorized_case_row_log = "#{unauthorized_case_log.id}"
expect(CGI.unescape_html(response.body)).to include(expected_case_row_log)
expect(CGI.unescape_html(response.body)).not_to include(unauthorized_case_row_log)
end
+
+ it "shows the formatted created at date for each log" do
+ formatted_date = case_log.created_at.to_formatted_s(:govuk_date)
+ expect(CGI.unescape_html(response.body)).to include(formatted_date)
+ end
+
+ it "shows the log's status" do
+ expect(CGI.unescape_html(response.body)).to include(case_log.status.humanize)
+ end
end
context "when requesting a specific case log" do
diff --git a/spec/views/case_log_index_view_spec.rb b/spec/views/case_log_index_view_spec.rb
deleted file mode 100644
index d7bcadc18..000000000
--- a/spec/views/case_log_index_view_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "rails_helper"
-
-RSpec.describe "case_logs/index" do
- let(:in_progress_log) { FactoryBot.create(:case_log, :in_progress) }
-
- context "with a log list" do
- before do
- assign(:case_logs, [in_progress_log])
- render
- end
-
- it "renders a table for all logs" do
- expect(rendered).to match(//)
- expect(rendered).to match(/logs/)
- expect(rendered).to match(in_progress_log.created_at.to_formatted_s(:govuk_date))
- expect(rendered).to match(in_progress_log.status.humanize)
- end
- end
-end