|
|
|
@ -405,6 +405,8 @@ RSpec.describe CaseLogsController, type: :request do
|
|
|
|
|
let(:user) { FactoryBot.create(:user) } |
|
|
|
|
let(:organisation) { user.organisation } |
|
|
|
|
let(:other_organisation) { FactoryBot.create(:organisation) } |
|
|
|
|
|
|
|
|
|
context "when a log exists" do |
|
|
|
|
let!(:case_log) do |
|
|
|
|
FactoryBot.create( |
|
|
|
|
:case_log, |
|
|
|
@ -437,6 +439,20 @@ RSpec.describe CaseLogsController, type: :request do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when there are more than 20 logs" do |
|
|
|
|
before do |
|
|
|
|
sign_in user |
|
|
|
|
FactoryBot.create_list(:case_log, 26, owning_organisation: organisation) |
|
|
|
|
get "/logs", headers: headers, params: {} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not paginate, it downloads all the user's logs" do |
|
|
|
|
csv = CSV.parse(response.body) |
|
|
|
|
expect(csv.count).to eq(27) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "PATCH" do |
|
|
|
|
let(:case_log) do |
|
|
|
|
FactoryBot.create(:case_log, :in_progress, tenant_code: "Old Value", postcode_full: "M1 1AE") |
|
|
|
|