{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/85433515","pull_request_review_id":6151586,"id":85433515,"diff_hunk":"@@ -237,29 +255,68 @@ def expect_api_call(expected_action, expected_args = nil)\n           expect(api_collection).to receive(action) do |args, &block|\n             expect(args).to eq(expected_args)\n             expect(block.call).to eq(\"some stuff\")\n-          end\n+          end.and_return(api_success_result)\n+\n           described_class.exec_api_call(region, collection_name, action, expected_args, &resource_proc)\n         end\n \n         it \"defaults the args to an empty hash\" do\n           expect(api_collection).to receive(action) do |args, &block|\n             expect(args).to eq({})\n             expect(block.call).to eq(\"some stuff\")\n-          end\n+          end.and_return(api_success_result)\n+\n           described_class.exec_api_call(region, collection_name, action, &resource_proc)\n         end\n \n         it \"defaults the args to an empty hash when nil is explicitly passed as args\" do\n           expect(api_collection).to receive(action) do |args, &block|\n             expect(args).to eq({})\n             expect(block.call).to eq(\"some stuff\")\n-          end\n+          end.and_return(api_success_result)\n+\n           described_class.exec_api_call(region, collection_name, action, nil, &resource_proc)\n         end\n       end\n     end\n   end\n \n+  describe \".instance_for_resource\" do\n+    let(:collection) { double(\"ManageIQ::API::Client::Collection\", :name => collection_name) }\n+    let(:resource)   { double(\"ManageIQ::API::Client::Resource\", :collection => collection, :id => 10) }","path":"spec/models/mixins/inter_region_api_method_relay_spec.rb","position":91,"original_position":91,"commit_id":"7764ed472641f7597b81a826166227b5b25a9540","original_commit_id":"7764ed472641f7597b81a826166227b5b25a9540","user":{"login":"carbonin","id":12697904,"avatar_url":"https://avatars.githubusercontent.com/u/12697904?v=3","gravatar_id":"","url":"https://api.github.com/users/carbonin","html_url":"https://github.com/carbonin","followers_url":"https://api.github.com/users/carbonin/followers","following_url":"https://api.github.com/users/carbonin/following{/other_user}","gists_url":"https://api.github.com/users/carbonin/gists{/gist_id}","starred_url":"https://api.github.com/users/carbonin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carbonin/subscriptions","organizations_url":"https://api.github.com/users/carbonin/orgs","repos_url":"https://api.github.com/users/carbonin/repos","events_url":"https://api.github.com/users/carbonin/events{/privacy}","received_events_url":"https://api.github.com/users/carbonin/received_events","type":"User","site_admin":false},"body":"The id here is arbitrary. It's just for verification of parameters and such. I'm not actually putting anything in the database.","created_at":"2016-10-27T21:40:49Z","updated_at":"2016-10-27T21:40:49Z","html_url":"https://github.com/ManageIQ/manageiq/pull/12257#discussion_r85433515","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/85433515"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/12257#discussion_r85433515"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257","id":91256251,"html_url":"https://github.com/ManageIQ/manageiq/pull/12257","diff_url":"https://github.com/ManageIQ/manageiq/pull/12257.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/12257.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12257","number":12257,"state":"open","locked":false,"title":"Add handling for the return value of the API calls","user":{"login":"carbonin","id":12697904,"avatar_url":"https://avatars.githubusercontent.com/u/12697904?v=3","gravatar_id":"","url":"https://api.github.com/users/carbonin","html_url":"https://github.com/carbonin","followers_url":"https://api.github.com/users/carbonin/followers","following_url":"https://api.github.com/users/carbonin/following{/other_user}","gists_url":"https://api.github.com/users/carbonin/gists{/gist_id}","starred_url":"https://api.github.com/users/carbonin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carbonin/subscriptions","organizations_url":"https://api.github.com/users/carbonin/orgs","repos_url":"https://api.github.com/users/carbonin/repos","events_url":"https://api.github.com/users/carbonin/events{/privacy}","received_events_url":"https://api.github.com/users/carbonin/received_events","type":"User","site_admin":false},"body":"This will allow methods that used to return instances of activerecord objects to continue to do so when they are called through the API. Without this change calls which used to return activerecord objects will instead return `ManageIQ::API::Client::Resource` instances.\r\n\r\nThis will also raise an error when the API call fails.\r\n\r\n@bdunne @Fryguy please review","created_at":"2016-10-27T18:34:53Z","updated_at":"2016-10-27T21:40:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a275200cf94baab4d8a5f0489282a09c25a02017","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12257/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/7764ed472641f7597b81a826166227b5b25a9540","head":{"label":"carbonin:add_error_handling_to_region_relay","ref":"add_error_handling_to_region_relay","sha":"7764ed472641f7597b81a826166227b5b25a9540","user":{"login":"carbonin","id":12697904,"avatar_url":"https://avatars.githubusercontent.com/u/12697904?v=3","gravatar_id":"","url":"https://api.github.com/users/carbonin","html_url":"https://github.com/carbonin","followers_url":"https://api.github.com/users/carbonin/followers","following_url":"https://api.github.com/users/carbonin/following{/other_user}","gists_url":"https://api.github.com/users/carbonin/gists{/gist_id}","starred_url":"https://api.github.com/users/carbonin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carbonin/subscriptions","organizations_url":"https://api.github.com/users/carbonin/orgs","repos_url":"https://api.github.com/users/carbonin/repos","events_url":"https://api.github.com/users/carbonin/events{/privacy}","received_events_url":"https://api.github.com/users/carbonin/received_events","type":"User","site_admin":false},"repo":{"id":36686944,"name":"manageiq","full_name":"carbonin/manageiq","owner":{"login":"carbonin","id":12697904,"avatar_url":"https://avatars.githubusercontent.com/u/12697904?v=3","gravatar_id":"","url":"https://api.github.com/users/carbonin","html_url":"https://github.com/carbonin","followers_url":"https://api.github.com/users/carbonin/followers","following_url":"https://api.github.com/users/carbonin/following{/other_user}","gists_url":"https://api.github.com/users/carbonin/gists{/gist_id}","starred_url":"https://api.github.com/users/carbonin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carbonin/subscriptions","organizations_url":"https://api.github.com/users/carbonin/orgs","repos_url":"https://api.github.com/users/carbonin/repos","events_url":"https://api.github.com/users/carbonin/events{/privacy}","received_events_url":"https://api.github.com/users/carbonin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carbonin/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/carbonin/manageiq","forks_url":"https://api.github.com/repos/carbonin/manageiq/forks","keys_url":"https://api.github.com/repos/carbonin/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carbonin/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carbonin/manageiq/teams","hooks_url":"https://api.github.com/repos/carbonin/manageiq/hooks","issue_events_url":"https://api.github.com/repos/carbonin/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/carbonin/manageiq/events","assignees_url":"https://api.github.com/repos/carbonin/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/carbonin/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/carbonin/manageiq/tags","blobs_url":"https://api.github.com/repos/carbonin/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carbonin/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carbonin/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/carbonin/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carbonin/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/carbonin/manageiq/languages","stargazers_url":"https://api.github.com/repos/carbonin/manageiq/stargazers","contributors_url":"https://api.github.com/repos/carbonin/manageiq/contributors","subscribers_url":"https://api.github.com/repos/carbonin/manageiq/subscribers","subscription_url":"https://api.github.com/repos/carbonin/manageiq/subscription","commits_url":"https://api.github.com/repos/carbonin/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/carbonin/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/carbonin/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/carbonin/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/carbonin/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/carbonin/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carbonin/manageiq/merges","archive_url":"https://api.github.com/repos/carbonin/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carbonin/manageiq/downloads","issues_url":"https://api.github.com/repos/carbonin/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/carbonin/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/carbonin/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/carbonin/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carbonin/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/carbonin/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/carbonin/manageiq/deployments","created_at":"2015-06-01T20:29:47Z","updated_at":"2016-03-24T13:19:54Z","pushed_at":"2016-10-27T18:33:26Z","git_url":"git://github.com/carbonin/manageiq.git","ssh_url":"git@github.com:carbonin/manageiq.git","clone_url":"https://github.com/carbonin/manageiq.git","svn_url":"https://github.com/carbonin/manageiq","homepage":"manageiq.org","size":165881,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ManageIQ:master","ref":"master","sha":"61292385ea96341bc74111d364278590d0e7a9a5","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Open-Source Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-10-22T19:11:09Z","pushed_at":"2016-10-27T21:35:13Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":217241,"stargazers_count":340,"watchers_count":340,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":373,"mirror_url":null,"open_issues_count":835,"forks":373,"open_issues":835,"watchers":340,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/12257"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/12257"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/12257/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12257/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/7764ed472641f7597b81a826166227b5b25a9540"}}}}
{"actor":{"display_login":"carbonin"}}