{"action":"created","comment":{"url":"https://api.github.com/repos/projecthydra/sufia/pulls/comments/33695606","id":33695606,"diff_hunk":"@@ -44,7 +46,17 @@\n         allow(@collection).to receive(:members).and_return([file, file, file])\n         allow(ActiveFedora::SolrService).to receive(:query).with(query, args).and_return(documents)\n       end\n-      it { is_expected.to eq 99 }\n+\n+      context \"when saved\" do\n+        before do\n+          allow(@collection).to receive(:new_record?).and_return(false)\n+        end\n+        it { is_expected.to eq 99 }\n+      end\n+\n+      context \"when not saved\" do\n+        it { expect {subject}.to raise_error \"Collection must be saved to query for bytes\" }","path":"spec/models/collection_spec.rb","position":27,"original_position":27,"commit_id":"98cc971c4649fdb83a463f19b4b227ebd6e63f9b","original_commit_id":"98cc971c4649fdb83a463f19b4b227ebd6e63f9b","user":{"login":"mjgiarlo","id":131982,"avatar_url":"https://avatars.githubusercontent.com/u/131982?v=3","gravatar_id":"","url":"https://api.github.com/users/mjgiarlo","html_url":"https://github.com/mjgiarlo","followers_url":"https://api.github.com/users/mjgiarlo/followers","following_url":"https://api.github.com/users/mjgiarlo/following{/other_user}","gists_url":"https://api.github.com/users/mjgiarlo/gists{/gist_id}","starred_url":"https://api.github.com/users/mjgiarlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjgiarlo/subscriptions","organizations_url":"https://api.github.com/users/mjgiarlo/orgs","repos_url":"https://api.github.com/users/mjgiarlo/repos","events_url":"https://api.github.com/users/mjgiarlo/events{/privacy}","received_events_url":"https://api.github.com/users/mjgiarlo/received_events","type":"User","site_admin":false},"body":"If the `is_expected` syntax doesn't work (weird!), I'd say tweak the syntax a bit here:\r\n\r\n```ruby\r\nit \"raises an error\" do\r\n  expect { subject }.to raise_error \"Collection must be saved to query for bytes\"\r\nend\r\n```\r\n\r\nBecause the \"it { expect\" syntax isn't used anywhere else in Sufia.","created_at":"2015-07-01T16:19:40Z","updated_at":"2015-07-01T16:19:40Z","html_url":"https://github.com/projecthydra/sufia/pull/1217#discussion_r33695606","pull_request_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1217","_links":{"self":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/comments/33695606"},"html":{"href":"https://github.com/projecthydra/sufia/pull/1217#discussion_r33695606"},"pull_request":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1217"}}},"pull_request":{"url":"https://api.github.com/repos/projecthydra/sufia/pulls/1217","id":38899862,"html_url":"https://github.com/projecthydra/sufia/pull/1217","diff_url":"https://github.com/projecthydra/sufia/pull/1217.diff","patch_url":"https://github.com/projecthydra/sufia/pull/1217.patch","issue_url":"https://api.github.com/repos/projecthydra/sufia/issues/1217","number":1217,"state":"open","locked":false,"title":"checking for members and saved before querying solr.  fixes #1216","user":{"login":"cam156","id":1599081,"avatar_url":"https://avatars.githubusercontent.com/u/1599081?v=3","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":"","created_at":"2015-06-30T16:52:09Z","updated_at":"2015-07-01T16:19:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7756628d4792c9f6404ffc6e66941b50546f865a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1217/commits","review_comments_url":"https://api.github.com/repos/projecthydra/sufia/pulls/1217/comments","review_comment_url":"https://api.github.com/repos/projecthydra/sufia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projecthydra/sufia/issues/1217/comments","statuses_url":"https://api.github.com/repos/projecthydra/sufia/statuses/98cc971c4649fdb83a463f19b4b227ebd6e63f9b","head":{"label":"psu-stewardship:fix_1216","ref":"fix_1216","sha":"98cc971c4649fdb83a463f19b4b227ebd6e63f9b","user":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"repo":{"id":7669277,"name":"sufia","full_name":"psu-stewardship/sufia","owner":{"login":"psu-stewardship","id":653493,"avatar_url":"https://avatars.githubusercontent.com/u/653493?v=3","gravatar_id":"","url":"https://api.github.com/users/psu-stewardship","html_url":"https://github.com/psu-stewardship","followers_url":"https://api.github.com/users/psu-stewardship/followers","following_url":"https://api.github.com/users/psu-stewardship/following{/other_user}","gists_url":"https://api.github.com/users/psu-stewardship/gists{/gist_id}","starred_url":"https://api.github.com/users/psu-stewardship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psu-stewardship/subscriptions","organizations_url":"https://api.github.com/users/psu-stewardship/orgs","repos_url":"https://api.github.com/users/psu-stewardship/repos","events_url":"https://api.github.com/users/psu-stewardship/events{/privacy}","received_events_url":"https://api.github.com/users/psu-stewardship/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/psu-stewardship/sufia","description":"Sufia is a Rails engine for creating a self-deposit institutional repository. A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)","fork":true,"url":"https://api.github.com/repos/psu-stewardship/sufia","forks_url":"https://api.github.com/repos/psu-stewardship/sufia/forks","keys_url":"https://api.github.com/repos/psu-stewardship/sufia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psu-stewardship/sufia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psu-stewardship/sufia/teams","hooks_url":"https://api.github.com/repos/psu-stewardship/sufia/hooks","issue_events_url":"https://api.github.com/repos/psu-stewardship/sufia/issues/events{/number}","events_url":"https://api.github.com/repos/psu-stewardship/sufia/events","assignees_url":"https://api.github.com/repos/psu-stewardship/sufia/assignees{/user}","branches_url":"https://api.github.com/repos/psu-stewardship/sufia/branches{/branch}","tags_url":"https://api.github.com/repos/psu-stewardship/sufia/tags","blobs_url":"https://api.github.com/repos/psu-stewardship/sufia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psu-stewardship/sufia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psu-stewardship/sufia/git/refs{/sha}","trees_url":"https://api.github.com/repos/psu-stewardship/sufia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psu-stewardship/sufia/statuses/{sha}","languages_url":"https://api.github.com/repos/psu-stewardship/sufia/languages","stargazers_url":"https://api.github.com/repos/psu-stewardship/sufia/stargazers","contributors_url":"https://api.github.com/repos/psu-stewardship/sufia/contributors","subscribers_url":"https://api.github.com/repos/psu-stewardship/sufia/subscribers","subscription_url":"https://api.github.com/repos/psu-stewardship/sufia/subscription","commits_url":"https://api.github.com/repos/psu-stewardship/sufia/commits{/sha}","git_commits_url":"https://api.github.com/repos/psu-stewardship/sufia/git/commits{/sha}","comments_url":"https://api.github.com/repos/psu-stewardship/sufia/comments{/number}","issue_comment_url":"https://api.github.com/repos/psu-stewardship/sufia/issues/comments{/number}","contents_url":"https://api.github.com/repos/psu-stewardship/sufia/contents/{+path}","compare_url":"https://api.github.com/repos/psu-stewardship/sufia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psu-stewardship/sufia/merges","archive_url":"https://api.github.com/repos/psu-stewardship/sufia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psu-stewardship/sufia/downloads","issues_url":"https://api.github.com/repos/psu-stewardship/sufia/issues{/number}","pulls_url":"https://api.github.com/repos/psu-stewardship/sufia/pulls{/number}","milestones_url":"https://api.github.com/repos/psu-stewardship/sufia/milestones{/number}","notifications_url":"https://api.github.com/repos/psu-stewardship/sufia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psu-stewardship/sufia/labels{/name}","releases_url":"https://api.github.com/repos/psu-stewardship/sufia/releases{/id}","created_at":"2013-01-17T16:04:18Z","updated_at":"2015-04-23T16:51:08Z","pushed_at":"2015-07-01T11:11:14Z","git_url":"git://github.com/psu-stewardship/sufia.git","ssh_url":"git@github.com:psu-stewardship/sufia.git","clone_url":"https://github.com/psu-stewardship/sufia.git","svn_url":"https://github.com/psu-stewardship/sufia","homepage":"","size":55483,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"projecthydra:master","ref":"master","sha":"6c2f5bb93c2ab8e880e477422c95e0998a614dc2","user":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"repo":{"id":7653178,"name":"sufia","full_name":"projecthydra/sufia","owner":{"login":"projecthydra","id":109426,"avatar_url":"https://avatars.githubusercontent.com/u/109426?v=3","gravatar_id":"","url":"https://api.github.com/users/projecthydra","html_url":"https://github.com/projecthydra","followers_url":"https://api.github.com/users/projecthydra/followers","following_url":"https://api.github.com/users/projecthydra/following{/other_user}","gists_url":"https://api.github.com/users/projecthydra/gists{/gist_id}","starred_url":"https://api.github.com/users/projecthydra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projecthydra/subscriptions","organizations_url":"https://api.github.com/users/projecthydra/orgs","repos_url":"https://api.github.com/users/projecthydra/repos","events_url":"https://api.github.com/users/projecthydra/events{/privacy}","received_events_url":"https://api.github.com/users/projecthydra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projecthydra/sufia","description":"Sufia is a Rails engine for creating a self-deposit institutional repository. A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)","fork":false,"url":"https://api.github.com/repos/projecthydra/sufia","forks_url":"https://api.github.com/repos/projecthydra/sufia/forks","keys_url":"https://api.github.com/repos/projecthydra/sufia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projecthydra/sufia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projecthydra/sufia/teams","hooks_url":"https://api.github.com/repos/projecthydra/sufia/hooks","issue_events_url":"https://api.github.com/repos/projecthydra/sufia/issues/events{/number}","events_url":"https://api.github.com/repos/projecthydra/sufia/events","assignees_url":"https://api.github.com/repos/projecthydra/sufia/assignees{/user}","branches_url":"https://api.github.com/repos/projecthydra/sufia/branches{/branch}","tags_url":"https://api.github.com/repos/projecthydra/sufia/tags","blobs_url":"https://api.github.com/repos/projecthydra/sufia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projecthydra/sufia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projecthydra/sufia/git/refs{/sha}","trees_url":"https://api.github.com/repos/projecthydra/sufia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projecthydra/sufia/statuses/{sha}","languages_url":"https://api.github.com/repos/projecthydra/sufia/languages","stargazers_url":"https://api.github.com/repos/projecthydra/sufia/stargazers","contributors_url":"https://api.github.com/repos/projecthydra/sufia/contributors","subscribers_url":"https://api.github.com/repos/projecthydra/sufia/subscribers","subscription_url":"https://api.github.com/repos/projecthydra/sufia/subscription","commits_url":"https://api.github.com/repos/projecthydra/sufia/commits{/sha}","git_commits_url":"https://api.github.com/repos/projecthydra/sufia/git/commits{/sha}","comments_url":"https://api.github.com/repos/projecthydra/sufia/comments{/number}","issue_comment_url":"https://api.github.com/repos/projecthydra/sufia/issues/comments{/number}","contents_url":"https://api.github.com/repos/projecthydra/sufia/contents/{+path}","compare_url":"https://api.github.com/repos/projecthydra/sufia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projecthydra/sufia/merges","archive_url":"https://api.github.com/repos/projecthydra/sufia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projecthydra/sufia/downloads","issues_url":"https://api.github.com/repos/projecthydra/sufia/issues{/number}","pulls_url":"https://api.github.com/repos/projecthydra/sufia/pulls{/number}","milestones_url":"https://api.github.com/repos/projecthydra/sufia/milestones{/number}","notifications_url":"https://api.github.com/repos/projecthydra/sufia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projecthydra/sufia/labels{/name}","releases_url":"https://api.github.com/repos/projecthydra/sufia/releases{/id}","created_at":"2013-01-16T20:23:18Z","updated_at":"2015-06-19T16:22:55Z","pushed_at":"2015-07-01T11:11:14Z","git_url":"git://github.com/projecthydra/sufia.git","ssh_url":"git@github.com:projecthydra/sufia.git","clone_url":"https://github.com/projecthydra/sufia.git","svn_url":"https://github.com/projecthydra/sufia","homepage":"","size":59807,"stargazers_count":64,"watchers_count":64,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"open_issues_count":91,"forks":56,"open_issues":91,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1217"},"html":{"href":"https://github.com/projecthydra/sufia/pull/1217"},"issue":{"href":"https://api.github.com/repos/projecthydra/sufia/issues/1217"},"comments":{"href":"https://api.github.com/repos/projecthydra/sufia/issues/1217/comments"},"review_comments":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1217/comments"},"review_comment":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projecthydra/sufia/pulls/1217/commits"},"statuses":{"href":"https://api.github.com/repos/projecthydra/sufia/statuses/98cc971c4649fdb83a463f19b4b227ebd6e63f9b"}}}}