describe GameSystem::Client do
def client
GameSystem::Client.new(signature_method: 'HMAC-SHA1', oauth_key: 'kk', oauth_secret: 'bb', oauth_access_token_url: 'https:://localhost')
end
before :each do
WebMock.reset!
end
describe 'response' do
context 'wrong path' do
it 'raises JSON::ParserError on invalid return value' do
stub_request(:get,"https://games.com/game_id/invalid_id").to_return(:status => 200, :body => 'invalid json', :headers => {})
Rails.logger.info "#{client.games_by_id("invalid_id")}"
end
end
end
end
任何人都可以让我知道我一直在做错什么,或者我可以做什么不同吗?未定义的方法'downcase'为零:NilClass
它基本上在我的客户
他实际上并没有在他的代码中任何地方调用downcase。 – doug
也许这个答案应该是一个评论。然而,问题仍然存在,他的代码必须在无对象的地方调用'downcase'...他从来没有提供方法'get_access_token'的代码,这可能是在哪里downcase ... –