jmeyer82 / learn2live

0 stars 0 forks source link

Using 'show' action from CRUD as test #2

Open Mirv opened 5 years ago

Mirv commented 5 years ago
mirv:~/workspace $ curl -i -H "Accept: application/json" "https://live2learn-mirv.c9users.io/users/1"
HTTP/1.1 200 OK
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
content-type: application/json; charset=utf-8
etag: W/"10dcd2383dca3351cf01d55917433632"
cache-control: max-age=0, private, must-revalidate
x-request-id: a591f402-6907-4fa1-809b-e115333526d6
x-runtime: 0.015419
server: WEBrick/1.3.1 (Ruby/2.3.4/2017-03-30)
date: Sun, 23 Sep 2018 01:46:37 GMT
content-length: 289
X-BACKEND: apps-proxy

{"id":1,"name":"test1","profile_type":"blah","education":"blah","time":"blah","description_role":"blh","description_education":"blah","attributes_roles":"blah","attributes_education":"blah","skill_share":true,"created_at":"2018-09-22T22:16:46.486Z","updated_at":"2018-09-22T22:16:46.486Z"}
Mirv commented 5 years ago

Test of the index ...

mirv:~/workspace $ curl -i -H "Accept: application/json" "https://live2learn-mirv.c9users.io/users/"
HTTP/1.1 200 OK
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
content-type: application/json; charset=utf-8
etag: W/"90d7e7df964642bda80d76148889259a"
cache-control: max-age=0, private, must-revalidate
x-request-id: 681682ca-3cc4-4fe5-bebe-a1711f165866
x-runtime: 0.045000
server: WEBrick/1.3.1 (Ruby/2.3.4/2017-03-30)
date: Sun, 23 Sep 2018 01:48:31 GMT
content-length: 347
X-BACKEND: apps-proxy

[{"id":1,"name":"test1","profile_type":"blah","education":"blah","time":"blah","description_role":"blh","description_education":"blah","attributes_roles":"blah","attributes_education":"blah","skill_share":true,"created_at":"2018-09-22T22:16:46.486Z","updated_at":"2018-09-22T22:16:46.486Z","url":"https://live2learn-mirv.c9users.io/users/1.json"}]
Mirv commented 5 years ago

Rails routes ...

mirv:~/workspace $ rails routes
   Prefix Verb   URI Pattern               Controller#Action
    users GET    /users(.:format)          users#index
          POST   /users(.:format)          users#create
 new_user GET    /users/new(.:format)      users#new
edit_user GET    /users/:id/edit(.:format) users#edit
     user GET    /users/:id(.:format)      users#show
          PATCH  /users/:id(.:format)      users#update
          PUT    /users/:id(.:format)      users#update
          DELETE /users/:id(.:format)      users#destroy
Mirv commented 5 years ago

Burned too much time last night on this one - going to consume one api with the other - (as if that's going to take less setup time).