1) FileServer::API GET /api/apps/:app with apk real number code
Failure/Error: get "/api/apps/s"
NoMethodError:
undefined method call' for #<App:0x007f8ac2096830>
# ./spec/api/api_spec.rb:11:in
block (4 levels) in '
我想在 rspec 里面去 测试 grape 的 api,但是他总是报这个错误
我在浏览器里直接可以访问
已经尝试增加
config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => {
:file_path => /spec\/api/
}
wiki(http://ruby-china.org/wiki/gems)里面有介绍的哈 rest-client 简单强大的 HTTP/REST 客户端,跟 Grape 配合起来很完美
require 'spec_helper'
describe FileServer::API do
describe "GET /api/apps/:package" do
context "with apk" do
let(:build) {create(:build,:icon_file)}
let(:app) {create(:app,build: build )}
it "real number code" do
app
get "/api/apps/#{app.package}"
end
end
end
end