Headers for APIs:
Authorization: generated_household_token
Content-Type: application/json
POST /api/v1/readings
Sample request payload
{
"reading": {
"temperature": 24.5,
"humidity": 34.5,
"battery_charge": 54.5
}
}
GET /api/v1/readings/{{reading_id}}
GET /api/v1/stats
Run the below command for test environment DB migrations
RAILS_ENV=test rake db:drop db:create db:migrate
Execute Specs by running rspec like below,
rspec