{"action":"created","comment":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/35329320","id":35329320,"diff_hunk":"@@ -0,0 +1,131 @@\n+require \"spec_helper\"\n+\n+describe NodeInfoPresenter do\n+  let(:presenter) { NodeInfoPresenter.new(\"1.0\") }\n+  let(:hash) { presenter.as_json.as_json }\n+\n+  describe \"#as_json\" do\n+    it \"works\" do\n+      expect(hash).to be_present\n+      expect(presenter.to_json).to be_a String\n+    end\n+  end\n+\n+  describe \"node info contents\" do\n+    before do\n+      AppConfig.privacy.statistics.user_counts    = false\n+      AppConfig.privacy.statistics.post_counts    = false\n+      AppConfig.privacy.statistics.comment_counts = false\n+    end\n+\n+    it \"provides generic pod data in json\" do\n+      expect(hash).to eq(\n+        \"version\"           => \"1.0\",\n+        \"software\"          => {\n+          \"name\"    => \"diaspora\",\n+          \"version\" => AppConfig.version_string\n+        },\n+        \"protocols\"         => {\n+          \"inbound\"  => [\"diaspora\"],\n+          \"outbound\" => [\"diaspora\"]\n+        },\n+        \"services\"          => [\"facebook\"],\n+        \"openRegistrations\" => AppConfig.settings.enable_registrations?,\n+        \"usage\"             => {\n+          \"users\" => {}\n+        },\n+        \"metadata\"          => {\n+          \"nodeName\" => AppConfig.settings.pod_name,\n+          \"xmppChat\" => AppConfig.chat.enabled?\n+        }\n+      )\n+    end\n+\n+    context \"when services are enabled\" do\n+      before do\n+        AppConfig.services = {\n+          \"facebook\"  => {\n+            \"enable\"     => true,\n+            \"authorized\" => true\n+          },\n+          \"twitter\"   => {\"enable\" => true},\n+          \"wordpress\" => {\"enable\" => false},\n+          \"tumblr\"    => {\n+            \"enable\"     => true,\n+            \"authorized\" => false\n+          }\n+        }\n+      end\n+\n+      it \"provides services\" do\n+        expect(hash).to include \"services\" => %w(twitter facebook)\n+      end\n+    end\n+\n+    context \"when some services are set to username authorized\" do\n+      before do\n+        AppConfig.services = {\n+          \"facebook\"  => {\n+            \"enable\"     => true,\n+            \"authorized\" => \"bob\"\n+          },\n+          \"twitter\"   => {\"enable\" => true},\n+          \"wordpress\" => {\n+            \"enable\"     => true,\n+            \"authorized\" => \"alice\"\n+          },\n+          \"tumblr\"    => {","path":"spec/presenters/node_info_presenter_spec.rb","position":77,"original_position":77,"commit_id":"8cc6debca439062218c46072740e88f6a63dcf2e","original_commit_id":"8cc6debca439062218c46072740e88f6a63dcf2e","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","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":"Unnecessary spacing detected.","created_at":"2015-07-23T14:50:09Z","updated_at":"2015-07-23T14:50:09Z","html_url":"https://github.com/diaspora/diaspora/pull/6239#discussion_r35329320","pull_request_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6239","_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments/35329320"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6239#discussion_r35329320"},"pull_request":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6239"}}},"pull_request":{"url":"https://api.github.com/repos/diaspora/diaspora/pulls/6239","id":40680124,"html_url":"https://github.com/diaspora/diaspora/pull/6239","diff_url":"https://github.com/diaspora/diaspora/pull/6239.diff","patch_url":"https://github.com/diaspora/diaspora/pull/6239.patch","issue_url":"https://api.github.com/repos/diaspora/diaspora/issues/6239","number":6239,"state":"open","locked":false,"title":"Implement NodeInfo","user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"body":"With this, my current plan would be to drop statistics.json\nafter 0.6 was released.","created_at":"2015-07-23T14:49:08Z","updated_at":"2015-07-23T14:50:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec3c30c45e8306db1c23de6e154c4b8544556374","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6239/commits","review_comments_url":"https://api.github.com/repos/diaspora/diaspora/pulls/6239/comments","review_comment_url":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diaspora/diaspora/issues/6239/comments","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/8cc6debca439062218c46072740e88f6a63dcf2e","head":{"label":"jhass:nodeinfo","ref":"nodeinfo","sha":"8cc6debca439062218c46072740e88f6a63dcf2e","user":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"repo":{"id":1012830,"name":"diaspora","full_name":"jhass/diaspora","owner":{"login":"jhass","id":141294,"avatar_url":"https://avatars.githubusercontent.com/u/141294?v=3","gravatar_id":"","url":"https://api.github.com/users/jhass","html_url":"https://github.com/jhass","followers_url":"https://api.github.com/users/jhass/followers","following_url":"https://api.github.com/users/jhass/following{/other_user}","gists_url":"https://api.github.com/users/jhass/gists{/gist_id}","starred_url":"https://api.github.com/users/jhass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhass/subscriptions","organizations_url":"https://api.github.com/users/jhass/orgs","repos_url":"https://api.github.com/users/jhass/repos","events_url":"https://api.github.com/users/jhass/events{/privacy}","received_events_url":"https://api.github.com/users/jhass/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhass/diaspora","description":"Distributed and contextual social networking","fork":true,"url":"https://api.github.com/repos/jhass/diaspora","forks_url":"https://api.github.com/repos/jhass/diaspora/forks","keys_url":"https://api.github.com/repos/jhass/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhass/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhass/diaspora/teams","hooks_url":"https://api.github.com/repos/jhass/diaspora/hooks","issue_events_url":"https://api.github.com/repos/jhass/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/jhass/diaspora/events","assignees_url":"https://api.github.com/repos/jhass/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/jhass/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/jhass/diaspora/tags","blobs_url":"https://api.github.com/repos/jhass/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhass/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhass/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhass/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhass/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/jhass/diaspora/languages","stargazers_url":"https://api.github.com/repos/jhass/diaspora/stargazers","contributors_url":"https://api.github.com/repos/jhass/diaspora/contributors","subscribers_url":"https://api.github.com/repos/jhass/diaspora/subscribers","subscription_url":"https://api.github.com/repos/jhass/diaspora/subscription","commits_url":"https://api.github.com/repos/jhass/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhass/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhass/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhass/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhass/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/jhass/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhass/diaspora/merges","archive_url":"https://api.github.com/repos/jhass/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhass/diaspora/downloads","issues_url":"https://api.github.com/repos/jhass/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/jhass/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/jhass/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/jhass/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhass/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/jhass/diaspora/releases{/id}","created_at":"2010-10-21T17:41:49Z","updated_at":"2015-05-07T21:46:52Z","pushed_at":"2015-07-23T14:48:08Z","git_url":"git://github.com/jhass/diaspora.git","ssh_url":"git@github.com:jhass/diaspora.git","clone_url":"https://github.com/jhass/diaspora.git","svn_url":"https://github.com/jhass/diaspora","homepage":"","size":103032,"stargazers_count":3,"watchers_count":3,"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":3,"default_branch":"social.mrzyx.de"}},"base":{"label":"diaspora:develop","ref":"develop","sha":"dce2101d9da946216151eb4ed1d3a63391512282","user":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"repo":{"id":911765,"name":"diaspora","full_name":"diaspora/diaspora","owner":{"login":"diaspora","id":293207,"avatar_url":"https://avatars.githubusercontent.com/u/293207?v=3","gravatar_id":"","url":"https://api.github.com/users/diaspora","html_url":"https://github.com/diaspora","followers_url":"https://api.github.com/users/diaspora/followers","following_url":"https://api.github.com/users/diaspora/following{/other_user}","gists_url":"https://api.github.com/users/diaspora/gists{/gist_id}","starred_url":"https://api.github.com/users/diaspora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diaspora/subscriptions","organizations_url":"https://api.github.com/users/diaspora/orgs","repos_url":"https://api.github.com/users/diaspora/repos","events_url":"https://api.github.com/users/diaspora/events{/privacy}","received_events_url":"https://api.github.com/users/diaspora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diaspora/diaspora","description":"Distributed and contextual social networking","fork":false,"url":"https://api.github.com/repos/diaspora/diaspora","forks_url":"https://api.github.com/repos/diaspora/diaspora/forks","keys_url":"https://api.github.com/repos/diaspora/diaspora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diaspora/diaspora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diaspora/diaspora/teams","hooks_url":"https://api.github.com/repos/diaspora/diaspora/hooks","issue_events_url":"https://api.github.com/repos/diaspora/diaspora/issues/events{/number}","events_url":"https://api.github.com/repos/diaspora/diaspora/events","assignees_url":"https://api.github.com/repos/diaspora/diaspora/assignees{/user}","branches_url":"https://api.github.com/repos/diaspora/diaspora/branches{/branch}","tags_url":"https://api.github.com/repos/diaspora/diaspora/tags","blobs_url":"https://api.github.com/repos/diaspora/diaspora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diaspora/diaspora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diaspora/diaspora/git/refs{/sha}","trees_url":"https://api.github.com/repos/diaspora/diaspora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diaspora/diaspora/statuses/{sha}","languages_url":"https://api.github.com/repos/diaspora/diaspora/languages","stargazers_url":"https://api.github.com/repos/diaspora/diaspora/stargazers","contributors_url":"https://api.github.com/repos/diaspora/diaspora/contributors","subscribers_url":"https://api.github.com/repos/diaspora/diaspora/subscribers","subscription_url":"https://api.github.com/repos/diaspora/diaspora/subscription","commits_url":"https://api.github.com/repos/diaspora/diaspora/commits{/sha}","git_commits_url":"https://api.github.com/repos/diaspora/diaspora/git/commits{/sha}","comments_url":"https://api.github.com/repos/diaspora/diaspora/comments{/number}","issue_comment_url":"https://api.github.com/repos/diaspora/diaspora/issues/comments{/number}","contents_url":"https://api.github.com/repos/diaspora/diaspora/contents/{+path}","compare_url":"https://api.github.com/repos/diaspora/diaspora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diaspora/diaspora/merges","archive_url":"https://api.github.com/repos/diaspora/diaspora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diaspora/diaspora/downloads","issues_url":"https://api.github.com/repos/diaspora/diaspora/issues{/number}","pulls_url":"https://api.github.com/repos/diaspora/diaspora/pulls{/number}","milestones_url":"https://api.github.com/repos/diaspora/diaspora/milestones{/number}","notifications_url":"https://api.github.com/repos/diaspora/diaspora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diaspora/diaspora/labels{/name}","releases_url":"https://api.github.com/repos/diaspora/diaspora/releases{/id}","created_at":"2010-09-15T05:20:04Z","updated_at":"2015-07-23T14:08:24Z","pushed_at":"2015-07-23T14:49:08Z","git_url":"git://github.com/diaspora/diaspora.git","ssh_url":"git@github.com:diaspora/diaspora.git","clone_url":"https://github.com/diaspora/diaspora.git","svn_url":"https://github.com/diaspora/diaspora","homepage":"https://diasporafoundation.org/","size":254380,"stargazers_count":10161,"watchers_count":10161,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2638,"mirror_url":null,"open_issues_count":404,"forks":2638,"open_issues":404,"watchers":10161,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6239"},"html":{"href":"https://github.com/diaspora/diaspora/pull/6239"},"issue":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6239"},"comments":{"href":"https://api.github.com/repos/diaspora/diaspora/issues/6239/comments"},"review_comments":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6239/comments"},"review_comment":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diaspora/diaspora/pulls/6239/commits"},"statuses":{"href":"https://api.github.com/repos/diaspora/diaspora/statuses/8cc6debca439062218c46072740e88f6a63dcf2e"}}}}