{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/25984180","id":25984180,"diff_hunk":"@@ -23,1008 +33,764 @@ def app\n   end\n \n   context \"Vm accounts subcollection\" do\n-    it \"query VM accounts subcollection with no related accounts\" do\n-      basic_authorize @cfme[:user], @cfme[:password]\n-\n-      vm = FactoryGirl.create(:vm_vmware)\n-\n-      @success = run_get \"#{@cfme[:vms_url]}/#{vm.id}/accounts\"\n+    let(:acct1) { FactoryGirl.create(:account, :vm_or_template_id => vm.id, :name => \"John\") }\n+    let(:acct2) { FactoryGirl.create(:account, :vm_or_template_id => vm.id, :name => \"Jane\") }\n+    let(:vm_accounts_url)      { \"#{vm_url(vm.id)}/accounts\" }\n+    let(:acct1_url)            { \"#{vm_accounts_url}/#{acct1.id}\" }\n+    let(:acct2_url)            { \"#{vm_accounts_url}/#{acct2.id}\" }\n+    let(:vm_accounts_url_list) { [acct1_url, acct2_url] }\n+\n+    context \"query VM accounts subcollection with no related accounts\" do\n+      before do\n+        api_basic_authorize\n+\n+        run_get vm_accounts_url\n+      end\n \n-      expect(@code).to eq(200)\n-      expect(@result).to have_key(\"name\")\n-      expect(@result[\"name\"]).to eq(\"accounts\")\n-      expect(@result[\"resources\"]).to be_empty\n+      include_examples \"empty_query_result\", :accounts\n     end\n \n-    it \"query VM accounts subcollection with two related accounts\" do\n-      basic_authorize @cfme[:user], @cfme[:password]\n-\n-      vm = FactoryGirl.create(:vm_vmware)\n-      acct1 = FactoryGirl.create(:account, :vm_or_template_id => vm.id, :name => \"John\")\n-      acct2 = FactoryGirl.create(:account, :vm_or_template_id => vm.id, :name => \"Jane\")\n+    context \"query VM accounts subcollection with two related accounts\" do\n+      before do\n+        api_basic_authorize\n+        acct1\n+        acct2","path":"vmdb/spec/requests/api/vms_spec.rb","position":79,"original_position":79,"commit_id":"c1d5d424073ddf3f056d1a24ed52f43296ae85cf","original_commit_id":"c1d5d424073ddf3f056d1a24ed52f43296ae85cf","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"body":"it looks like these are common lets across all, with only a very few that want the let. I think just putting a comment above the few cases will do fine.","created_at":"2015-03-06T22:34:35Z","updated_at":"2015-03-06T22:34:35Z","html_url":"https://github.com/ManageIQ/manageiq/pull/2012#discussion_r25984180","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/25984180"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/2012#discussion_r25984180"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012","id":30519387,"html_url":"https://github.com/ManageIQ/manageiq/pull/2012","diff_url":"https://github.com/ManageIQ/manageiq/pull/2012.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/2012.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2012","number":2012,"state":"open","locked":false,"title":"[api] rspec refactoring - spec/requests/api/vms_spec.rb","user":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"body":"- Added url helper methods for generating URL's\r\n- Added an api_basic_authorize helper method set both role and basic_authorize in one shot.\r\n- New helper method to fetch values dynamically from shared_examples.\r\n- Adding shared examples via spec/requests/shared_examples/api.rb\r\n- Converted spec/requests/api/vms_spec.rb to using shared examples\r\n\r\nhttps://trello.com/c/p76x7lcu","created_at":"2015-03-05T00:28:57Z","updated_at":"2015-03-06T22:34:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24b8612836ce321b2befa8e7b8cac734ab74554a","assignee":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2012/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/c1d5d424073ddf3f056d1a24ed52f43296ae85cf","head":{"label":"abellotti:api_rspec_refactoring_vms","ref":"api_rspec_refactoring_vms","sha":"c1d5d424073ddf3f056d1a24ed52f43296ae85cf","user":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"repo":{"id":20813598,"name":"manageiq","full_name":"abellotti/manageiq","owner":{"login":"abellotti","id":5797328,"avatar_url":"https://avatars.githubusercontent.com/u/5797328?v=3","gravatar_id":"","url":"https://api.github.com/users/abellotti","html_url":"https://github.com/abellotti","followers_url":"https://api.github.com/users/abellotti/followers","following_url":"https://api.github.com/users/abellotti/following{/other_user}","gists_url":"https://api.github.com/users/abellotti/gists{/gist_id}","starred_url":"https://api.github.com/users/abellotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abellotti/subscriptions","organizations_url":"https://api.github.com/users/abellotti/orgs","repos_url":"https://api.github.com/users/abellotti/repos","events_url":"https://api.github.com/users/abellotti/events{/privacy}","received_events_url":"https://api.github.com/users/abellotti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abellotti/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/abellotti/manageiq","forks_url":"https://api.github.com/repos/abellotti/manageiq/forks","keys_url":"https://api.github.com/repos/abellotti/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abellotti/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abellotti/manageiq/teams","hooks_url":"https://api.github.com/repos/abellotti/manageiq/hooks","issue_events_url":"https://api.github.com/repos/abellotti/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/abellotti/manageiq/events","assignees_url":"https://api.github.com/repos/abellotti/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/abellotti/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/abellotti/manageiq/tags","blobs_url":"https://api.github.com/repos/abellotti/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abellotti/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abellotti/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/abellotti/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abellotti/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/abellotti/manageiq/languages","stargazers_url":"https://api.github.com/repos/abellotti/manageiq/stargazers","contributors_url":"https://api.github.com/repos/abellotti/manageiq/contributors","subscribers_url":"https://api.github.com/repos/abellotti/manageiq/subscribers","subscription_url":"https://api.github.com/repos/abellotti/manageiq/subscription","commits_url":"https://api.github.com/repos/abellotti/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/abellotti/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/abellotti/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/abellotti/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/abellotti/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/abellotti/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abellotti/manageiq/merges","archive_url":"https://api.github.com/repos/abellotti/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abellotti/manageiq/downloads","issues_url":"https://api.github.com/repos/abellotti/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/abellotti/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/abellotti/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/abellotti/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abellotti/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/abellotti/manageiq/releases{/id}","created_at":"2014-06-13T18:22:42Z","updated_at":"2014-06-17T20:58:44Z","pushed_at":"2015-03-05T00:24:38Z","git_url":"git://github.com/abellotti/manageiq.git","ssh_url":"git@github.com:abellotti/manageiq.git","clone_url":"https://github.com/abellotti/manageiq.git","svn_url":"https://github.com/abellotti/manageiq","homepage":null,"size":65183,"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":"e371bd36010d5798cfa88a1b771c17f9d04899e8","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 Cloud 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}","created_at":"2014-06-13T02:31:26Z","updated_at":"2015-03-06T22:18:05Z","pushed_at":"2015-03-06T22:18:04Z","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":104962,"stargazers_count":94,"watchers_count":94,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":292,"forks":92,"open_issues":292,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/2012"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/2012"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/2012/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2012/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/c1d5d424073ddf3f056d1a24ed52f43296ae85cf"}}}}