{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/logstash/pulls/comments/56018494","id":56018494,"diff_hunk":"@@ -0,0 +1,45 @@\n+# encoding: utf-8\n+require_relative \"../../spec_helper\"\n+require \"sinatra\"\n+require \"app/modules/plugins\"\n+require \"logstash/json\"\n+\n+describe LogStash::Api::Plugins do\n+\n+  include Rack::Test::Methods\n+\n+  def app()\n+    described_class\n+  end\n+\n+  before(:all) do\n+    get \"/\"\n+  end\n+\n+  let(:payload) { JSON.parse(last_response.body) }\n+\n+  it \"respond to plugins resource\" do\n+    expect(last_response).to be_ok\n+  end\n+\n+  it \"return valid json content type\" do\n+    expect(last_response.content_type).to eq(\"application/json\")\n+  end\n+\n+  it \"return the expected schema\" do\n+    expect(payload.keys).to include(\"plugins\", \"total\")\n+    payload[\"plugins\"].each do |plugin|\n+      expect(plugin.keys).to include(\"name\", \"version\")","path":"logstash-core/spec/api/lib/api/plugins_spec.rb","position":32,"original_position":32,"commit_id":"0aa1e240236a22a3b9ca13ccfeef30d484307a4e","original_commit_id":"6052d27236bdf587be3a2d773dcd6114cb3a234f","user":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"body":"> do you want to also make sure we return plugin names with content and\r\nfollowing our format?\r\n\r\nBy the format you mean the `logstash-*? This test doesnt involve mocking the `Gem::Specification` layer? \r\n\r\nI think this is a good idea @purbon.\r\n\r\n>  should I extend this way of testing to each other test for the webapi?\r\nNo, Lets keep this PR targetted on the `_plugins`","created_at":"2016-03-14T15:27:29Z","updated_at":"2016-03-14T15:27:29Z","html_url":"https://github.com/elastic/logstash/pull/4794#discussion_r56018494","pull_request_url":"https://api.github.com/repos/elastic/logstash/pulls/4794","_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments/56018494"},"html":{"href":"https://github.com/elastic/logstash/pull/4794#discussion_r56018494"},"pull_request":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4794"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/logstash/pulls/4794","id":62534524,"html_url":"https://github.com/elastic/logstash/pull/4794","diff_url":"https://github.com/elastic/logstash/pull/4794.diff","patch_url":"https://github.com/elastic/logstash/pull/4794.patch","issue_url":"https://api.github.com/repos/elastic/logstash/issues/4794","number":4794,"state":"open","locked":false,"title":"/_plugins resource creation","user":{"login":"purbon","id":68540,"avatar_url":"https://avatars.githubusercontent.com/u/68540?v=3","gravatar_id":"","url":"https://api.github.com/users/purbon","html_url":"https://github.com/purbon","followers_url":"https://api.github.com/users/purbon/followers","following_url":"https://api.github.com/users/purbon/following{/other_user}","gists_url":"https://api.github.com/users/purbon/gists{/gist_id}","starred_url":"https://api.github.com/users/purbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purbon/subscriptions","organizations_url":"https://api.github.com/users/purbon/orgs","repos_url":"https://api.github.com/users/purbon/repos","events_url":"https://api.github.com/users/purbon/events{/privacy}","received_events_url":"https://api.github.com/users/purbon/received_events","type":"User","site_admin":false},"body":"Hi,\r\n  this PR is an initial version for the `/_plugins` resource as defined in #4777. Is important to notice this involve some code duplication for the plugin listing, this will be clean up in a feature, _and probably longer refactoring PR_.","created_at":"2016-03-11T12:06:48Z","updated_at":"2016-03-14T15:27:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d34e80829f1a60a5b4d9302c00bdc4ee2ad4c56a","assignee":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/logstash/pulls/4794/commits","review_comments_url":"https://api.github.com/repos/elastic/logstash/pulls/4794/comments","review_comment_url":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/4794/comments","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/0aa1e240236a22a3b9ca13ccfeef30d484307a4e","head":{"label":"purbon:feature/webapi_plugin_api","ref":"feature/webapi_plugin_api","sha":"0aa1e240236a22a3b9ca13ccfeef30d484307a4e","user":{"login":"purbon","id":68540,"avatar_url":"https://avatars.githubusercontent.com/u/68540?v=3","gravatar_id":"","url":"https://api.github.com/users/purbon","html_url":"https://github.com/purbon","followers_url":"https://api.github.com/users/purbon/followers","following_url":"https://api.github.com/users/purbon/following{/other_user}","gists_url":"https://api.github.com/users/purbon/gists{/gist_id}","starred_url":"https://api.github.com/users/purbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purbon/subscriptions","organizations_url":"https://api.github.com/users/purbon/orgs","repos_url":"https://api.github.com/users/purbon/repos","events_url":"https://api.github.com/users/purbon/events{/privacy}","received_events_url":"https://api.github.com/users/purbon/received_events","type":"User","site_admin":false},"repo":{"id":26748658,"name":"logstash","full_name":"purbon/logstash","owner":{"login":"purbon","id":68540,"avatar_url":"https://avatars.githubusercontent.com/u/68540?v=3","gravatar_id":"","url":"https://api.github.com/users/purbon","html_url":"https://github.com/purbon","followers_url":"https://api.github.com/users/purbon/followers","following_url":"https://api.github.com/users/purbon/following{/other_user}","gists_url":"https://api.github.com/users/purbon/gists{/gist_id}","starred_url":"https://api.github.com/users/purbon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purbon/subscriptions","organizations_url":"https://api.github.com/users/purbon/orgs","repos_url":"https://api.github.com/users/purbon/repos","events_url":"https://api.github.com/users/purbon/events{/privacy}","received_events_url":"https://api.github.com/users/purbon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/purbon/logstash","description":"logstash - logs/event transport, processing, management, search.","fork":true,"url":"https://api.github.com/repos/purbon/logstash","forks_url":"https://api.github.com/repos/purbon/logstash/forks","keys_url":"https://api.github.com/repos/purbon/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/purbon/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/purbon/logstash/teams","hooks_url":"https://api.github.com/repos/purbon/logstash/hooks","issue_events_url":"https://api.github.com/repos/purbon/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/purbon/logstash/events","assignees_url":"https://api.github.com/repos/purbon/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/purbon/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/purbon/logstash/tags","blobs_url":"https://api.github.com/repos/purbon/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/purbon/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/purbon/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/purbon/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/purbon/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/purbon/logstash/languages","stargazers_url":"https://api.github.com/repos/purbon/logstash/stargazers","contributors_url":"https://api.github.com/repos/purbon/logstash/contributors","subscribers_url":"https://api.github.com/repos/purbon/logstash/subscribers","subscription_url":"https://api.github.com/repos/purbon/logstash/subscription","commits_url":"https://api.github.com/repos/purbon/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/purbon/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/purbon/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/purbon/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/purbon/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/purbon/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/purbon/logstash/merges","archive_url":"https://api.github.com/repos/purbon/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/purbon/logstash/downloads","issues_url":"https://api.github.com/repos/purbon/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/purbon/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/purbon/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/purbon/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/purbon/logstash/labels{/name}","releases_url":"https://api.github.com/repos/purbon/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/purbon/logstash/deployments","created_at":"2014-11-17T09:01:27Z","updated_at":"2016-01-11T14:38:17Z","pushed_at":"2016-03-14T14:20:43Z","git_url":"git://github.com/purbon/logstash.git","ssh_url":"git@github.com:purbon/logstash.git","clone_url":"https://github.com/purbon/logstash.git","svn_url":"https://github.com/purbon/logstash","homepage":"http://logstash.net/","size":74406,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"elastic:master","ref":"master","sha":"42710a4ffdfdb915fffa68dd0c4a7153de75735a","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elastic/logstash","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/logstash","description":"logstash - transport and process your logs, events, or other data","fork":false,"url":"https://api.github.com/repos/elastic/logstash","forks_url":"https://api.github.com/repos/elastic/logstash/forks","keys_url":"https://api.github.com/repos/elastic/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/logstash/teams","hooks_url":"https://api.github.com/repos/elastic/logstash/hooks","issue_events_url":"https://api.github.com/repos/elastic/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/logstash/events","assignees_url":"https://api.github.com/repos/elastic/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/logstash/tags","blobs_url":"https://api.github.com/repos/elastic/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/logstash/languages","stargazers_url":"https://api.github.com/repos/elastic/logstash/stargazers","contributors_url":"https://api.github.com/repos/elastic/logstash/contributors","subscribers_url":"https://api.github.com/repos/elastic/logstash/subscribers","subscription_url":"https://api.github.com/repos/elastic/logstash/subscription","commits_url":"https://api.github.com/repos/elastic/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/logstash/merges","archive_url":"https://api.github.com/repos/elastic/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/logstash/downloads","issues_url":"https://api.github.com/repos/elastic/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elastic/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/logstash/deployments","created_at":"2010-11-18T01:31:50Z","updated_at":"2016-03-14T09:45:09Z","pushed_at":"2016-03-14T15:20:09Z","git_url":"git://github.com/elastic/logstash.git","ssh_url":"git@github.com:elastic/logstash.git","clone_url":"https://github.com/elastic/logstash.git","svn_url":"https://github.com/elastic/logstash","homepage":"https://www.elastic.co/products/logstash","size":79416,"stargazers_count":5538,"watchers_count":5538,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1728,"mirror_url":null,"open_issues_count":646,"forks":1728,"open_issues":646,"watchers":5538,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4794"},"html":{"href":"https://github.com/elastic/logstash/pull/4794"},"issue":{"href":"https://api.github.com/repos/elastic/logstash/issues/4794"},"comments":{"href":"https://api.github.com/repos/elastic/logstash/issues/4794/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4794/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/logstash/pulls/4794/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/logstash/statuses/0aa1e240236a22a3b9ca13ccfeef30d484307a4e"}}}}