A complete demo of meetups with web and apis with Test-Driven-Development approach
a TA-reference solution for quanzhanying interview question 5
- User can signup, sign in, log out (including feature test)
- User can create meetups and read meetup lists (including controller and mini test)
- User can post comments under each meetup. (Ajax and JS front-end comment layout and posting )
- Api: public, get "meetups"; authorization with token based auth; required auth_token for get "meetups/:id" (rpsec api test included)
- ruby 2.3.1
- rails 5
- rspec 3.5.4
$ git clone [email protected]:cndaniel/meetup-demo-api.git
$ cd enrollment-api
$ bundle install
$ bundle exec rake db:create
$ bundle exec rake db:migrate
$ bundle exec rspec --format documentation
Web-demo: https://meetup-demo.herokuapp.com api testing with postman or command line:
1.sign up
curl -X POST -F "[email protected]" -F "password=12345678" "https://meetup-demo.herokuapp.com/api/v1/signup"
- log in to get auth token and take note of it
curl -X POST -F "[email protected]" -F "password=12345678" "https://meetup-demo.herokuapp.com/api/v1/login"
- get a specific meetup list with auth token:
curl -X GET -H "Authorization: Token token=yxQQF6kbHaExsZAAjB99" \
"https://meetup-demo.herokuapp.com/api/v1/meetups/1"