我正在
在行运行以下代码时出现错误的参数(预期的URI对象或URI字符串)
错误
get:show,id:owner.id,format :: json,subdomain:' api'
describe Api::V1::OwnersController, :type => :controller do
render_views
#before { host! "api.localhost:3000" }
let(:owner) {FactoryGirl.create(:owner)}
before(:each) do
request.host = "api.localhost:3000"
end
describe "GET #show" do
it "returns the information about an Owner on a hash" do
# TODO get this working
get :show, id: owner.id, format: :json, subdomain: 'api'
expect(response.status).to eq(200)
#owner_response = JSON.parse(response.body, symbolize_names: true)
#expect(owner_response[:email]).to eql @owner.email
end
end
end
我正在添加子域以在此处呈现API结果。
答案 0 :(得分:1)
试试这个:
get :show, params: { id: owner.id, format: :json, subdomain: 'api' }