diff --git a/app/views/case_logs/_log_list.html.erb b/app/views/case_logs/_log_list.html.erb index e728a5385..3cb30289f 100644 --- a/app/views/case_logs/_log_list.html.erb +++ b/app/views/case_logs/_log_list.html.erb @@ -15,6 +15,10 @@
Owning organisation<\/th>/) + expect(CGI.unescape_html(response.body)).to match(/ | Managing organisation<\/th>/) end + end - it "shows the log's status" do - expect(CGI.unescape_html(response.body)).to include(case_log.status.humanize) + context "when the user is not a customer support user" do + before do + sign_in user end - it "shows the total log count" do - expect(CGI.unescape_html(response.body)).to match("1 total logs") + it "does not have organisation columns" do + get "/logs", headers: headers, params: {} + expect(CGI.unescape_html(response.body)).not_to match(/ | Owning organisation<\/th>/) + expect(CGI.unescape_html(response.body)).not_to match(/ | Managing organisation<\/th>/)
end
- it "does not show the pagination links" do
- expect(page).not_to have_link("Previous")
- expect(page).not_to have_link("Next")
- end
+ context "when there are less than 20 logs" do
+ before do
+ get "/logs", headers: headers, params: {}
+ end
- it "does not show the pagination result line" do
- expect(CGI.unescape_html(response.body)).not_to match("Showing 1 to 20 of 26 logs")
- end
+ it "shows a table of logs" do
+ expect(CGI.unescape_html(response.body)).to match(/ |
---|