Reputation: 15
I used the Rails to generate API-Only app without tests for a project I've been working on for a while. Is there any command to regenerate the test files without recreating the entire project?
Upvotes: 1
Views: 236
Reputation: 6925
First you should add rspec gem to Gemfile and run bundle or gem install rspec
also run rails g rspec:install
After that you should configure rspec and you can check more about testing on this tutorials here: https://medium.com/@sedwardscode/how-to-properly-test-a-rails-api-with-rspec-f15cbe1dfd11
https://medium.com/@lcriswell/rails-api-request-specs-with-rspec-effeac468c4e
https://www.nopio.com/blog/rails-api-tests-rspec/
Upvotes: 2