Brian Murillo
Brian Murillo

Reputation: 15

Rails generated app without tests, how can i generate rspec test files without recreating project?

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

Answers (1)

Nezir
Nezir

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

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

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

Upvotes: 2

Related Questions