{"action":"created","comment":{"url":"https://api.github.com/repos/psu-libraries/cho/pulls/comments/184410043","pull_request_review_id":115600581,"id":184410043,"diff_hunk":"@@ -42,10 +42,61 @@ class MyResource; end\n   end\n \n   describe 'data dictionary field accessors' do\n-    subject { SolrDocument.new(document) }\n+    let(:document) { { 'internal_resource_tsim' => 'MyResource', title_tesim: ['my_title'], created_dtsi: ['2018-04-19T15:46:46Z'] } }\n+\n+    its(:field_title) { is_expected.to eq ['my_title'] }\n+    its(:field_created) { is_expected.to eq ['2018-04-19T15:46:46Z'] }\n+  end\n+\n+  describe 'exports_as? csv' do\n+    subject { solr_document.exports_as?(:csv) }\n+\n+    let(:document) { { 'internal_resource_tsim' => 'MyResource' } }\n+\n+    it { is_expected.to be_truthy }\n+  end\n+\n+  describe 'export_as_csv' do\n+    subject { solr_document.export_as_csv }\n+\n+    let(:document) { { 'internal_resource_tsim' => 'MyResource', id: 'abc123', title_tesim: ['my_title'], generic_field_tesim: ['value1', 'value2'] } }\n+\n+    it { is_expected.to eq(\"abc123,,my_title,,,,value1|value2,,,,,\\n\") }\n+\n+    context 'a collection' do\n+      let(:collection) { create :library_collection }\n+      let(:work) { create :work, member_of_collection_ids: [collection.id], title: 'Work One' }\n+      let(:work1_csv) { \"#{work.id},#{collection.id},Work One,,,,,,,,,\" }\n+      let(:work2) { create :work, member_of_collection_ids: [collection.id], title: 'Work Two' }\n+      let(:work2_csv) { \"#{work2.id},#{collection.id},Work Two,,,,,,,,,\" }\n+      let(:csv_header) { 'id,members_of_collection_id,title,subtitle,description,created,generic_field,document_field,still_image_field,moving_image_field,map_field,audio_field' }\n+      let(:document) { { 'internal_resource_tsim' => 'MyCollection', id: collection.id, title_tesim: ['my_collection'] } }\n+\n+      before do\n+        work\n+        work2","path":"spec/blacklight/solr_document_spec.rb","position":66,"original_position":66,"commit_id":"ee2dbba681160cc18010ed525850bafce237fc9c","original_commit_id":"97cbc134b182cb7c94369059b78376111630efb9","user":{"login":"cam156","id":1599081,"avatar_url":"https://avatars2.githubusercontent.com/u/1599081?v=4","gravatar_id":"","url":"https://api.github.com/users/cam156","html_url":"https://github.com/cam156","followers_url":"https://api.github.com/users/cam156/followers","following_url":"https://api.github.com/users/cam156/following{/other_user}","gists_url":"https://api.github.com/users/cam156/gists{/gist_id}","starred_url":"https://api.github.com/users/cam156/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cam156/subscriptions","organizations_url":"https://api.github.com/users/cam156/orgs","repos_url":"https://api.github.com/users/cam156/repos","events_url":"https://api.github.com/users/cam156/events{/privacy}","received_events_url":"https://api.github.com/users/cam156/received_events","type":"User","site_admin":false},"body":"@awead rubocop got angry so I changed them from let!  Did we want to change the rubocop rules?","created_at":"2018-04-26T14:28:46Z","updated_at":"2018-04-26T14:28:46Z","html_url":"https://github.com/psu-libraries/cho/pull/493#discussion_r184410043","pull_request_url":"https://api.github.com/repos/psu-libraries/cho/pulls/493","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/comments/184410043"},"html":{"href":"https://github.com/psu-libraries/cho/pull/493#discussion_r184410043"},"pull_request":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/493"}},"in_reply_to_id":184391568},"pull_request":{"url":"https://api.github.com/repos/psu-libraries/cho/pulls/493","id":184130764,"html_url":"https://github.com/psu-libraries/cho/pull/493","diff_url":"https://github.com/psu-libraries/cho/pull/493.diff","patch_url":"https://github.com/psu-libraries/cho/pull/493.patch","issue_url":"https://api.github.com/repos/psu-libraries/cho/issues/493","number":493,"state":"open","locked":false,"title":"Adding csv export ","user":{"login":"cam156","id":1599081,"avatar_url":"https://avatars2.githubusercontent.com/u/1599081?v=4","gravatar_id":"","url":"https://api.github.com/users/cam156","html_url":"https://github.com/cam156","followers_url":"https://api.github.com/users/cam156/followers","following_url":"https://api.github.com/users/cam156/following{/other_user}","gists_url":"https://api.github.com/users/cam156/gists{/gist_id}","starred_url":"https://api.github.com/users/cam156/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cam156/subscriptions","organizations_url":"https://api.github.com/users/cam156/orgs","repos_url":"https://api.github.com/users/cam156/repos","events_url":"https://api.github.com/users/cam156/events{/privacy}","received_events_url":"https://api.github.com/users/cam156/received_events","type":"User","site_admin":false},"body":" * Adds .csv format to show for work and collection\r\n * Adds method name to field\r\n * Changed field methods defined on SolrDocument to not conflict with existing methods. resource field vs resource method existing on solr document\r\n * Changes indexer to use new method name\r\n\r\n## Description\r\n\r\nReferences ticket: (if any) refs #17\r\n\r\nWhy was this necessary? Adding export as requested by users\r\n\r\n## Changes\r\n\r\nAre there any major changes in this PR that will change the release process? no\r\n\r\n## Checklist\r\n\r\n- [ ] adequate test coverage\r\n","created_at":"2018-04-25T18:53:36Z","updated_at":"2018-04-26T14:28:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa0c5b0ec18354d8a4aab996518a43c90847b86","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":658787710,"url":"https://api.github.com/repos/psu-libraries/cho/labels/PR","name":"PR","color":"e6e6e6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/psu-libraries/cho/pulls/493/commits","review_comments_url":"https://api.github.com/repos/psu-libraries/cho/pulls/493/comments","review_comment_url":"https://api.github.com/repos/psu-libraries/cho/pulls/comments{/number}","comments_url":"https://api.github.com/repos/psu-libraries/cho/issues/493/comments","statuses_url":"https://api.github.com/repos/psu-libraries/cho/statuses/ee2dbba681160cc18010ed525850bafce237fc9c","head":{"label":"psu-libraries:i#17","ref":"i#17","sha":"ee2dbba681160cc18010ed525850bafce237fc9c","user":{"login":"psu-libraries","id":14916270,"avatar_url":"https://avatars2.githubusercontent.com/u/14916270?v=4","gravatar_id":"","url":"https://api.github.com/users/psu-libraries","html_url":"https://github.com/psu-libraries","followers_url":"https://api.github.com/users/psu-libraries/followers","following_url":"https://api.github.com/users/psu-libraries/following{/other_user}","gists_url":"https://api.github.com/users/psu-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-libraries/subscriptions","organizations_url":"https://api.github.com/users/psu-libraries/orgs","repos_url":"https://api.github.com/users/psu-libraries/repos","events_url":"https://api.github.com/users/psu-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/psu-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":51171200,"name":"cho","full_name":"psu-libraries/cho","owner":{"login":"psu-libraries","id":14916270,"avatar_url":"https://avatars2.githubusercontent.com/u/14916270?v=4","gravatar_id":"","url":"https://api.github.com/users/psu-libraries","html_url":"https://github.com/psu-libraries","followers_url":"https://api.github.com/users/psu-libraries/followers","following_url":"https://api.github.com/users/psu-libraries/following{/other_user}","gists_url":"https://api.github.com/users/psu-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-libraries/subscriptions","organizations_url":"https://api.github.com/users/psu-libraries/orgs","repos_url":"https://api.github.com/users/psu-libraries/repos","events_url":"https://api.github.com/users/psu-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/psu-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psu-libraries/cho","description":"Project for Penn State Library's cultural heritage object repository.","fork":false,"url":"https://api.github.com/repos/psu-libraries/cho","forks_url":"https://api.github.com/repos/psu-libraries/cho/forks","keys_url":"https://api.github.com/repos/psu-libraries/cho/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psu-libraries/cho/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psu-libraries/cho/teams","hooks_url":"https://api.github.com/repos/psu-libraries/cho/hooks","issue_events_url":"https://api.github.com/repos/psu-libraries/cho/issues/events{/number}","events_url":"https://api.github.com/repos/psu-libraries/cho/events","assignees_url":"https://api.github.com/repos/psu-libraries/cho/assignees{/user}","branches_url":"https://api.github.com/repos/psu-libraries/cho/branches{/branch}","tags_url":"https://api.github.com/repos/psu-libraries/cho/tags","blobs_url":"https://api.github.com/repos/psu-libraries/cho/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psu-libraries/cho/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psu-libraries/cho/git/refs{/sha}","trees_url":"https://api.github.com/repos/psu-libraries/cho/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psu-libraries/cho/statuses/{sha}","languages_url":"https://api.github.com/repos/psu-libraries/cho/languages","stargazers_url":"https://api.github.com/repos/psu-libraries/cho/stargazers","contributors_url":"https://api.github.com/repos/psu-libraries/cho/contributors","subscribers_url":"https://api.github.com/repos/psu-libraries/cho/subscribers","subscription_url":"https://api.github.com/repos/psu-libraries/cho/subscription","commits_url":"https://api.github.com/repos/psu-libraries/cho/commits{/sha}","git_commits_url":"https://api.github.com/repos/psu-libraries/cho/git/commits{/sha}","comments_url":"https://api.github.com/repos/psu-libraries/cho/comments{/number}","issue_comment_url":"https://api.github.com/repos/psu-libraries/cho/issues/comments{/number}","contents_url":"https://api.github.com/repos/psu-libraries/cho/contents/{+path}","compare_url":"https://api.github.com/repos/psu-libraries/cho/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psu-libraries/cho/merges","archive_url":"https://api.github.com/repos/psu-libraries/cho/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psu-libraries/cho/downloads","issues_url":"https://api.github.com/repos/psu-libraries/cho/issues{/number}","pulls_url":"https://api.github.com/repos/psu-libraries/cho/pulls{/number}","milestones_url":"https://api.github.com/repos/psu-libraries/cho/milestones{/number}","notifications_url":"https://api.github.com/repos/psu-libraries/cho/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psu-libraries/cho/labels{/name}","releases_url":"https://api.github.com/repos/psu-libraries/cho/releases{/id}","deployments_url":"https://api.github.com/repos/psu-libraries/cho/deployments","created_at":"2016-02-05T20:11:28Z","updated_at":"2018-04-24T11:35:42Z","pushed_at":"2018-04-26T13:49:48Z","git_url":"git://github.com/psu-libraries/cho.git","ssh_url":"git@github.com:psu-libraries/cho.git","clone_url":"https://github.com/psu-libraries/cho.git","svn_url":"https://github.com/psu-libraries/cho","homepage":"","size":1805,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":267,"license":null,"forks":1,"open_issues":267,"watchers":5,"default_branch":"master"}},"base":{"label":"psu-libraries:master","ref":"master","sha":"d7040317230de6cf98b3f144a2f297e875f83b6f","user":{"login":"psu-libraries","id":14916270,"avatar_url":"https://avatars2.githubusercontent.com/u/14916270?v=4","gravatar_id":"","url":"https://api.github.com/users/psu-libraries","html_url":"https://github.com/psu-libraries","followers_url":"https://api.github.com/users/psu-libraries/followers","following_url":"https://api.github.com/users/psu-libraries/following{/other_user}","gists_url":"https://api.github.com/users/psu-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-libraries/subscriptions","organizations_url":"https://api.github.com/users/psu-libraries/orgs","repos_url":"https://api.github.com/users/psu-libraries/repos","events_url":"https://api.github.com/users/psu-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/psu-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":51171200,"name":"cho","full_name":"psu-libraries/cho","owner":{"login":"psu-libraries","id":14916270,"avatar_url":"https://avatars2.githubusercontent.com/u/14916270?v=4","gravatar_id":"","url":"https://api.github.com/users/psu-libraries","html_url":"https://github.com/psu-libraries","followers_url":"https://api.github.com/users/psu-libraries/followers","following_url":"https://api.github.com/users/psu-libraries/following{/other_user}","gists_url":"https://api.github.com/users/psu-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-libraries/subscriptions","organizations_url":"https://api.github.com/users/psu-libraries/orgs","repos_url":"https://api.github.com/users/psu-libraries/repos","events_url":"https://api.github.com/users/psu-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/psu-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psu-libraries/cho","description":"Project for Penn State Library's cultural heritage object repository.","fork":false,"url":"https://api.github.com/repos/psu-libraries/cho","forks_url":"https://api.github.com/repos/psu-libraries/cho/forks","keys_url":"https://api.github.com/repos/psu-libraries/cho/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psu-libraries/cho/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psu-libraries/cho/teams","hooks_url":"https://api.github.com/repos/psu-libraries/cho/hooks","issue_events_url":"https://api.github.com/repos/psu-libraries/cho/issues/events{/number}","events_url":"https://api.github.com/repos/psu-libraries/cho/events","assignees_url":"https://api.github.com/repos/psu-libraries/cho/assignees{/user}","branches_url":"https://api.github.com/repos/psu-libraries/cho/branches{/branch}","tags_url":"https://api.github.com/repos/psu-libraries/cho/tags","blobs_url":"https://api.github.com/repos/psu-libraries/cho/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psu-libraries/cho/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psu-libraries/cho/git/refs{/sha}","trees_url":"https://api.github.com/repos/psu-libraries/cho/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psu-libraries/cho/statuses/{sha}","languages_url":"https://api.github.com/repos/psu-libraries/cho/languages","stargazers_url":"https://api.github.com/repos/psu-libraries/cho/stargazers","contributors_url":"https://api.github.com/repos/psu-libraries/cho/contributors","subscribers_url":"https://api.github.com/repos/psu-libraries/cho/subscribers","subscription_url":"https://api.github.com/repos/psu-libraries/cho/subscription","commits_url":"https://api.github.com/repos/psu-libraries/cho/commits{/sha}","git_commits_url":"https://api.github.com/repos/psu-libraries/cho/git/commits{/sha}","comments_url":"https://api.github.com/repos/psu-libraries/cho/comments{/number}","issue_comment_url":"https://api.github.com/repos/psu-libraries/cho/issues/comments{/number}","contents_url":"https://api.github.com/repos/psu-libraries/cho/contents/{+path}","compare_url":"https://api.github.com/repos/psu-libraries/cho/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psu-libraries/cho/merges","archive_url":"https://api.github.com/repos/psu-libraries/cho/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psu-libraries/cho/downloads","issues_url":"https://api.github.com/repos/psu-libraries/cho/issues{/number}","pulls_url":"https://api.github.com/repos/psu-libraries/cho/pulls{/number}","milestones_url":"https://api.github.com/repos/psu-libraries/cho/milestones{/number}","notifications_url":"https://api.github.com/repos/psu-libraries/cho/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psu-libraries/cho/labels{/name}","releases_url":"https://api.github.com/repos/psu-libraries/cho/releases{/id}","deployments_url":"https://api.github.com/repos/psu-libraries/cho/deployments","created_at":"2016-02-05T20:11:28Z","updated_at":"2018-04-24T11:35:42Z","pushed_at":"2018-04-26T13:49:48Z","git_url":"git://github.com/psu-libraries/cho.git","ssh_url":"git@github.com:psu-libraries/cho.git","clone_url":"https://github.com/psu-libraries/cho.git","svn_url":"https://github.com/psu-libraries/cho","homepage":"","size":1805,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":267,"license":null,"forks":1,"open_issues":267,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/493"},"html":{"href":"https://github.com/psu-libraries/cho/pull/493"},"issue":{"href":"https://api.github.com/repos/psu-libraries/cho/issues/493"},"comments":{"href":"https://api.github.com/repos/psu-libraries/cho/issues/493/comments"},"review_comments":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/493/comments"},"review_comment":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/psu-libraries/cho/pulls/493/commits"},"statuses":{"href":"https://api.github.com/repos/psu-libraries/cho/statuses/ee2dbba681160cc18010ed525850bafce237fc9c"}},"author_association":"OWNER"}}
{"actor":{"display_login":"cam156"}}