{"action":"created","comment":{"url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/comments/55319337","id":55319337,"diff_hunk":"@@ -0,0 +1,158 @@\n+require 'rails_helper'\n+\n+RSpec.describe WishlistController, type: :controller do\n+  let(:cas_session) { {cas_user: 'bob'} }\n+  let(:wishlist_item) { double('wishlist_item') }\n+  let(:relation) { double(first_or_initialize: wishlist_item) }\n+\n+  describe 'POST #add_course' do\n+    context 'when the item can be saved' do\n+      before { allow(wishlist_item).to receive(:save).and_return true }\n+\n+      it 'redirects to the requested url' do\n+        url = 'somewhere_else'\n+        allow(WishlistItem).to receive(:where).and_return relation\n+\n+        params = {\n+          course_id: 1,\n+          url: url,\n+        }\n+\n+        post :add_course, params, cas_session\n+        expect(response).to redirect_to(url)\n+      end\n+\n+      it 'notifies the user' do\n+        allow(WishlistItem).to receive(:where).and_return relation\n+\n+        params = {\n+          course_id: 1,\n+        }\n+\n+        post :add_course, params, cas_session\n+        expect(response).to redirect_to(wishlist_path)\n+        expect(flash[:notice]).to include 'success'\n+      end\n+    end\n+\n+    context 'when the item cannot be saved' do\n+      before { allow(wishlist_item).to receive(:save).and_return false }\n+\n+      it 'redirects to the requested url' do\n+        url = 'somewhere_else'\n+        allow(WishlistItem).to receive(:where).and_return relation\n+\n+        params = {\n+          course_id: 1,\n+          url: url,\n+        }\n+\n+        post :add_course, params, cas_session\n+        expect(response).to redirect_to(url)\n+      end\n+\n+      it 'notifies the user' do\n+        allow(WishlistItem).to receive(:where).and_return relation\n+\n+        params = {\n+          course_id: 1,\n+        }\n+\n+        post :add_course, params, cas_session\n+        expect(response).to redirect_to(wishlist_path)\n+        expect(flash[:notice]).to include 'error'\n+      end\n+    end\n+  end\n+\n+  describe 'PUT #update' do\n+    it 'updates based on course id' do\n+      allow(WishlistItem).to receive(:where).and_return relation\n+      expect(wishlist_item).to receive(:update)\n+\n+      params = {\n+        course_id: 1,\n+        wishlist_item: {notify: nil},\n+      }\n+\n+      put :update, params, cas_session\n+      expect(response).to redirect_to(wishlist_path)\n+    end\n+\n+    it 'updates based on course title' do\n+      title = 'course_title'\n+\n+      allow(WishlistItem).to receive(:where).and_return relation\n+      expect(Course).to receive(:search).with(title).and_return(spy)\n+      expect(wishlist_item).to receive(:update)\n+\n+      params = {\n+        course_title: title,\n+        wishlist_item: {notify: nil},","path":"spec/controllers/wishlist_controller_spec.rb","position":91,"original_position":91,"commit_id":"3c31bb18179cf6443447e635e22a71d9ea0c08c3","original_commit_id":"3c31bb18179cf6443447e635e22a71d9ea0c08c3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Space inside { missing.<br>Space inside } missing.","created_at":"2016-03-08T05:54:14Z","updated_at":"2016-03-08T05:54:14Z","html_url":"https://github.com/hacsoc/the_jolly_advisor/pull/209#discussion_r55319337","pull_request_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209","_links":{"self":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/comments/55319337"},"html":{"href":"https://github.com/hacsoc/the_jolly_advisor/pull/209#discussion_r55319337"},"pull_request":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209"}}},"pull_request":{"url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209","id":62028070,"html_url":"https://github.com/hacsoc/the_jolly_advisor/pull/209","diff_url":"https://github.com/hacsoc/the_jolly_advisor/pull/209.diff","patch_url":"https://github.com/hacsoc/the_jolly_advisor/pull/209.patch","issue_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/209","number":209,"state":"open","locked":false,"title":"Controller tests","user":{"login":"ajm188","id":4276638,"avatar_url":"https://avatars.githubusercontent.com/u/4276638?v=3","gravatar_id":"","url":"https://api.github.com/users/ajm188","html_url":"https://github.com/ajm188","followers_url":"https://api.github.com/users/ajm188/followers","following_url":"https://api.github.com/users/ajm188/following{/other_user}","gists_url":"https://api.github.com/users/ajm188/gists{/gist_id}","starred_url":"https://api.github.com/users/ajm188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajm188/subscriptions","organizations_url":"https://api.github.com/users/ajm188/orgs","repos_url":"https://api.github.com/users/ajm188/repos","events_url":"https://api.github.com/users/ajm188/events{/privacy}","received_events_url":"https://api.github.com/users/ajm188/received_events","type":"User","site_admin":false},"body":"Add tests for some edge cases that shouldn't really be covered in feature testing.","created_at":"2016-03-08T05:54:07Z","updated_at":"2016-03-08T05:54:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d349960f7272694a4e30de0fdc60032ca1cf6dbc","assignee":{"login":"StephHippo","id":2295133,"avatar_url":"https://avatars.githubusercontent.com/u/2295133?v=3","gravatar_id":"","url":"https://api.github.com/users/StephHippo","html_url":"https://github.com/StephHippo","followers_url":"https://api.github.com/users/StephHippo/followers","following_url":"https://api.github.com/users/StephHippo/following{/other_user}","gists_url":"https://api.github.com/users/StephHippo/gists{/gist_id}","starred_url":"https://api.github.com/users/StephHippo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephHippo/subscriptions","organizations_url":"https://api.github.com/users/StephHippo/orgs","repos_url":"https://api.github.com/users/StephHippo/repos","events_url":"https://api.github.com/users/StephHippo/events{/privacy}","received_events_url":"https://api.github.com/users/StephHippo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209/commits","review_comments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209/comments","review_comment_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/209/comments","statuses_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/statuses/3c31bb18179cf6443447e635e22a71d9ea0c08c3","head":{"label":"hacsoc:controller-tests","ref":"controller-tests","sha":"3c31bb18179cf6443447e635e22a71d9ea0c08c3","user":{"login":"hacsoc","id":1041853,"avatar_url":"https://avatars.githubusercontent.com/u/1041853?v=3","gravatar_id":"","url":"https://api.github.com/users/hacsoc","html_url":"https://github.com/hacsoc","followers_url":"https://api.github.com/users/hacsoc/followers","following_url":"https://api.github.com/users/hacsoc/following{/other_user}","gists_url":"https://api.github.com/users/hacsoc/gists{/gist_id}","starred_url":"https://api.github.com/users/hacsoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacsoc/subscriptions","organizations_url":"https://api.github.com/users/hacsoc/orgs","repos_url":"https://api.github.com/users/hacsoc/repos","events_url":"https://api.github.com/users/hacsoc/events{/privacy}","received_events_url":"https://api.github.com/users/hacsoc/received_events","type":"Organization","site_admin":false},"repo":{"id":30626128,"name":"the_jolly_advisor","full_name":"hacsoc/the_jolly_advisor","owner":{"login":"hacsoc","id":1041853,"avatar_url":"https://avatars.githubusercontent.com/u/1041853?v=3","gravatar_id":"","url":"https://api.github.com/users/hacsoc","html_url":"https://github.com/hacsoc","followers_url":"https://api.github.com/users/hacsoc/followers","following_url":"https://api.github.com/users/hacsoc/following{/other_user}","gists_url":"https://api.github.com/users/hacsoc/gists{/gist_id}","starred_url":"https://api.github.com/users/hacsoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacsoc/subscriptions","organizations_url":"https://api.github.com/users/hacsoc/orgs","repos_url":"https://api.github.com/users/hacsoc/repos","events_url":"https://api.github.com/users/hacsoc/events{/privacy}","received_events_url":"https://api.github.com/users/hacsoc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hacsoc/the_jolly_advisor","description":"Get Jolly!","fork":false,"url":"https://api.github.com/repos/hacsoc/the_jolly_advisor","forks_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/forks","keys_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/teams","hooks_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/hooks","issue_events_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/events{/number}","events_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/events","assignees_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/assignees{/user}","branches_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/branches{/branch}","tags_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/tags","blobs_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/statuses/{sha}","languages_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/languages","stargazers_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/stargazers","contributors_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/contributors","subscribers_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/subscribers","subscription_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/subscription","commits_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/contents/{+path}","compare_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/merges","archive_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/downloads","issues_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues{/number}","pulls_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls{/number}","milestones_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/milestones{/number}","notifications_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/labels{/name}","releases_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/releases{/id}","deployments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/deployments","created_at":"2015-02-11T02:25:13Z","updated_at":"2016-03-05T21:13:17Z","pushed_at":"2016-03-08T05:54:07Z","git_url":"git://github.com/hacsoc/the_jolly_advisor.git","ssh_url":"git@github.com:hacsoc/the_jolly_advisor.git","clone_url":"https://github.com/hacsoc/the_jolly_advisor.git","svn_url":"https://github.com/hacsoc/the_jolly_advisor","homepage":"http://advise.case.edu/","size":630,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":37,"forks":4,"open_issues":37,"watchers":13,"default_branch":"master"}},"base":{"label":"hacsoc:master","ref":"master","sha":"72e58a17ed0ed583c6971341ef436d2f0df92aa1","user":{"login":"hacsoc","id":1041853,"avatar_url":"https://avatars.githubusercontent.com/u/1041853?v=3","gravatar_id":"","url":"https://api.github.com/users/hacsoc","html_url":"https://github.com/hacsoc","followers_url":"https://api.github.com/users/hacsoc/followers","following_url":"https://api.github.com/users/hacsoc/following{/other_user}","gists_url":"https://api.github.com/users/hacsoc/gists{/gist_id}","starred_url":"https://api.github.com/users/hacsoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacsoc/subscriptions","organizations_url":"https://api.github.com/users/hacsoc/orgs","repos_url":"https://api.github.com/users/hacsoc/repos","events_url":"https://api.github.com/users/hacsoc/events{/privacy}","received_events_url":"https://api.github.com/users/hacsoc/received_events","type":"Organization","site_admin":false},"repo":{"id":30626128,"name":"the_jolly_advisor","full_name":"hacsoc/the_jolly_advisor","owner":{"login":"hacsoc","id":1041853,"avatar_url":"https://avatars.githubusercontent.com/u/1041853?v=3","gravatar_id":"","url":"https://api.github.com/users/hacsoc","html_url":"https://github.com/hacsoc","followers_url":"https://api.github.com/users/hacsoc/followers","following_url":"https://api.github.com/users/hacsoc/following{/other_user}","gists_url":"https://api.github.com/users/hacsoc/gists{/gist_id}","starred_url":"https://api.github.com/users/hacsoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacsoc/subscriptions","organizations_url":"https://api.github.com/users/hacsoc/orgs","repos_url":"https://api.github.com/users/hacsoc/repos","events_url":"https://api.github.com/users/hacsoc/events{/privacy}","received_events_url":"https://api.github.com/users/hacsoc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hacsoc/the_jolly_advisor","description":"Get Jolly!","fork":false,"url":"https://api.github.com/repos/hacsoc/the_jolly_advisor","forks_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/forks","keys_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/teams","hooks_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/hooks","issue_events_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/events{/number}","events_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/events","assignees_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/assignees{/user}","branches_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/branches{/branch}","tags_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/tags","blobs_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/statuses/{sha}","languages_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/languages","stargazers_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/stargazers","contributors_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/contributors","subscribers_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/subscribers","subscription_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/subscription","commits_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/contents/{+path}","compare_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/merges","archive_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/downloads","issues_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues{/number}","pulls_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls{/number}","milestones_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/milestones{/number}","notifications_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/labels{/name}","releases_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/releases{/id}","deployments_url":"https://api.github.com/repos/hacsoc/the_jolly_advisor/deployments","created_at":"2015-02-11T02:25:13Z","updated_at":"2016-03-05T21:13:17Z","pushed_at":"2016-03-08T05:54:07Z","git_url":"git://github.com/hacsoc/the_jolly_advisor.git","ssh_url":"git@github.com:hacsoc/the_jolly_advisor.git","clone_url":"https://github.com/hacsoc/the_jolly_advisor.git","svn_url":"https://github.com/hacsoc/the_jolly_advisor","homepage":"http://advise.case.edu/","size":630,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":37,"forks":4,"open_issues":37,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209"},"html":{"href":"https://github.com/hacsoc/the_jolly_advisor/pull/209"},"issue":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/209"},"comments":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/issues/209/comments"},"review_comments":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209/comments"},"review_comment":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/pulls/209/commits"},"statuses":{"href":"https://api.github.com/repos/hacsoc/the_jolly_advisor/statuses/3c31bb18179cf6443447e635e22a71d9ea0c08c3"}}}}