1

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?

  • [check this](https://stackoverflow.com/questions/4365530/generate-only-tests-from-existing-model-controllers) – Gautam Dec 31 '19 at 02:40

1 Answers1

2

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://rspec.info/

https://medium.com/@lcriswell/rails-api-request-specs-with-rspec-effeac468c4e

https://www.nopio.com/blog/rails-api-tests-rspec/

Nezir
  • 6,727
  • 12
  • 54
  • 78