GitHub PullRequestReviewCommentEvent at 2014-05-01 14:43:56
Repository: gds-api-adapters
Actor: houndci
Payload: {"comment":{"url":"https://api.github.com/repos/theodi/gds-api-adapters/pulls/comments/12189632","id":12189632,"diff_hunk":"@@ -724,23 +724,40 @@ def stub_section_page(page_parameter, options)\n       assert_equal 'A short description', results[0].details.licence_short_description\n       assert_equal 'A short description', results[1].details.licence_short_description\n     end\n-  \n+\n     it \"should return empty array with no licences\" do\n       setup_content_api_licences_stubs\n-  \n+\n       assert_equal [], @api.licences_for_ids([123,124]).to_ostruct.results\n     end\n-  \n+\n     it \"should raise an error if publisher returns an error\" do\n       stub_request(:get, %r[\\A#{@base_api_url}/licences]).\n         to_return(:status => [503, \"Service temporarily unabailable\"])\n-  \n+\n       assert_raises GdsApi::HTTPErrorResponse do\n         @api.licences_for_ids([123,124])\n       end\n     end\n   end\n-  \n+\n+  describe \"search\" do\n+    it \"should show search results\" do\n+      stub_request(:get, \"#{@base_api_url}/search.json?q=open%20knowledge\").\n+        with(:headers => {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip, deflate', 'Content-Type'=>'application/json', 'User-Agent'=>'GDS Api Client v. 7.25.0'}).\n+        to_return(:status => 200, :body => File.open(File.expand_path(File.join('test', 'fixtures', 'search_result.json'))).read, :headers => {})\n+      response = @api.search(\"open knowledge\")\n+\n+\n+      assert_equal 2, response['total']\n+      assert_equal 2, response['results'].count\n+      assert_equal \"OKFestival\", response['results'][0]['title']\n+      assert_equal \"2014-01-08T10:32:28+00:00\", response['results'][0]['details']['created_at']\n+      assert_equal \"DaPaaS Events\", response['results'][1]['title']","path":"test/content_api_test.rb","position":718,"original_position":718,"commit_id":"7e3cccbd7f89c823cb4686b1efd13a4f9970c683","original_commit_id":"7e3cccbd7f89c823cb4686b1efd13a4f9970c683","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2014-05-01T14:43:56Z","updated_at":"2014-05-01T14:43:56Z","html_url":"https://github.com/theodi/gds-api-adapters/pull/19#discussion_r12189632","pull_request_url":"https://api.github.com/repos/theodi/gds-api-adapters/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/theodi/gds-api-adapters/pulls/comments/12189632"},"html":{"href":"https://github.com/theodi/gds-api-adapters/pull/19#discussion_r12189632"},"pull_request":{"href":"https://api.github.com/repos/theodi/gds-api-adapters/pulls/19"}}}}