{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/92941709","pull_request_review_id":13464503,"id":92941709,"diff_hunk":"@@ -0,0 +1,56 @@\n+require 'test_helper'\n+\n+class KeyPairsControllerTest < ActionController::TestCase\n+  setup do\n+    @compute_resource = FactoryGirl.create(:ec2_cr)\n+  end\n+\n+  test \"cr with key_pair should get index\" do\n+    get :index, {:compute_resource_id => @compute_resource.to_param}, set_session_user\n+    assert_response :success\n+  end\n+\n+  test \"cr without key_pair should not get index\" do\n+    compute_resource = FactoryGirl.create(:libvirt_cr)\n+    get :index, {:compute_resource_id => compute_resource.to_param}, set_session_user\n+    assert_response :not_found\n+  end\n+\n+  test \"should download pem file\" do\n+    key = FactoryGirl.create(:key_pair)\n+    get :download, {:compute_resource_id => @compute_resource.to_param, :id => key.id}, set_session_user\n+    assert_response :success\n+    assert_equal(key.secret, @response.body)\n+    refute @response.body.size.zero?\n+  end\n+\n+  test \"should recreate a key pair\" do\n+    Foreman::Model::EC2.any_instance.stubs(:recreate).returns(KeyPair.create(:name => \"foreman-#{Foreman.uuid}\",\n+                                                                             :secret => \"shhh\",\n+                                                                             :compute_resource_id => @compute_resource.id))\n+    key_pair = FactoryGirl.create(:key_pair)\n+    key_pair.compute_resource = @compute_resource\n+    post :create, {:compute_resource_id => @compute_resource.to_param}, set_session_user","path":"test/controllers/key_pairs_controller_test.rb","position":33,"original_position":33,"commit_id":"ae7371b912300fc2707044317f6298652b48c471","original_commit_id":"ae7371b912300fc2707044317f6298652b48c471","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use keyword arguments instead of positional arguments for http call: post.","created_at":"2016-12-18T13:45:09Z","updated_at":"2016-12-18T13:45:09Z","html_url":"https://github.com/theforeman/foreman/pull/4024#discussion_r92941709","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/4024","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/92941709"},"html":{"href":"https://github.com/theforeman/foreman/pull/4024#discussion_r92941709"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4024"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/4024","id":93764882,"html_url":"https://github.com/theforeman/foreman/pull/4024","diff_url":"https://github.com/theforeman/foreman/pull/4024.diff","patch_url":"https://github.com/theforeman/foreman/pull/4024.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/4024","number":4024,"state":"open","locked":false,"title":"Fixes #17015 - Adds Key pairs controller","user":{"login":"shlomizadok","id":433583,"avatar_url":"https://avatars.githubusercontent.com/u/433583?v=3","gravatar_id":"","url":"https://api.github.com/users/shlomizadok","html_url":"https://github.com/shlomizadok","followers_url":"https://api.github.com/users/shlomizadok/followers","following_url":"https://api.github.com/users/shlomizadok/following{/other_user}","gists_url":"https://api.github.com/users/shlomizadok/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomizadok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomizadok/subscriptions","organizations_url":"https://api.github.com/users/shlomizadok/orgs","repos_url":"https://api.github.com/users/shlomizadok/repos","events_url":"https://api.github.com/users/shlomizadok/events{/privacy}","received_events_url":"https://api.github.com/users/shlomizadok/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-15T13:27:24Z","updated_at":"2016-12-18T13:45:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbc6bfb71cec1b0f530dc75c3c6be667c698813e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/4024/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/4024/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/4024/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/ae7371b912300fc2707044317f6298652b48c471","head":{"label":"shlomizadok:fix_17015","ref":"fix_17015","sha":"ae7371b912300fc2707044317f6298652b48c471","user":{"login":"shlomizadok","id":433583,"avatar_url":"https://avatars.githubusercontent.com/u/433583?v=3","gravatar_id":"","url":"https://api.github.com/users/shlomizadok","html_url":"https://github.com/shlomizadok","followers_url":"https://api.github.com/users/shlomizadok/followers","following_url":"https://api.github.com/users/shlomizadok/following{/other_user}","gists_url":"https://api.github.com/users/shlomizadok/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomizadok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomizadok/subscriptions","organizations_url":"https://api.github.com/users/shlomizadok/orgs","repos_url":"https://api.github.com/users/shlomizadok/repos","events_url":"https://api.github.com/users/shlomizadok/events{/privacy}","received_events_url":"https://api.github.com/users/shlomizadok/received_events","type":"User","site_admin":false},"repo":{"id":23541704,"name":"foreman","full_name":"shlomizadok/foreman","owner":{"login":"shlomizadok","id":433583,"avatar_url":"https://avatars.githubusercontent.com/u/433583?v=3","gravatar_id":"","url":"https://api.github.com/users/shlomizadok","html_url":"https://github.com/shlomizadok","followers_url":"https://api.github.com/users/shlomizadok/followers","following_url":"https://api.github.com/users/shlomizadok/following{/other_user}","gists_url":"https://api.github.com/users/shlomizadok/gists{/gist_id}","starred_url":"https://api.github.com/users/shlomizadok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlomizadok/subscriptions","organizations_url":"https://api.github.com/users/shlomizadok/orgs","repos_url":"https://api.github.com/users/shlomizadok/repos","events_url":"https://api.github.com/users/shlomizadok/events{/privacy}","received_events_url":"https://api.github.com/users/shlomizadok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shlomizadok/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/shlomizadok/foreman","forks_url":"https://api.github.com/repos/shlomizadok/foreman/forks","keys_url":"https://api.github.com/repos/shlomizadok/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shlomizadok/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shlomizadok/foreman/teams","hooks_url":"https://api.github.com/repos/shlomizadok/foreman/hooks","issue_events_url":"https://api.github.com/repos/shlomizadok/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/shlomizadok/foreman/events","assignees_url":"https://api.github.com/repos/shlomizadok/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/shlomizadok/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/shlomizadok/foreman/tags","blobs_url":"https://api.github.com/repos/shlomizadok/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shlomizadok/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shlomizadok/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/shlomizadok/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shlomizadok/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/shlomizadok/foreman/languages","stargazers_url":"https://api.github.com/repos/shlomizadok/foreman/stargazers","contributors_url":"https://api.github.com/repos/shlomizadok/foreman/contributors","subscribers_url":"https://api.github.com/repos/shlomizadok/foreman/subscribers","subscription_url":"https://api.github.com/repos/shlomizadok/foreman/subscription","commits_url":"https://api.github.com/repos/shlomizadok/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/shlomizadok/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/shlomizadok/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/shlomizadok/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/shlomizadok/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/shlomizadok/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shlomizadok/foreman/merges","archive_url":"https://api.github.com/repos/shlomizadok/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shlomizadok/foreman/downloads","issues_url":"https://api.github.com/repos/shlomizadok/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/shlomizadok/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/shlomizadok/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/shlomizadok/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shlomizadok/foreman/labels{/name}","releases_url":"https://api.github.com/repos/shlomizadok/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/shlomizadok/foreman/deployments","created_at":"2014-09-01T12:29:20Z","updated_at":"2016-01-11T16:32:53Z","pushed_at":"2016-12-18T13:44:55Z","git_url":"git://github.com/shlomizadok/foreman.git","ssh_url":"git@github.com:shlomizadok/foreman.git","clone_url":"https://github.com/shlomizadok/foreman.git","svn_url":"https://github.com/shlomizadok/foreman","homepage":"http://theforeman.org","size":40056,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"d4af7cae07f78bd047290e68af37b55122e0ed4b","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/foreman/deployments","created_at":"2009-07-23T15:07:00Z","updated_at":"2016-12-17T04:10:03Z","pushed_at":"2016-12-18T13:44:57Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":54759,"stargazers_count":1124,"watchers_count":1124,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":578,"mirror_url":null,"open_issues_count":91,"forks":578,"open_issues":91,"watchers":1124,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4024"},"html":{"href":"https://github.com/theforeman/foreman/pull/4024"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/4024"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/4024/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4024/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/4024/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/ae7371b912300fc2707044317f6298652b48c471"}}}}
{"actor":{"display_login":"houndci-bot"}}