我有一个控制器如下:
class ReportsController < ApplicationController
respond_to :html
def show
client = ReportServices::Client.new(ServiceConfig['reports_service_uri'])
@report = client.population_management(params[:id])
if @report
@kpis = @report[:key_performance_indicators]
@populations = @report[:population_scores]
@population_summaries = @report[:population_summaries]
@providers = @report[:provider_networks]
end
respond_with (@report)
end
end
我想为它写一个 RSpec 测试,但不知道从哪里开始,我猜是因为它里面有那个 URL,这让我更难,我对 Rails 和 RSpec 还很陌生,并且有一些基本知识为我的模型编写 RSpec 但这一个让我整个周末都感到困惑。