{"action":"created","comment":{"url":"https://api.github.com/repos/201-created/LG-api/pulls/comments/24421137","id":24421137,"diff_hunk":"@@ -88,4 +88,18 @@\n         change { image_set.reload.main_image }.from(nil).to(main_image)\n     }\n   end\n+\n+  describe '#destroy' do\n+    let(:image_set) { Fabricate :image_set_with_images }\n+    let(:request) { -> { delete :destroy, id: image_set.id } }\n+\n+    it_behaves_like \"an authenticated controller\"\n+    it { expect { subject }.to change { ImageSet.count }.by(1) }\n+    it { expect { subject }.to change { Image.count }.by(5) }\n+","path":"spec/controllers/image_sets_controller_spec.rb","position":12,"original_position":12,"commit_id":"7eccfc9e26db8c13ca13d47562c4b9809d5b387f","original_commit_id":"7eccfc9e26db8c13ca13d47562c4b9809d5b387f","user":{"login":"iezer","id":87991,"avatar_url":"https://avatars.githubusercontent.com/u/87991?v=3","gravatar_id":"","url":"https://api.github.com/users/iezer","html_url":"https://github.com/iezer","followers_url":"https://api.github.com/users/iezer/followers","following_url":"https://api.github.com/users/iezer/following{/other_user}","gists_url":"https://api.github.com/users/iezer/gists{/gist_id}","starred_url":"https://api.github.com/users/iezer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iezer/subscriptions","organizations_url":"https://api.github.com/users/iezer/orgs","repos_url":"https://api.github.com/users/iezer/repos","events_url":"https://api.github.com/users/iezer/events{/privacy}","received_events_url":"https://api.github.com/users/iezer/received_events","type":"User","site_admin":false},"body":"@redyaffle not sure this is testing the right thing. we want ImageSet.count to change by **-1** and Image.count by **-5**. This test is actually passing because the objects are getting created and not deleted. I think if you get rid of the `require_organization` filter above then ImageSet.count will go down by -1. Image.count will not go down by -5 unless we add `dependent: destroy' for images in the image_set definition, which we should do anyway.","created_at":"2015-02-10T15:42:00Z","updated_at":"2015-02-10T15:42:00Z","html_url":"https://github.com/201-created/LG-api/pull/7#discussion_r24421137","pull_request_url":"https://api.github.com/repos/201-created/LG-api/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/comments/24421137"},"html":{"href":"https://github.com/201-created/LG-api/pull/7#discussion_r24421137"},"pull_request":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/201-created/LG-api/pulls/7","id":28980805,"html_url":"https://github.com/201-created/LG-api/pull/7","diff_url":"https://github.com/201-created/LG-api/pull/7.diff","patch_url":"https://github.com/201-created/LG-api/pull/7.patch","issue_url":"https://api.github.com/repos/201-created/LG-api/issues/7","number":7,"state":"open","locked":false,"title":"Add routes for deleting image set","user":{"login":"redyaffle","id":545972,"avatar_url":"https://avatars.githubusercontent.com/u/545972?v=3","gravatar_id":"","url":"https://api.github.com/users/redyaffle","html_url":"https://github.com/redyaffle","followers_url":"https://api.github.com/users/redyaffle/followers","following_url":"https://api.github.com/users/redyaffle/following{/other_user}","gists_url":"https://api.github.com/users/redyaffle/gists{/gist_id}","starred_url":"https://api.github.com/users/redyaffle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redyaffle/subscriptions","organizations_url":"https://api.github.com/users/redyaffle/orgs","repos_url":"https://api.github.com/users/redyaffle/repos","events_url":"https://api.github.com/users/redyaffle/events{/privacy}","received_events_url":"https://api.github.com/users/redyaffle/received_events","type":"User","site_admin":false},"body":"@iezer This is missing tests, but wanted to get you an update tonight as the functionality is working. I'll follow up with some tests to confirm the behavior in the morning.\r\n\r\nThis receives delete request from the front-end and removes an image_set. I'll test to confirm images within the image_set are deleted as well. \r\n","created_at":"2015-02-10T04:46:09Z","updated_at":"2015-02-10T15:42:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fefe81f0c79ec44e0aedfbb7b6cc0e1b57aff6f5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/201-created/LG-api/pulls/7/commits","review_comments_url":"https://api.github.com/repos/201-created/LG-api/pulls/7/comments","review_comment_url":"https://api.github.com/repos/201-created/LG-api/pulls/comments/{number}","comments_url":"https://api.github.com/repos/201-created/LG-api/issues/7/comments","statuses_url":"https://api.github.com/repos/201-created/LG-api/statuses/7eccfc9e26db8c13ca13d47562c4b9809d5b387f","head":{"label":"201-created:delete-image-sets","ref":"delete-image-sets","sha":"7eccfc9e26db8c13ca13d47562c4b9809d5b387f","user":{"login":"201-created","id":5312906,"avatar_url":"https://avatars.githubusercontent.com/u/5312906?v=3","gravatar_id":"","url":"https://api.github.com/users/201-created","html_url":"https://github.com/201-created","followers_url":"https://api.github.com/users/201-created/followers","following_url":"https://api.github.com/users/201-created/following{/other_user}","gists_url":"https://api.github.com/users/201-created/gists{/gist_id}","starred_url":"https://api.github.com/users/201-created/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/201-created/subscriptions","organizations_url":"https://api.github.com/users/201-created/orgs","repos_url":"https://api.github.com/users/201-created/repos","events_url":"https://api.github.com/users/201-created/events{/privacy}","received_events_url":"https://api.github.com/users/201-created/received_events","type":"Organization","site_admin":false},"repo":{"id":29484065,"name":"LG-api","full_name":"201-created/LG-api","owner":{"login":"201-created","id":5312906,"avatar_url":"https://avatars.githubusercontent.com/u/5312906?v=3","gravatar_id":"","url":"https://api.github.com/users/201-created","html_url":"https://github.com/201-created","followers_url":"https://api.github.com/users/201-created/followers","following_url":"https://api.github.com/users/201-created/following{/other_user}","gists_url":"https://api.github.com/users/201-created/gists{/gist_id}","starred_url":"https://api.github.com/users/201-created/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/201-created/subscriptions","organizations_url":"https://api.github.com/users/201-created/orgs","repos_url":"https://api.github.com/users/201-created/repos","events_url":"https://api.github.com/users/201-created/events{/privacy}","received_events_url":"https://api.github.com/users/201-created/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/201-created/LG-api","description":"LG API (Rails)","fork":false,"url":"https://api.github.com/repos/201-created/LG-api","forks_url":"https://api.github.com/repos/201-created/LG-api/forks","keys_url":"https://api.github.com/repos/201-created/LG-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/201-created/LG-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/201-created/LG-api/teams","hooks_url":"https://api.github.com/repos/201-created/LG-api/hooks","issue_events_url":"https://api.github.com/repos/201-created/LG-api/issues/events{/number}","events_url":"https://api.github.com/repos/201-created/LG-api/events","assignees_url":"https://api.github.com/repos/201-created/LG-api/assignees{/user}","branches_url":"https://api.github.com/repos/201-created/LG-api/branches{/branch}","tags_url":"https://api.github.com/repos/201-created/LG-api/tags","blobs_url":"https://api.github.com/repos/201-created/LG-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/201-created/LG-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/201-created/LG-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/201-created/LG-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/201-created/LG-api/statuses/{sha}","languages_url":"https://api.github.com/repos/201-created/LG-api/languages","stargazers_url":"https://api.github.com/repos/201-created/LG-api/stargazers","contributors_url":"https://api.github.com/repos/201-created/LG-api/contributors","subscribers_url":"https://api.github.com/repos/201-created/LG-api/subscribers","subscription_url":"https://api.github.com/repos/201-created/LG-api/subscription","commits_url":"https://api.github.com/repos/201-created/LG-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/201-created/LG-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/201-created/LG-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/201-created/LG-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/201-created/LG-api/contents/{+path}","compare_url":"https://api.github.com/repos/201-created/LG-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/201-created/LG-api/merges","archive_url":"https://api.github.com/repos/201-created/LG-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/201-created/LG-api/downloads","issues_url":"https://api.github.com/repos/201-created/LG-api/issues{/number}","pulls_url":"https://api.github.com/repos/201-created/LG-api/pulls{/number}","milestones_url":"https://api.github.com/repos/201-created/LG-api/milestones{/number}","notifications_url":"https://api.github.com/repos/201-created/LG-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/201-created/LG-api/labels{/name}","releases_url":"https://api.github.com/repos/201-created/LG-api/releases{/id}","created_at":"2015-01-19T18:06:01Z","updated_at":"2015-02-09T21:38:33Z","pushed_at":"2015-02-10T14:23:05Z","git_url":"git://github.com/201-created/LG-api.git","ssh_url":"git@github.com:201-created/LG-api.git","clone_url":"https://github.com/201-created/LG-api.git","svn_url":"https://github.com/201-created/LG-api","homepage":"","size":856,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"201-created:master","ref":"master","sha":"1ca0dabdaf574042c18be247b2a3d39c4e4f40aa","user":{"login":"201-created","id":5312906,"avatar_url":"https://avatars.githubusercontent.com/u/5312906?v=3","gravatar_id":"","url":"https://api.github.com/users/201-created","html_url":"https://github.com/201-created","followers_url":"https://api.github.com/users/201-created/followers","following_url":"https://api.github.com/users/201-created/following{/other_user}","gists_url":"https://api.github.com/users/201-created/gists{/gist_id}","starred_url":"https://api.github.com/users/201-created/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/201-created/subscriptions","organizations_url":"https://api.github.com/users/201-created/orgs","repos_url":"https://api.github.com/users/201-created/repos","events_url":"https://api.github.com/users/201-created/events{/privacy}","received_events_url":"https://api.github.com/users/201-created/received_events","type":"Organization","site_admin":false},"repo":{"id":29484065,"name":"LG-api","full_name":"201-created/LG-api","owner":{"login":"201-created","id":5312906,"avatar_url":"https://avatars.githubusercontent.com/u/5312906?v=3","gravatar_id":"","url":"https://api.github.com/users/201-created","html_url":"https://github.com/201-created","followers_url":"https://api.github.com/users/201-created/followers","following_url":"https://api.github.com/users/201-created/following{/other_user}","gists_url":"https://api.github.com/users/201-created/gists{/gist_id}","starred_url":"https://api.github.com/users/201-created/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/201-created/subscriptions","organizations_url":"https://api.github.com/users/201-created/orgs","repos_url":"https://api.github.com/users/201-created/repos","events_url":"https://api.github.com/users/201-created/events{/privacy}","received_events_url":"https://api.github.com/users/201-created/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/201-created/LG-api","description":"LG API (Rails)","fork":false,"url":"https://api.github.com/repos/201-created/LG-api","forks_url":"https://api.github.com/repos/201-created/LG-api/forks","keys_url":"https://api.github.com/repos/201-created/LG-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/201-created/LG-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/201-created/LG-api/teams","hooks_url":"https://api.github.com/repos/201-created/LG-api/hooks","issue_events_url":"https://api.github.com/repos/201-created/LG-api/issues/events{/number}","events_url":"https://api.github.com/repos/201-created/LG-api/events","assignees_url":"https://api.github.com/repos/201-created/LG-api/assignees{/user}","branches_url":"https://api.github.com/repos/201-created/LG-api/branches{/branch}","tags_url":"https://api.github.com/repos/201-created/LG-api/tags","blobs_url":"https://api.github.com/repos/201-created/LG-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/201-created/LG-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/201-created/LG-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/201-created/LG-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/201-created/LG-api/statuses/{sha}","languages_url":"https://api.github.com/repos/201-created/LG-api/languages","stargazers_url":"https://api.github.com/repos/201-created/LG-api/stargazers","contributors_url":"https://api.github.com/repos/201-created/LG-api/contributors","subscribers_url":"https://api.github.com/repos/201-created/LG-api/subscribers","subscription_url":"https://api.github.com/repos/201-created/LG-api/subscription","commits_url":"https://api.github.com/repos/201-created/LG-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/201-created/LG-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/201-created/LG-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/201-created/LG-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/201-created/LG-api/contents/{+path}","compare_url":"https://api.github.com/repos/201-created/LG-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/201-created/LG-api/merges","archive_url":"https://api.github.com/repos/201-created/LG-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/201-created/LG-api/downloads","issues_url":"https://api.github.com/repos/201-created/LG-api/issues{/number}","pulls_url":"https://api.github.com/repos/201-created/LG-api/pulls{/number}","milestones_url":"https://api.github.com/repos/201-created/LG-api/milestones{/number}","notifications_url":"https://api.github.com/repos/201-created/LG-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/201-created/LG-api/labels{/name}","releases_url":"https://api.github.com/repos/201-created/LG-api/releases{/id}","created_at":"2015-01-19T18:06:01Z","updated_at":"2015-02-09T21:38:33Z","pushed_at":"2015-02-10T14:23:05Z","git_url":"git://github.com/201-created/LG-api.git","ssh_url":"git@github.com:201-created/LG-api.git","clone_url":"https://github.com/201-created/LG-api.git","svn_url":"https://github.com/201-created/LG-api","homepage":"","size":856,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/7"},"html":{"href":"https://github.com/201-created/LG-api/pull/7"},"issue":{"href":"https://api.github.com/repos/201-created/LG-api/issues/7"},"comments":{"href":"https://api.github.com/repos/201-created/LG-api/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/201-created/LG-api/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/201-created/LG-api/statuses/7eccfc9e26db8c13ca13d47562c4b9809d5b387f"}}}}