Skip to content

Commit 924e9b2

Browse files
Fixing test after changes on the event schema
1 parent 83b7e25 commit 924e9b2

10 files changed

+43
-3
lines changed

.env

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
HOST=127.0.0.1
2+
PORT=3333
3+
NODE_ENV=development
4+
5+
APP_NAME=API-GUILDATECH
6+
APP_URL=http://${HOST}:${PORT}
7+
FRONT_URL=http://localhost:3000
8+
9+
CACHE_VIEWS=false
10+
11+
APP_KEY=UUXy7AquLrPfzZQXGKxPfljyA2cKyArc
12+
13+
DB_CONNECTION=sqlite
14+
DB_HOST=127.0.0.1
15+
DB_PORT=3306
16+
DB_USER=root
17+
DB_PASSWORD=1234
18+
DB_DATABASE=adonis
19+
20+
HASH_DRIVER=bcrypt

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ node_modules
55
tmp
66

77
# Environment variables, never commit this file
8-
.env
98
.env-test
109

1110
# The development sqlite file

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: npm run start

database/adonis.sqlite

0 Bytes
Binary file not shown.

database/factory.js

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ Factory.blueprint('App/Models/Event', (faker, i, data = {}) => {
3838
location_city_state: faker.string({ lenght: 15 }),
3939
start_time: faker.date({ string: true, american: false }),
4040
event_time: faker.hour(),
41+
event_type: faker.string({ lenght: 7 }),
42+
language: faker.string({ lenght: 7 }),
43+
dificult_level: faker.hour(),
44+
max_attendess: faker.hour(),
45+
is_public: faker.bool(),
46+
require_registration: faker.bool(),
47+
website: faker.string({ lenght: 7 }),
4148
...data,
4249
}
4350
})

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@adonisjs/validator": "^5.0.6",
3030
"@adonisjs/vow": "^1.0.17",
3131
"date-fns": "^2.4.1",
32+
"package": "^1.0.1",
3233
"package.json": "^2.0.1",
3334
"pg": "^7.12.1",
3435
"sqlite3": "^4.1.0"

test/functional/events.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ test('it should be able to create events', async ({ assert, client }) => {
2121
location_city_state: 'SP/SP',
2222
start_time: '2019-11-25',
2323
event_time: '12:30',
24+
event_type: 'presentation',
25+
language: 'portuguese',
26+
dificult_level: '1',
27+
max_attendess: 32,
28+
is_public: 1,
29+
require_registration: 1,
30+
website: 'google.com',
2431
user_id: user.id,
2532
})
2633
.end()

test/functional/forgotpassword.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test('it should be able to reset password of the account', async ({
5858
})
5959
.end()
6060

61-
response.assertStatus(204)
61+
response.assertStatus(201)
6262

6363
await user.reload()
6464
const checkPassword = await Hash.verify('123456', user.password)

test/functional/registeruser.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ test('it should be able to register user to the database', async ({
2424
.send(sessionPayload)
2525
.end()
2626

27-
response.assertStatus(204)
27+
response.assertStatus(201)
2828
assert.exists(response)
2929
})

0 commit comments

Comments
 (0)