Closed manuelmeurer closed 9 years ago
Very odd - It shouldn't even be rendering templates which is very odd - since we don't actually use rendering in rocket pants full stop.
Oh yeah, I'm using Rabl to render views, forgot to mention this. :)
This is my APIController
:
class APIController < RocketPants::Base
include ActionController::Rendering
include ActionController::MimeResponds
include AbstractController::Layouts
append_view_path Rails.root.join('app', 'views')
version 1
end
So API::V1::AccountsController#show
should render app/views/api/v1/accounts/show.json.rabl
, which works in development and production, but not when testing with Rspec.
I realize this might be an issue with Rspec (I don't think Rabl has anything to do with it) but I wanted to see if you or anyone else has an idea about how to fix this...
I'm going to close this - I'm not sure on the solution, and since rendering support isn't part of RocketPants it's not something we plan on fixing. Sorry it took so long to reply to this.
When I test my RocketPants controllers with Rspec, I have to either use
get :foo, format: :json
in my specs or addrender formats: :json
to my controllers, otherwise Rspec complains:This is only an issue in the specs, the API works fine and returns JSON by default otherwise. Am I doing anything wrong?