-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create job offer image table & add test case for image size limit
- Loading branch information
1 parent
ee1e067
commit b883066
Showing
8 changed files
with
164 additions
and
69 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,5 +460,34 @@ describe(`${endpoint}`, function () { | |
.expect(400) | ||
.expect("Content-Type", "application/json; charset=utf-8") | ||
}); | ||
|
||
it("post job offer with image exceeded size of 5MB", async function () { | ||
let fileData = fs.readFileSync("./image-5_6MB.jpg") | ||
let image = Array.from(fileData) | ||
|
||
return request(apiHost) | ||
.post(`${endpoint}`) | ||
.set("Accept", "application/json") | ||
.send({ | ||
company_email: "[email protected]", | ||
company_name: "OssCameroon", | ||
company_image: image, | ||
job_title: "Frontend Dev", | ||
is_remote: true, | ||
city: "Douala", | ||
country: "Cameroon", | ||
salary_range_min: 100000, | ||
salary_range_max: 150000, | ||
department: "Research and Development", | ||
description: "OssCameroon is hiring a Remote Go Backend Engineer \n Remote - We are looking for a backend engineer who can work 30+ hr/weekOur ideal candidate has:- 1+ years experience writing in Go (golang.org)- 2-3 years experience writing REST APIs- Experience working at a small startup- A passion for building something meaningful … Salary and compensation No salary data published by company so we estimated salary based on similar jobs related to Golang, Engineer and Backend jobs that are similar: $70,000 — $120000/year", | ||
benefits: "Health insurance, dental insurance, 401k", | ||
how_to_apply: "Please submit your resume and cover letter.", | ||
application_url: "", | ||
application_email_address: "[email protected]", | ||
application_phone_number: "555-555-5555", | ||
tags: "remote, golang, backend, engineer" | ||
}) | ||
.expect(413) | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
backend/migrations/20230606013641_add_company_image_location_field.sql
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
backend/migrations/20230810082405_create_job_offers_image_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
CREATE TABLE IF NOT EXISTS job_offers_image ( | ||
id BIGSERIAL NOT NULL PRIMARY KEY, | ||
job_offer_id BIGINT NOT NULL, | ||
image_location VARCHAR(255) NOT NULL, | ||
createdat TIMESTAMP WITH TIME ZONE, | ||
updatedat TIMESTAMP WITH TIME ZONE, | ||
CONSTRAINT fk_job_offers | ||
FOREIGN KEY (job_offer_id) | ||
REFERENCES job_offers(id) | ||
); | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
DROP TABLE IF EXISTS job_offers_image; | ||
-- +goose StatementEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters