Testing Heartbeat controller
-
13-02-2021 - |
سؤال
I'm currently writing tests for an app using cucumber and rspec. I was asked to test the heartbeat controller, but I'm not really sure how to approach it.
module Api
class HeartbeatController < ActionController::Base
respond_to :json, :xml
include Something::Status
def status
respond_with status_response
end
end
end
المحلول
I just visited the xml and json paths and checked for certain distinct keywords to make sure it was responding the way I expected it to.
لا تنتمي إلى StackOverflow