Tag: rack test

机架测试失败:JSON请求尚未响应

我正在尝试按照Yehuda Katz的书“ Rails 3 in Action”第13章中提供的Ticketee示例为我的Ruby项目创建一个JSON API。这是一个适用于我的环境的第353页描述的RSpec测试。 # /spec/api/v1/farms_spec.rb # Reduced to the minimum code. require “spec_helper” include ApiHelper # not sure if I need this describe “/api/v1/farms”, type: :api do context “farms viewable by this user” do let(:url) { “/api/v1/farms” } it “json” do get “#{url}.json” assert last_response.ok? end end end 当我运行测试时,我得到以下输出… $ rspec […]