{"action":"created","comment":{"url":"https://api.github.com/repos/sul-dlss/argo/pulls/comments/45795149","id":45795149,"diff_hunk":"@@ -43,6 +43,62 @@\n       expect(@item).to receive(:\"use_license=\").with(@example['use_license'])\n       post 'register', @example\n     end\n+\n+    context 'APO Metadata' do\n+      before(:each) do\n+        @md_info = {\n+          copyright:    'My copyright statement',\n+          use:          'My use and reproduction statement',\n+          title:        'My title',\n+          desc_md:      'MODS',\n+          metadata_source: 'DOR',\n+          agreement:    'druid:dd327qr3670',\n+          workflow:     'registrationWF',\n+          default_object_rights: 'stanford',\n+          use_license:  'by-nc'\n+        }\n+        @agreement = instantiate_fixture(@md_info[:agreement], Dor::Item)\n+        expect(ActiveFedora::Base).to receive(:find).with(@md_info[:agreement]).and_return(@agreement)\n+      end\n+      it 'should set clean APO metadata for defaultObjectRights' do\n+        expect(subject.respond_to?(:set_apo_metadata)).to be_truthy\n+        subject.set_apo_metadata(@item, @md_info)\n+\n+        expect(@item.mods_title).to           eq(@md_info[:title])\n+        expect(@item.desc_metadata_format).to eq(@md_info[:desc_md])\n+        expect(@item.metadata_source).to      eq(@md_info[:metadata_source])\n+        expect(@item.agreement).to            eq(@md_info[:agreement])\n+        expect(@item.default_workflows).to    eq([@md_info[:workflow]])\n+        expect(@item.default_rights).to       eq(@md_info[:default_object_rights].capitalize)\n+        expect(@item.use_license).to          eq(@md_info[:use_license])\n+        expect(@item.use_license_uri).to      eq(Dor::Editable::CREATIVE_COMMONS_USE_LICENSES[@md_info[:use_license]][:uri])\n+        expect(@item.use_license_human).to    eq(Dor::Editable::CREATIVE_COMMONS_USE_LICENSES[@md_info[:use_license]][:human_readable])\n+        expect(@item.copyright_statement).to  eq(@md_info[:copyright])\n+        expect(@item.use_statement).to        eq(@md_info[:use])\n+        expect(@item.defaultObjectRights.content).to eq(\"<?xml version=\\\"1.0\\\"?>\\n<rightsMetadata>\\n  <copyright>\\n    <human type=\\\"copyright\\\">My copyright statement</human>\\n  </copyright>\\n  <access type=\\\"read\\\">\\n    <machine>\\n      <group>Stanford</group>\\n    </machine>\\n  </access>\\n  <use>\\n    <human type=\\\"useAndReproduction\\\">My use and reproduction statement</human>\\n    <machine type=\\\"creativeCommons\\\" uri=\\\"https://creativecommons.org/licenses/by-nc/3.0/\\\">by-nc</machine>\\n    <human type=\\\"creativeCommons\\\">Attribution Non-Commercial 3.0 Unported</human>\\n  </use>\\n</rightsMetadata>\\n\")\n+      end\n+      it 'should handle no use license' do\n+        @md_info[:use_license] = ' '\n+        subject.set_apo_metadata(@item, @md_info)\n+        expect(@item.use_license).to          eq('')\n+        expect(@item.use_license_uri).to      be_nil\n+        expect(@item.use_license_human).to    eq('')","path":"spec/controllers/apo_controller_spec.rb","position":52,"original_position":52,"commit_id":"8fc69bf5d6e55d528d2a57e4eba437c0a5803f8f","original_commit_id":"c553a4f293c22121c73af695cf4520393c8acd97","user":{"login":"drh-stanford","id":1861171,"avatar_url":"https://avatars.githubusercontent.com/u/1861171?v=3","gravatar_id":"","url":"https://api.github.com/users/drh-stanford","html_url":"https://github.com/drh-stanford","followers_url":"https://api.github.com/users/drh-stanford/followers","following_url":"https://api.github.com/users/drh-stanford/following{/other_user}","gists_url":"https://api.github.com/users/drh-stanford/gists{/gist_id}","starred_url":"https://api.github.com/users/drh-stanford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drh-stanford/subscriptions","organizations_url":"https://api.github.com/users/drh-stanford/orgs","repos_url":"https://api.github.com/users/drh-stanford/repos","events_url":"https://api.github.com/users/drh-stanford/events{/privacy}","received_events_url":"https://api.github.com/users/drh-stanford/received_events","type":"User","site_admin":false},"body":"I think this spacing makes the test more readable. ","created_at":"2015-11-24T21:10:06Z","updated_at":"2015-11-24T21:10:06Z","html_url":"https://github.com/sul-dlss/argo/pull/198#discussion_r45795149","pull_request_url":"https://api.github.com/repos/sul-dlss/argo/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/comments/45795149"},"html":{"href":"https://github.com/sul-dlss/argo/pull/198#discussion_r45795149"},"pull_request":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/sul-dlss/argo/pulls/198","id":50888440,"html_url":"https://github.com/sul-dlss/argo/pull/198","diff_url":"https://github.com/sul-dlss/argo/pull/198.diff","patch_url":"https://github.com/sul-dlss/argo/pull/198.patch","issue_url":"https://api.github.com/repos/sul-dlss/argo/issues/198","number":198,"state":"open","locked":false,"title":"[WIP] dor-services will handle blank parameters for APO definitions","user":{"login":"drh-stanford","id":1861171,"avatar_url":"https://avatars.githubusercontent.com/u/1861171?v=3","gravatar_id":"","url":"https://api.github.com/users/drh-stanford","html_url":"https://github.com/drh-stanford","followers_url":"https://api.github.com/users/drh-stanford/followers","following_url":"https://api.github.com/users/drh-stanford/following{/other_user}","gists_url":"https://api.github.com/users/drh-stanford/gists{/gist_id}","starred_url":"https://api.github.com/users/drh-stanford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drh-stanford/subscriptions","organizations_url":"https://api.github.com/users/drh-stanford/orgs","repos_url":"https://api.github.com/users/drh-stanford/repos","events_url":"https://api.github.com/users/drh-stanford/events{/privacy}","received_events_url":"https://api.github.com/users/drh-stanford/received_events","type":"User","site_admin":false},"body":"This PR removes the data cleanup for registering the APO. This logic/tests are moved into dor-services pending https://github.com/sul-dlss/dor-services/pull/117. If that PR is approved, then I'll update the Gemfile.lock here in this PR","created_at":"2015-11-17T00:34:26Z","updated_at":"2015-11-24T21:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0dff4ac40e1815f8cb183ffea6fcfe6807414ad9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sul-dlss/argo/pulls/198/commits","review_comments_url":"https://api.github.com/repos/sul-dlss/argo/pulls/198/comments","review_comment_url":"https://api.github.com/repos/sul-dlss/argo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sul-dlss/argo/issues/198/comments","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/8fc69bf5d6e55d528d2a57e4eba437c0a5803f8f","head":{"label":"sul-dlss:issue-70","ref":"issue-70","sha":"8fc69bf5d6e55d528d2a57e4eba437c0a5803f8f","user":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":4989164,"name":"argo","full_name":"sul-dlss/argo","owner":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/argo","description":"The administrative discovery interface for Stanford's Digital Object Registry","fork":false,"url":"https://api.github.com/repos/sul-dlss/argo","forks_url":"https://api.github.com/repos/sul-dlss/argo/forks","keys_url":"https://api.github.com/repos/sul-dlss/argo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/argo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/argo/teams","hooks_url":"https://api.github.com/repos/sul-dlss/argo/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/argo/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/argo/events","assignees_url":"https://api.github.com/repos/sul-dlss/argo/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/argo/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/argo/tags","blobs_url":"https://api.github.com/repos/sul-dlss/argo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/argo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/argo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/argo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/argo/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/argo/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/argo/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/argo/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/argo/subscription","commits_url":"https://api.github.com/repos/sul-dlss/argo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/argo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/argo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/argo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/argo/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/argo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/argo/merges","archive_url":"https://api.github.com/repos/sul-dlss/argo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/argo/downloads","issues_url":"https://api.github.com/repos/sul-dlss/argo/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/argo/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/argo/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/argo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/argo/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/argo/releases{/id}","created_at":"2012-07-11T13:15:05Z","updated_at":"2015-11-09T08:17:26Z","pushed_at":"2015-11-24T21:05:59Z","git_url":"git://github.com/sul-dlss/argo.git","ssh_url":"git@github.com:sul-dlss/argo.git","clone_url":"https://github.com/sul-dlss/argo.git","svn_url":"https://github.com/sul-dlss/argo","homepage":null,"size":29238,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":88,"forks":1,"open_issues":88,"watchers":12,"default_branch":"develop"}},"base":{"label":"sul-dlss:develop","ref":"develop","sha":"02dde2902ffffa318e98e97dcb20a6f6554a80be","user":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"repo":{"id":4989164,"name":"argo","full_name":"sul-dlss/argo","owner":{"login":"sul-dlss","id":230583,"avatar_url":"https://avatars.githubusercontent.com/u/230583?v=3","gravatar_id":"","url":"https://api.github.com/users/sul-dlss","html_url":"https://github.com/sul-dlss","followers_url":"https://api.github.com/users/sul-dlss/followers","following_url":"https://api.github.com/users/sul-dlss/following{/other_user}","gists_url":"https://api.github.com/users/sul-dlss/gists{/gist_id}","starred_url":"https://api.github.com/users/sul-dlss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sul-dlss/subscriptions","organizations_url":"https://api.github.com/users/sul-dlss/orgs","repos_url":"https://api.github.com/users/sul-dlss/repos","events_url":"https://api.github.com/users/sul-dlss/events{/privacy}","received_events_url":"https://api.github.com/users/sul-dlss/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sul-dlss/argo","description":"The administrative discovery interface for Stanford's Digital Object Registry","fork":false,"url":"https://api.github.com/repos/sul-dlss/argo","forks_url":"https://api.github.com/repos/sul-dlss/argo/forks","keys_url":"https://api.github.com/repos/sul-dlss/argo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sul-dlss/argo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sul-dlss/argo/teams","hooks_url":"https://api.github.com/repos/sul-dlss/argo/hooks","issue_events_url":"https://api.github.com/repos/sul-dlss/argo/issues/events{/number}","events_url":"https://api.github.com/repos/sul-dlss/argo/events","assignees_url":"https://api.github.com/repos/sul-dlss/argo/assignees{/user}","branches_url":"https://api.github.com/repos/sul-dlss/argo/branches{/branch}","tags_url":"https://api.github.com/repos/sul-dlss/argo/tags","blobs_url":"https://api.github.com/repos/sul-dlss/argo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sul-dlss/argo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sul-dlss/argo/git/refs{/sha}","trees_url":"https://api.github.com/repos/sul-dlss/argo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sul-dlss/argo/statuses/{sha}","languages_url":"https://api.github.com/repos/sul-dlss/argo/languages","stargazers_url":"https://api.github.com/repos/sul-dlss/argo/stargazers","contributors_url":"https://api.github.com/repos/sul-dlss/argo/contributors","subscribers_url":"https://api.github.com/repos/sul-dlss/argo/subscribers","subscription_url":"https://api.github.com/repos/sul-dlss/argo/subscription","commits_url":"https://api.github.com/repos/sul-dlss/argo/commits{/sha}","git_commits_url":"https://api.github.com/repos/sul-dlss/argo/git/commits{/sha}","comments_url":"https://api.github.com/repos/sul-dlss/argo/comments{/number}","issue_comment_url":"https://api.github.com/repos/sul-dlss/argo/issues/comments{/number}","contents_url":"https://api.github.com/repos/sul-dlss/argo/contents/{+path}","compare_url":"https://api.github.com/repos/sul-dlss/argo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sul-dlss/argo/merges","archive_url":"https://api.github.com/repos/sul-dlss/argo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sul-dlss/argo/downloads","issues_url":"https://api.github.com/repos/sul-dlss/argo/issues{/number}","pulls_url":"https://api.github.com/repos/sul-dlss/argo/pulls{/number}","milestones_url":"https://api.github.com/repos/sul-dlss/argo/milestones{/number}","notifications_url":"https://api.github.com/repos/sul-dlss/argo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sul-dlss/argo/labels{/name}","releases_url":"https://api.github.com/repos/sul-dlss/argo/releases{/id}","created_at":"2012-07-11T13:15:05Z","updated_at":"2015-11-09T08:17:26Z","pushed_at":"2015-11-24T21:05:59Z","git_url":"git://github.com/sul-dlss/argo.git","ssh_url":"git@github.com:sul-dlss/argo.git","clone_url":"https://github.com/sul-dlss/argo.git","svn_url":"https://github.com/sul-dlss/argo","homepage":null,"size":29238,"stargazers_count":12,"watchers_count":12,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":88,"forks":1,"open_issues":88,"watchers":12,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/198"},"html":{"href":"https://github.com/sul-dlss/argo/pull/198"},"issue":{"href":"https://api.github.com/repos/sul-dlss/argo/issues/198"},"comments":{"href":"https://api.github.com/repos/sul-dlss/argo/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sul-dlss/argo/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/sul-dlss/argo/statuses/8fc69bf5d6e55d528d2a57e4eba437c0a5803f8f"}}}}