This app uses Ruby 2.7.2 and Rails ~> 6.1.1
Admin user
email: [email protected]
password: admin1
Regular user
[email protected]
password: user11
Organization
name: STRV
And no contacts
To run this app locally you have to run in the project root.
bundle exec bin/setup
It will create one admin user
email: [email protected]
password: admin1
One organization
name: STRV
And one regular user
[email protected]
password: user11
Both admin and user are under STRV organization.
After that you have to paste the json key inside of key.json.
And paste the proper envs inside of .env.local and .env.test
PROJECT_ID=<project_id>
GOOGLE_APPLICATION_CREDENTIALS="./key.json"
{
"registration": {
"user": {
"email": <email>,
"password": <password>
}
"organizations_ids": <array of ids>
}
{
"user": {
"id": <id>,
"email": <email>
},
"token": <token>
}
{
"authentication": {
"email": <email>,
"password": <password>
}
}
{
"token": <token>
}
Every request from needs the header
Authorization: Bearer <token>
{
"organizations": [
{
"id": <id>,
"name": <name>,
"created_at": <created_at>,
"updated_at": <updated_at>
},
]
}
Only admin user
{
"organization": {
"name": <name>
}
}
{
"organization": {
"id": <id>,
"name": <name>,
"created_at": <created_at>,
"updated_at": <updated_at>
}
}
{
"organization_id": 1
}
{
"contacts": [
{
"id": <id_from_firebase>,
"name": <name>,
"email": <email>,
"phone": <phone>,
"organization_id": <organization_id>
}
]
}
{
"contact": {
"name": <name>,
"email": <email>,
"phone": <phone>,
"organization_id": <organization_id>
}
}
{
"contact": {
"id": <id_from_firebase>,
"name": <name>,
"email": <email>,
"phone": <phone>,
"organization_id": <organization_id>
}
}
{
"contact": {
"name": <name>,
"email": <email>,
"phone": <phone>,
"organization_id": <organization_id>
}
}
{
"contact": {
"id": <id_from_firebase>,
"name": <name>,
"email": <email>,
"phone": <phone>,
"organization_id": <organization_id>
}
}
204 No Content
The project uses Rspec for testing. To run it run in the root project
bundle exec rspec
It will run all the test suite.
The project tests the integration to Firebase without mocks or stubs.