I try to setup a new Rails 5.2.1 "Api only"-app.
While following some tutorials I was surprised that a lot of them (if not all) are only writing request specs. What I also found is the type: :api
option in some of their tutorials.
What is the difference in type: :request
and type: :api
?
- So I am a bit confused. Is this common practice to drop controller specs?
Or is logic tested in request specs instead of controller specs?, because of no view logic?
RSpec.describe 'Authentications', type: :request do ... end RSpec.describe UsersController, type: :api do ... end
Thank you in advance