{"action":"created","comment":{"url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/comments/60125080","id":60125080,"diff_hunk":"@@ -190,23 +190,79 @@ module Ddr::Models\n         end\n       end\n \n-      describe \"contacts\" do\n-        before do\n-          allow(Ddr::Models::Contact).to receive(:get).with(:find, slug: 'xa') do\n-            {'id'=>1, 'slug'=>'xa', 'name'=>'Contact A', 'short_name'=>'A'}\n-          end\n-          allow(Ddr::Models::Contact).to receive(:get).with(:find, slug: 'yb') do\n-            {'id'=>1, 'slug'=>'yb', 'name'=>'Contact B', 'short_name'=>'B'}\n+    end\n+\n+    describe \"contacts\" do\n+\n+      subject { FactoryGirl.build(:item) }\n+\n+      before do\n+        allow(Ddr::Models::Contact).to receive(:get).with(:find, slug: 'xa') do\n+          {'id'=>1, 'slug'=>'xa', 'name'=>'Contact A', 'short_name'=>'A'}\n+        end\n+        allow(Ddr::Models::Contact).to receive(:get).with(:find, slug: 'yb') do\n+          {'id'=>1, 'slug'=>'yb', 'name'=>'Contact B', 'short_name'=>'B'}\n+        end\n+      end\n+      describe \"#research_help\" do\n+        before { subject.research_help_contact = 'yb' }\n+        it \"should return the appropriate contact\" do\n+          expect(subject.research_help.slug).to eq('yb')\n+        end\n+      end\n+    end\n+\n+    describe \"locking\" do\n+\n+      subject { FactoryGirl.build(:item) }\n+\n+      describe \"#locked?\" do\n+        context \"object is locked\" do\n+          before { subject.is_locked = true }\n+          it \"should be true\" do\n+            expect(subject.locked?).to be true\n           end\n         end\n-        describe \"#research_help\" do\n-          before { subject.research_help_contact = 'yb' }\n-          it \"should return the appropriate contact\" do\n-            expect(subject.research_help.slug).to eq('yb')\n+        context \"object is not locked\" do\n+          it \"should be false\" do\n+            expect(subject.locked?).to be false\n           end\n         end\n       end\n \n+      describe \"lock\" do\n+        it \"should lock the object\" do\n+          subject.lock\n+          expect(subject.locked?).to be true\n+        end\n+      end\n+\n+      describe \"unlock\" do\n+        before { subject.lock }\n+        it \"should unlock and save the object\" do","path":"spec/models/has_admin_metadata_spec.rb","position":64,"original_position":64,"commit_id":"351cc27966fefdd389e08e26e2e171ae93d35c65","original_commit_id":"351cc27966fefdd389e08e26e2e171ae93d35c65","user":{"login":"dchandekstark","id":137925,"avatar_url":"https://avatars.githubusercontent.com/u/137925?v=3","gravatar_id":"","url":"https://api.github.com/users/dchandekstark","html_url":"https://github.com/dchandekstark","followers_url":"https://api.github.com/users/dchandekstark/followers","following_url":"https://api.github.com/users/dchandekstark/following{/other_user}","gists_url":"https://api.github.com/users/dchandekstark/gists{/gist_id}","starred_url":"https://api.github.com/users/dchandekstark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchandekstark/subscriptions","organizations_url":"https://api.github.com/users/dchandekstark/orgs","repos_url":"https://api.github.com/users/dchandekstark/repos","events_url":"https://api.github.com/users/dchandekstark/events{/privacy}","received_events_url":"https://api.github.com/users/dchandekstark/received_events","type":"User","site_admin":false},"body":"strike \"and save\"","created_at":"2016-04-18T20:07:53Z","updated_at":"2016-04-18T20:07:53Z","html_url":"https://github.com/duke-libraries/ddr-models/pull/607#discussion_r60125080","pull_request_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607","_links":{"self":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/comments/60125080"},"html":{"href":"https://github.com/duke-libraries/ddr-models/pull/607#discussion_r60125080"},"pull_request":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607"}}},"pull_request":{"url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607","id":66913084,"html_url":"https://github.com/duke-libraries/ddr-models/pull/607","diff_url":"https://github.com/duke-libraries/ddr-models/pull/607.diff","patch_url":"https://github.com/duke-libraries/ddr-models/pull/607.patch","issue_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/607","number":607,"state":"open","locked":false,"title":"Add 'lock' attribute to objects; closes #605.","user":{"login":"coblej","id":2104923,"avatar_url":"https://avatars.githubusercontent.com/u/2104923?v=3","gravatar_id":"","url":"https://api.github.com/users/coblej","html_url":"https://github.com/coblej","followers_url":"https://api.github.com/users/coblej/followers","following_url":"https://api.github.com/users/coblej/following{/other_user}","gists_url":"https://api.github.com/users/coblej/gists{/gist_id}","starred_url":"https://api.github.com/users/coblej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coblej/subscriptions","organizations_url":"https://api.github.com/users/coblej/orgs","repos_url":"https://api.github.com/users/coblej/repos","events_url":"https://api.github.com/users/coblej/events{/privacy}","received_events_url":"https://api.github.com/users/coblej/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-18T20:05:21Z","updated_at":"2016-04-18T20:07:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c7abf3b87592aa2563da9cb6858e56562ff3d2a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607/commits","review_comments_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607/comments","review_comment_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/607/comments","statuses_url":"https://api.github.com/repos/duke-libraries/ddr-models/statuses/351cc27966fefdd389e08e26e2e171ae93d35c65","head":{"label":"duke-libraries:hotfix-605-lock-attribute","ref":"hotfix-605-lock-attribute","sha":"351cc27966fefdd389e08e26e2e171ae93d35c65","user":{"login":"duke-libraries","id":2531406,"avatar_url":"https://avatars.githubusercontent.com/u/2531406?v=3","gravatar_id":"","url":"https://api.github.com/users/duke-libraries","html_url":"https://github.com/duke-libraries","followers_url":"https://api.github.com/users/duke-libraries/followers","following_url":"https://api.github.com/users/duke-libraries/following{/other_user}","gists_url":"https://api.github.com/users/duke-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/duke-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duke-libraries/subscriptions","organizations_url":"https://api.github.com/users/duke-libraries/orgs","repos_url":"https://api.github.com/users/duke-libraries/repos","events_url":"https://api.github.com/users/duke-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/duke-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":24959925,"name":"ddr-models","full_name":"duke-libraries/ddr-models","owner":{"login":"duke-libraries","id":2531406,"avatar_url":"https://avatars.githubusercontent.com/u/2531406?v=3","gravatar_id":"","url":"https://api.github.com/users/duke-libraries","html_url":"https://github.com/duke-libraries","followers_url":"https://api.github.com/users/duke-libraries/followers","following_url":"https://api.github.com/users/duke-libraries/following{/other_user}","gists_url":"https://api.github.com/users/duke-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/duke-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duke-libraries/subscriptions","organizations_url":"https://api.github.com/users/duke-libraries/orgs","repos_url":"https://api.github.com/users/duke-libraries/repos","events_url":"https://api.github.com/users/duke-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/duke-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duke-libraries/ddr-models","description":"A Rails engine providing Hydra and ActiveRecord models and common services for the Duke Digital Repository.","fork":false,"url":"https://api.github.com/repos/duke-libraries/ddr-models","forks_url":"https://api.github.com/repos/duke-libraries/ddr-models/forks","keys_url":"https://api.github.com/repos/duke-libraries/ddr-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duke-libraries/ddr-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duke-libraries/ddr-models/teams","hooks_url":"https://api.github.com/repos/duke-libraries/ddr-models/hooks","issue_events_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/events{/number}","events_url":"https://api.github.com/repos/duke-libraries/ddr-models/events","assignees_url":"https://api.github.com/repos/duke-libraries/ddr-models/assignees{/user}","branches_url":"https://api.github.com/repos/duke-libraries/ddr-models/branches{/branch}","tags_url":"https://api.github.com/repos/duke-libraries/ddr-models/tags","blobs_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duke-libraries/ddr-models/statuses/{sha}","languages_url":"https://api.github.com/repos/duke-libraries/ddr-models/languages","stargazers_url":"https://api.github.com/repos/duke-libraries/ddr-models/stargazers","contributors_url":"https://api.github.com/repos/duke-libraries/ddr-models/contributors","subscribers_url":"https://api.github.com/repos/duke-libraries/ddr-models/subscribers","subscription_url":"https://api.github.com/repos/duke-libraries/ddr-models/subscription","commits_url":"https://api.github.com/repos/duke-libraries/ddr-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/duke-libraries/ddr-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/duke-libraries/ddr-models/contents/{+path}","compare_url":"https://api.github.com/repos/duke-libraries/ddr-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duke-libraries/ddr-models/merges","archive_url":"https://api.github.com/repos/duke-libraries/ddr-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duke-libraries/ddr-models/downloads","issues_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues{/number}","pulls_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls{/number}","milestones_url":"https://api.github.com/repos/duke-libraries/ddr-models/milestones{/number}","notifications_url":"https://api.github.com/repos/duke-libraries/ddr-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duke-libraries/ddr-models/labels{/name}","releases_url":"https://api.github.com/repos/duke-libraries/ddr-models/releases{/id}","deployments_url":"https://api.github.com/repos/duke-libraries/ddr-models/deployments","created_at":"2014-10-08T20:40:35Z","updated_at":"2016-01-19T18:03:03Z","pushed_at":"2016-04-18T20:05:21Z","git_url":"git://github.com/duke-libraries/ddr-models.git","ssh_url":"git@github.com:duke-libraries/ddr-models.git","clone_url":"https://github.com/duke-libraries/ddr-models.git","svn_url":"https://github.com/duke-libraries/ddr-models","homepage":"","size":23214,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":53,"forks":1,"open_issues":53,"watchers":1,"default_branch":"develop"}},"base":{"label":"duke-libraries:master","ref":"master","sha":"a326e3b1a7488efe78a6b8f6b79486af4dabe2f5","user":{"login":"duke-libraries","id":2531406,"avatar_url":"https://avatars.githubusercontent.com/u/2531406?v=3","gravatar_id":"","url":"https://api.github.com/users/duke-libraries","html_url":"https://github.com/duke-libraries","followers_url":"https://api.github.com/users/duke-libraries/followers","following_url":"https://api.github.com/users/duke-libraries/following{/other_user}","gists_url":"https://api.github.com/users/duke-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/duke-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duke-libraries/subscriptions","organizations_url":"https://api.github.com/users/duke-libraries/orgs","repos_url":"https://api.github.com/users/duke-libraries/repos","events_url":"https://api.github.com/users/duke-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/duke-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":24959925,"name":"ddr-models","full_name":"duke-libraries/ddr-models","owner":{"login":"duke-libraries","id":2531406,"avatar_url":"https://avatars.githubusercontent.com/u/2531406?v=3","gravatar_id":"","url":"https://api.github.com/users/duke-libraries","html_url":"https://github.com/duke-libraries","followers_url":"https://api.github.com/users/duke-libraries/followers","following_url":"https://api.github.com/users/duke-libraries/following{/other_user}","gists_url":"https://api.github.com/users/duke-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/duke-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duke-libraries/subscriptions","organizations_url":"https://api.github.com/users/duke-libraries/orgs","repos_url":"https://api.github.com/users/duke-libraries/repos","events_url":"https://api.github.com/users/duke-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/duke-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duke-libraries/ddr-models","description":"A Rails engine providing Hydra and ActiveRecord models and common services for the Duke Digital Repository.","fork":false,"url":"https://api.github.com/repos/duke-libraries/ddr-models","forks_url":"https://api.github.com/repos/duke-libraries/ddr-models/forks","keys_url":"https://api.github.com/repos/duke-libraries/ddr-models/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duke-libraries/ddr-models/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duke-libraries/ddr-models/teams","hooks_url":"https://api.github.com/repos/duke-libraries/ddr-models/hooks","issue_events_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/events{/number}","events_url":"https://api.github.com/repos/duke-libraries/ddr-models/events","assignees_url":"https://api.github.com/repos/duke-libraries/ddr-models/assignees{/user}","branches_url":"https://api.github.com/repos/duke-libraries/ddr-models/branches{/branch}","tags_url":"https://api.github.com/repos/duke-libraries/ddr-models/tags","blobs_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/refs{/sha}","trees_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duke-libraries/ddr-models/statuses/{sha}","languages_url":"https://api.github.com/repos/duke-libraries/ddr-models/languages","stargazers_url":"https://api.github.com/repos/duke-libraries/ddr-models/stargazers","contributors_url":"https://api.github.com/repos/duke-libraries/ddr-models/contributors","subscribers_url":"https://api.github.com/repos/duke-libraries/ddr-models/subscribers","subscription_url":"https://api.github.com/repos/duke-libraries/ddr-models/subscription","commits_url":"https://api.github.com/repos/duke-libraries/ddr-models/commits{/sha}","git_commits_url":"https://api.github.com/repos/duke-libraries/ddr-models/git/commits{/sha}","comments_url":"https://api.github.com/repos/duke-libraries/ddr-models/comments{/number}","issue_comment_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues/comments{/number}","contents_url":"https://api.github.com/repos/duke-libraries/ddr-models/contents/{+path}","compare_url":"https://api.github.com/repos/duke-libraries/ddr-models/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duke-libraries/ddr-models/merges","archive_url":"https://api.github.com/repos/duke-libraries/ddr-models/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duke-libraries/ddr-models/downloads","issues_url":"https://api.github.com/repos/duke-libraries/ddr-models/issues{/number}","pulls_url":"https://api.github.com/repos/duke-libraries/ddr-models/pulls{/number}","milestones_url":"https://api.github.com/repos/duke-libraries/ddr-models/milestones{/number}","notifications_url":"https://api.github.com/repos/duke-libraries/ddr-models/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duke-libraries/ddr-models/labels{/name}","releases_url":"https://api.github.com/repos/duke-libraries/ddr-models/releases{/id}","deployments_url":"https://api.github.com/repos/duke-libraries/ddr-models/deployments","created_at":"2014-10-08T20:40:35Z","updated_at":"2016-01-19T18:03:03Z","pushed_at":"2016-04-18T20:05:21Z","git_url":"git://github.com/duke-libraries/ddr-models.git","ssh_url":"git@github.com:duke-libraries/ddr-models.git","clone_url":"https://github.com/duke-libraries/ddr-models.git","svn_url":"https://github.com/duke-libraries/ddr-models","homepage":"","size":23214,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":53,"forks":1,"open_issues":53,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607"},"html":{"href":"https://github.com/duke-libraries/ddr-models/pull/607"},"issue":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/issues/607"},"comments":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/issues/607/comments"},"review_comments":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607/comments"},"review_comment":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/pulls/607/commits"},"statuses":{"href":"https://api.github.com/repos/duke-libraries/ddr-models/statuses/351cc27966fefdd389e08e26e2e171ae93d35c65"}}}}