Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

#171281019 create email verification tests #21

Merged
merged 4 commits into from
Feb 17, 2020

Conversation

Ntare22
Copy link
Contributor

@Ntare22 Ntare22 commented Feb 14, 2020

What does this PR do?

  • Create email verification tests
  • Create validate parameters file

Description of Task to be completed?

  • Create verification test file
  • Create seeders data for verification
  • Write tests to check the controller

How should this be manually tested?

  • Clone repository
  • Run npm install
  • Run npm test

Any background context you want to provide?

  • I added validateParams file to enable us to validate if the parameters passed in a request are valid.

What are the relevant pivotal tracker stories?

#171281019

Screenshots (if appropriate)

image
image

Jim Ntare added 3 commits February 13, 2020 21:26
adjusted token to accept email, id, and isVerified fields
adjusted verification controller to do away with checking the verification table
deleted the verification table
created a new file in validations with validateParams calls to validate the token in verification
created email verification tests

[ #Finishes #171281019 ]
bbaime98
bbaime98 previously approved these changes Feb 16, 2020
izzett222
izzett222 previously approved these changes Feb 17, 2020
src/tests/verifyAccountMock.js Outdated Show resolved Hide resolved
@Ntare22 Ntare22 dismissed stale reviews from izzett222 and bbaime98 via 91977bf February 17, 2020 11:59
@Ntare22 Ntare22 force-pushed the ch-create-email-verification-tests-171281019 branch from 733ce76 to 91977bf Compare February 17, 2020 11:59
@Mnickii Mnickii merged commit 52087b4 into develop Feb 17, 2020
Mnickii pushed a commit that referenced this pull request Feb 20, 2020
* chore(setup unit testing): (#2)

install express
install chai, mocha, body-parser, @babel, nodemon, and nyc
setup babel for the project
start server in index.js file
made a test directory
write a sample test

[ Finishes #170947538 ]

* chore(HoundCI): added Hound Integration (#5)

added .hound.yml file
added a hound ReadMe badge
[Maintains #170947536]

* chore(EslintConfiguration): Added Eslint (#4)

installed eslint
configured eslintrc file
[Maintains #170947535]

* #170947543 setup heroku (#6)

* ch(setup heroku):

add node version that heroku will be running
add app.json file to create deploy button
add heroku button to README.md

[ Finishes #170947543 ]

* removed deploy button
added newline in app.json

* added heroku site to README.md

* adjusted start stript in package.json

* moved babel from devDependencies to dependencies

* adjusted my start script

* add Procfile
set 2 start scripts for development and production

* ch(database): set-up postgres, sequelize and dotenv (#1)

- install pg and pg-hstore dependencies
- install sequelize, sequelize-cli, and dotenv dependencies
- add  sequelizelrc file
- add config file  with environment variables
- add dummy data for keeping track of migrations
- add drop, create and seed scripts

[Maintains #170947533, #170947539, #170947534]

mend

 fix hound check
 add eslintignore file
 add migrations and seeder to eslintignore
 add more eslint configurations

* #170947537 Travis Integration (#7)

* chore(TravisIntegration): added travis integration
added travis yaml file
added travis badge on readme
[Maintains #170947537]

* mend

Co-authored-by: Mnickii <caroline.nkirote@andela.com>

* chore(coverage): Added coverage integration (#8)

installed coveralls
added a coveralls badge on readme
added a .coveralls.yml
[Maintains #170947540]

* bug(coverage): Fix Coveralls Integration (#11)

add a script in travis.yml for running coveralls

* #170947542 setup docker (#9)

* ch(setup docker):

add Dockerfile
add dockerignore file to ignore .dockerignore

[ Finishes #170947542 ]

* add docker-compose file
remove .dockerignore file

* add docker-compose file
remove .dockerignore file

* setup up docker ofr postgres

* correct hound error

Co-authored-by: Mnickii <caroline.nkirote@andela.com>

* #170947541 setup swagger documentation (#12)

* ch(swagger-documentation): add swagger documentation
- install dependencies
- creates swagger folder
- set up index.js file in swagger folder

[Maintains #170947541]

* ch(setup swagger):

setup swagger document in swagger directory
set up test routes

[ Finishes #170947541 ]

* fixed minor error

* fixed swagger to display

* fixed hound error

* fixed heroku issues

* fix heroku deploy

* removed comments

* fix heroku

* added message on the terminal to see what port is running

added to environment variable examples to .env.example file

Co-authored-by: Mnickii <caroline.nkirote@andela.com>

* Update README.md

* ft(signup): add signup functionality (#14)

- add signup route
- add auth controller
- add register user function
- add search in database function
- add provide token function
- add response handler functions
- add new babel config
- change start script for heroku
- add documentation
- add seed script for development

[Finishes #170947544]

* feat(i18n): Internationalization (#17)

install i18n
configure i18n
add i18n locales
[Finishes #171204720]

* #170947545 signup verification with sendgrid  (#18)

* ft(signup): add signup functionality

- add signup route
- add auth controller
- add register user function
- add search in database function
- add provide token function
- add response handler functions
- add new babel config
- change start script for heroku

[Finishes #170947544]

* ft(sign verification with SendGrid):

Create a devrepublic gmail account
Create a sendGrid account with the devrepublic gmail account
Create a Sendgrid API key
Create a email verification controller and verify Account method
Create file import SendGrid API key and send automatic email to new user

[ Finishes #170947545 ]

* change token to include id and boolean value for verification status of the user
fix bugs with updating the verication status of the user

[ Finishes #170947545 ]

* fix npm start

* feat(login): Adds login feature (#15)

add login tests
add login controller
write bcrypt handler
write a token encoder
create a login route
[Maintains #170947547]

* #171281019 create email verification tests  (#21)

* add a verification test

* ch(create email verification-tests):

adjusted token to accept email, id, and isVerified fields
adjusted verification controller to do away with checking the verification table
deleted the verification table
created a new file in validations with validateParams calls to validate the token in verification
created email verification tests

[ #Finishes #171281019 ]

* fix hound error

* added swagger documentation

* ft(logout): add log out functionality (#20)

- add a log-out route
- add a logout function
- add logout tests
- change authController to userController
- change authRoute to userRoutes

[Finishes #170947550]

* feat(userRoles): User Roles Settings (#24)

add roles field in the user database
added internationalized messages
seeded a default admin
add the update roles controller and routes
add the feature's tests and documentation
[Finishes #170947557]

* feature(reset): reset password feature (#23)

- add the forgot password endpoint
- add the reset password endpoint
- configured sendGrid to send email
- add the verify token function
- add the send email function

[finishes #170947549]

* #170947548 Login with Facebook and Google (#22)

* ft(Login with Facebook and Google):

Install passport, passport-facebook, and passport-google-oauth
Setup apps on google developer console and facebook facebook developer
Write passport configuration file with facebook and google
create a getProfile callback function.
Setup routes for google and facebook redirecting
Initialise passport in index.js

[ #170947548 in progress]

* minor changes to the facebook oauth

* fixed facebook

* fixed tests

* fixed some bugs in the controller
wrote tests for the controller

[ Finishes #170947548 ]

 Please enter the commit message for your changes. Lines starting

* ft(profile): add profile settings functionalities (#25)

- add edit profile route
- add view profile route
- add edit profile route
- add upload profile picture route
- add edit profile funciton
- add view profile function
- add upload image function
- add the feature's tests and documentation
[Finishes #170947551]

* ft(create accommodation facilities): (#28)

setup table with sequelize
create routes to the controller
create controller for adding facilities and rooms
write tests for the controllers

[ Finishes #170947569 ]

* ft(profile): add profile settings functionalities (#25) (#26)

- add edit profile route
- add view profile route
- add edit profile route
- add upload profile picture route
- add edit profile funciton
- add view profile function
- add upload image function
- add the feature's tests and documentation
[Finishes #170947551]

Co-authored-by: bbaime98 <52517921+bbaime98@users.noreply.github.com>

* feature(trip): request return trip (#29)

- add the request return trip controller and route
- added test for the feature
- add the protect routes middleware
- changed the reset route to follow conventions
- modified the reset feature swagger documentation

[Maintains #170947553]

Co-authored-by: Jim Ntare <jim.ntare@andela.com>
Co-authored-by: Baraka <41383503+Baraka-Mugisha@users.noreply.github.com>
Co-authored-by: bbaime98 <52517921+bbaime98@users.noreply.github.com>
Co-authored-by: ISHIMWE Steven <steven.ishimwe@andela.com>
Co-authored-by: izzett222 <51261911+izzett222@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants