{"action":"created","comment":{"url":"https://api.github.com/repos/wagn/wagn/pulls/comments/40730762","id":40730762,"diff_hunk":"@@ -0,0 +1,97 @@\n+# -*- encoding : utf-8 -*-\n+\n+describe Card::Subcards do\n+\n+  describe 'creating card with subcards' do\n+    it 'works with subcard hash' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'card with subs', :subcards=> { '+sub1' => { :content => 'this is sub1'} }\n+      end\n+      expect(Card['card with subs+sub1'].content).to eq 'this is sub1'\n+    end\n+\n+    it 'works with content string' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'card with subs', :subcards=> { '+sub1' => 'this is sub1'}\n+      end\n+      expect(Card['card with subs+sub1'].content).to eq 'this is sub1'\n+    end\n+\n+    it 'works with +name key in args' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'card with subs', '+sub1' => { :content => 'this is sub1'}\n+      end\n+      expect(Card['card with subs+sub1'].content).to eq 'this is sub1'\n+    end\n+\n+    it 'handles more than one level' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'card with subs', '+sub1' => { '+sub2' => 'this is sub2' }\n+      end\n+      expect(Card['card with subs+sub1+sub2'].content).to eq 'this is sub2'\n+    end\n+\n+    it 'handles compound names' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'superman', '+sub1+sub2' => 'this is sub2'\n+      end\n+      expect(Card['superman+sub1']).to be_truthy\n+      expect(Card['superman+sub1+sub2'].content).to eq 'this is sub2'\n+    end\n+\n+    it 'keeps plural of left part' do\n+      Card::Auth.as_bot do\n+        @card = Card.create! :name=>'supermen', :content=>\"something\", :subcards=> {'+pseudonym' => 'clark'}\n+      end\n+      expect(Card['supermen+pseudonym'].name).to eq 'supermen+pseudonym'\n+    end\n+\n+  end\n+\n+  describe '#add_subfield' do\n+    before do\n+      @card = Card['A']\n+    end\n+    subject { Card.fetch(\"#{@card.name}+sub\", :subcard=>true).content }\n+    it 'works with string' do\n+      @card.add_subfield 'sub', :content=>'this is a sub'\n+      is_expected.to eq 'this is a sub'\n+    end\n+    it 'works with codename' do\n+      @card.add_subfield :phrase, :content=>'this is a sub'\n+      expect(Card.fetch('A+phrase', :subcard=>true).content).to eq 'this is a sub'\n+    end\n+  end\n+\n+  describe '#subfield' do\n+    before do\n+      @card = Card['A']\n+    end\n+    subject { Card.fetch(\"#{@card.name}+sub\", :subcard=>true).content }\n+    it 'works with string' do\n+      @card.add_subfield 'sub', :content=>'this is a sub'\n+      expect(@card.subfield('sub').content).to eq 'this is a sub'\n+    end\n+\n+    it 'works with codename' do\n+      @card.add_subfield :phrase, :content=>'this is a sub'\n+      expect(@card.subfield(':phrase').content).to eq 'this is a sub'\n+    end\n+  end\n+\n+  describe '#add' do\n+    before do\n+      @card = Card['A']\n+    end\n+    it 'adds a subcard' do\n+      @card.add_subcard 'sub', :content=>'sub content'\n+      @card.save!\n+      expect(Card['A+sub'].content).to eq 'sub content'\n+    end\n+  end\n+  #\n+  # describe '#remove_subfield' do\n+  #\n+  # end\n+\n+end","path":"card/spec/lib/card/subcards_spec.rb","position":97,"original_position":97,"commit_id":"6d3957c6fe14052480ce17f05686e8b86f6bd75c","original_commit_id":"6d3957c6fe14052480ce17f05686e8b86f6bd75c","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":"Final newline missing.","created_at":"2015-09-29T21:16:00Z","updated_at":"2015-09-29T21:16:00Z","html_url":"https://github.com/wagn/wagn/pull/513#discussion_r40730762","pull_request_url":"https://api.github.com/repos/wagn/wagn/pulls/513","_links":{"self":{"href":"https://api.github.com/repos/wagn/wagn/pulls/comments/40730762"},"html":{"href":"https://github.com/wagn/wagn/pull/513#discussion_r40730762"},"pull_request":{"href":"https://api.github.com/repos/wagn/wagn/pulls/513"}}},"pull_request":{"url":"https://api.github.com/repos/wagn/wagn/pulls/513","id":46333087,"html_url":"https://github.com/wagn/wagn/pull/513","diff_url":"https://github.com/wagn/wagn/pull/513.diff","patch_url":"https://github.com/wagn/wagn/pull/513.patch","issue_url":"https://api.github.com/repos/wagn/wagn/issues/513","number":513,"state":"open","locked":false,"title":"new subcards api and list/listed_by relations","user":{"login":"xithan","id":13584,"avatar_url":"https://avatars.githubusercontent.com/u/13584?v=3","gravatar_id":"","url":"https://api.github.com/users/xithan","html_url":"https://github.com/xithan","followers_url":"https://api.github.com/users/xithan/followers","following_url":"https://api.github.com/users/xithan/following{/other_user}","gists_url":"https://api.github.com/users/xithan/gists{/gist_id}","starred_url":"https://api.github.com/users/xithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xithan/subscriptions","organizations_url":"https://api.github.com/users/xithan/orgs","repos_url":"https://api.github.com/users/xithan/repos","events_url":"https://api.github.com/users/xithan/events{/privacy}","received_events_url":"https://api.github.com/users/xithan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T21:15:50Z","updated_at":"2015-09-29T21:16:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0258dfb928151354c198b5d69d6c0792b2499a11","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wagn/wagn/pulls/513/commits","review_comments_url":"https://api.github.com/repos/wagn/wagn/pulls/513/comments","review_comment_url":"https://api.github.com/repos/wagn/wagn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wagn/wagn/issues/513/comments","statuses_url":"https://api.github.com/repos/wagn/wagn/statuses/6d3957c6fe14052480ce17f05686e8b86f6bd75c","head":{"label":"xithan:listedby","ref":"listedby","sha":"6d3957c6fe14052480ce17f05686e8b86f6bd75c","user":{"login":"xithan","id":13584,"avatar_url":"https://avatars.githubusercontent.com/u/13584?v=3","gravatar_id":"","url":"https://api.github.com/users/xithan","html_url":"https://github.com/xithan","followers_url":"https://api.github.com/users/xithan/followers","following_url":"https://api.github.com/users/xithan/following{/other_user}","gists_url":"https://api.github.com/users/xithan/gists{/gist_id}","starred_url":"https://api.github.com/users/xithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xithan/subscriptions","organizations_url":"https://api.github.com/users/xithan/orgs","repos_url":"https://api.github.com/users/xithan/repos","events_url":"https://api.github.com/users/xithan/events{/privacy}","received_events_url":"https://api.github.com/users/xithan/received_events","type":"User","site_admin":false},"repo":{"id":19449327,"name":"wagn","full_name":"xithan/wagn","owner":{"login":"xithan","id":13584,"avatar_url":"https://avatars.githubusercontent.com/u/13584?v=3","gravatar_id":"","url":"https://api.github.com/users/xithan","html_url":"https://github.com/xithan","followers_url":"https://api.github.com/users/xithan/followers","following_url":"https://api.github.com/users/xithan/following{/other_user}","gists_url":"https://api.github.com/users/xithan/gists{/gist_id}","starred_url":"https://api.github.com/users/xithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xithan/subscriptions","organizations_url":"https://api.github.com/users/xithan/orgs","repos_url":"https://api.github.com/users/xithan/repos","events_url":"https://api.github.com/users/xithan/events{/privacy}","received_events_url":"https://api.github.com/users/xithan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xithan/wagn","description":"Ruby on rails wiki platform for collaborating to build custom web systems","fork":true,"url":"https://api.github.com/repos/xithan/wagn","forks_url":"https://api.github.com/repos/xithan/wagn/forks","keys_url":"https://api.github.com/repos/xithan/wagn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xithan/wagn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xithan/wagn/teams","hooks_url":"https://api.github.com/repos/xithan/wagn/hooks","issue_events_url":"https://api.github.com/repos/xithan/wagn/issues/events{/number}","events_url":"https://api.github.com/repos/xithan/wagn/events","assignees_url":"https://api.github.com/repos/xithan/wagn/assignees{/user}","branches_url":"https://api.github.com/repos/xithan/wagn/branches{/branch}","tags_url":"https://api.github.com/repos/xithan/wagn/tags","blobs_url":"https://api.github.com/repos/xithan/wagn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xithan/wagn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xithan/wagn/git/refs{/sha}","trees_url":"https://api.github.com/repos/xithan/wagn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xithan/wagn/statuses/{sha}","languages_url":"https://api.github.com/repos/xithan/wagn/languages","stargazers_url":"https://api.github.com/repos/xithan/wagn/stargazers","contributors_url":"https://api.github.com/repos/xithan/wagn/contributors","subscribers_url":"https://api.github.com/repos/xithan/wagn/subscribers","subscription_url":"https://api.github.com/repos/xithan/wagn/subscription","commits_url":"https://api.github.com/repos/xithan/wagn/commits{/sha}","git_commits_url":"https://api.github.com/repos/xithan/wagn/git/commits{/sha}","comments_url":"https://api.github.com/repos/xithan/wagn/comments{/number}","issue_comment_url":"https://api.github.com/repos/xithan/wagn/issues/comments{/number}","contents_url":"https://api.github.com/repos/xithan/wagn/contents/{+path}","compare_url":"https://api.github.com/repos/xithan/wagn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xithan/wagn/merges","archive_url":"https://api.github.com/repos/xithan/wagn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xithan/wagn/downloads","issues_url":"https://api.github.com/repos/xithan/wagn/issues{/number}","pulls_url":"https://api.github.com/repos/xithan/wagn/pulls{/number}","milestones_url":"https://api.github.com/repos/xithan/wagn/milestones{/number}","notifications_url":"https://api.github.com/repos/xithan/wagn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xithan/wagn/labels{/name}","releases_url":"https://api.github.com/repos/xithan/wagn/releases{/id}","created_at":"2014-05-05T08:31:06Z","updated_at":"2015-04-29T09:04:24Z","pushed_at":"2015-09-29T21:13:59Z","git_url":"git://github.com/xithan/wagn.git","ssh_url":"git@github.com:xithan/wagn.git","clone_url":"https://github.com/xithan/wagn.git","svn_url":"https://github.com/xithan/wagn","homepage":"http://www.wagn.org","size":57413,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"wagn:master","ref":"master","sha":"9245f09e3600929b7d0714f529d66cf6724eac02","user":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"repo":{"id":44462,"name":"wagn","full_name":"wagn/wagn","owner":{"login":"wagn","id":20722,"avatar_url":"https://avatars.githubusercontent.com/u/20722?v=3","gravatar_id":"","url":"https://api.github.com/users/wagn","html_url":"https://github.com/wagn","followers_url":"https://api.github.com/users/wagn/followers","following_url":"https://api.github.com/users/wagn/following{/other_user}","gists_url":"https://api.github.com/users/wagn/gists{/gist_id}","starred_url":"https://api.github.com/users/wagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagn/subscriptions","organizations_url":"https://api.github.com/users/wagn/orgs","repos_url":"https://api.github.com/users/wagn/repos","events_url":"https://api.github.com/users/wagn/events{/privacy}","received_events_url":"https://api.github.com/users/wagn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wagn/wagn","description":"Ruby on rails wiki platform for collaborating to build custom web systems","fork":false,"url":"https://api.github.com/repos/wagn/wagn","forks_url":"https://api.github.com/repos/wagn/wagn/forks","keys_url":"https://api.github.com/repos/wagn/wagn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wagn/wagn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wagn/wagn/teams","hooks_url":"https://api.github.com/repos/wagn/wagn/hooks","issue_events_url":"https://api.github.com/repos/wagn/wagn/issues/events{/number}","events_url":"https://api.github.com/repos/wagn/wagn/events","assignees_url":"https://api.github.com/repos/wagn/wagn/assignees{/user}","branches_url":"https://api.github.com/repos/wagn/wagn/branches{/branch}","tags_url":"https://api.github.com/repos/wagn/wagn/tags","blobs_url":"https://api.github.com/repos/wagn/wagn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wagn/wagn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wagn/wagn/git/refs{/sha}","trees_url":"https://api.github.com/repos/wagn/wagn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wagn/wagn/statuses/{sha}","languages_url":"https://api.github.com/repos/wagn/wagn/languages","stargazers_url":"https://api.github.com/repos/wagn/wagn/stargazers","contributors_url":"https://api.github.com/repos/wagn/wagn/contributors","subscribers_url":"https://api.github.com/repos/wagn/wagn/subscribers","subscription_url":"https://api.github.com/repos/wagn/wagn/subscription","commits_url":"https://api.github.com/repos/wagn/wagn/commits{/sha}","git_commits_url":"https://api.github.com/repos/wagn/wagn/git/commits{/sha}","comments_url":"https://api.github.com/repos/wagn/wagn/comments{/number}","issue_comment_url":"https://api.github.com/repos/wagn/wagn/issues/comments{/number}","contents_url":"https://api.github.com/repos/wagn/wagn/contents/{+path}","compare_url":"https://api.github.com/repos/wagn/wagn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wagn/wagn/merges","archive_url":"https://api.github.com/repos/wagn/wagn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wagn/wagn/downloads","issues_url":"https://api.github.com/repos/wagn/wagn/issues{/number}","pulls_url":"https://api.github.com/repos/wagn/wagn/pulls{/number}","milestones_url":"https://api.github.com/repos/wagn/wagn/milestones{/number}","notifications_url":"https://api.github.com/repos/wagn/wagn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wagn/wagn/labels{/name}","releases_url":"https://api.github.com/repos/wagn/wagn/releases{/id}","created_at":"2008-08-21T00:36:11Z","updated_at":"2015-09-13T03:55:18Z","pushed_at":"2015-09-29T21:15:50Z","git_url":"git://github.com/wagn/wagn.git","ssh_url":"git@github.com:wagn/wagn.git","clone_url":"https://github.com/wagn/wagn.git","svn_url":"https://github.com/wagn/wagn","homepage":"http://www.wagn.org","size":61882,"stargazers_count":253,"watchers_count":253,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":55,"mirror_url":null,"open_issues_count":9,"forks":55,"open_issues":9,"watchers":253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wagn/wagn/pulls/513"},"html":{"href":"https://github.com/wagn/wagn/pull/513"},"issue":{"href":"https://api.github.com/repos/wagn/wagn/issues/513"},"comments":{"href":"https://api.github.com/repos/wagn/wagn/issues/513/comments"},"review_comments":{"href":"https://api.github.com/repos/wagn/wagn/pulls/513/comments"},"review_comment":{"href":"https://api.github.com/repos/wagn/wagn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wagn/wagn/pulls/513/commits"},"statuses":{"href":"https://api.github.com/repos/wagn/wagn/statuses/6d3957c6fe14052480ce17f05686e8b86f6bd75c"}}}}