Ruby on Rails API only
Commands to download dependencies and start the application:
v1
sudo -- sh -c -e "echo '127.0.0.1 api.task-manager.test' >> /etc/hosts";
bundle install
rails db:create db:migrate
rails s
Commands used to create the application:
rails g rspec:install
rails g devise:install
rails g devise user
rspec
spring rspec
spring rspec <dir>/<file>.rb --format=d
rails g controller api/v1/users
rails c
User.create(email: "caio.agiani14@gmail.com", password: "123123", password_confirmation: "123123")
User.all
User.count
rails g migration add_auth_token_to_users auth_token:string
rails db:test:prepare
rails g controller api/v1/sessions --no-test-framework
rails g model task title:string description:text done:boolean deadline:datetime user:references
rails g controller api/v1/tasks --no-test-framework
v2
rails g serializer api/v2/task
spring stop
Test
caio-agiani in task-manager-api on master [!] ❯ spring rspec
Running via Spring preloader in process 59317
Randomized with seed 1991
..............................................................
Finished in 1.41 seconds (files took 0.16575 seconds to load)
62 examples, 0 failures
Randomized with seed 1991