DEV: Rails 5.2 upgrade and global gem upgrade

This updates tests to use latest rails 5 practice
and updates ALL dependencies that could be updated

Performance testing shows that performance has not regressed
if anything it is marginally faster now.
This commit is contained in:
Sam
2018-06-05 17:29:17 +10:00
parent 2bd905c632
commit 89ad2b5900
103 changed files with 900 additions and 864 deletions

View File

@ -10,19 +10,19 @@ describe ExportCsvController do
it "enqueues export job" do
Jobs.expects(:enqueue).with(:export_csv_file, has_entries(entity: "user_archive", user_id: @user.id))
post :export_entity, params: { entity: "user_archive" }, format: :json
expect(response).to be_success
expect(response).to be_successful
end
it "should not enqueue export job if rate limit is reached" do
Jobs::ExportCsvFile.any_instance.expects(:execute).never
UserExport.create(file_name: "user-archive-codinghorror-150116-003249", user_id: @user.id)
post :export_entity, params: { entity: "user_archive" }, format: :json
expect(response).not_to be_success
expect(response).not_to be_successful
end
it "returns 404 when normal user tries to export admin entity" do
post :export_entity, params: { entity: "staff_action" }, format: :json
expect(response).not_to be_success
expect(response).not_to be_successful
end
end
end
@ -34,14 +34,14 @@ describe ExportCsvController do
it "enqueues export job" do
Jobs.expects(:enqueue).with(:export_csv_file, has_entries(entity: "staff_action", user_id: @admin.id))
post :export_entity, params: { entity: "staff_action" }, format: :json
expect(response).to be_success
expect(response).to be_successful
end
it "should not rate limit export for staff" do
Jobs.expects(:enqueue).with(:export_csv_file, has_entries(entity: "staff_action", user_id: @admin.id))
UserExport.create(file_name: "screened-email-150116-010145", user_id: @admin.id)
post :export_entity, params: { entity: "staff_action" }, format: :json
expect(response).to be_success
expect(response).to be_successful
end
end
end