{"action":"created","comment":{"url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/comments/33940401","id":33940401,"diff_hunk":"@@ -13,66 +13,67 @@\n \n   it \"should render the index successfully\" do\n     get :index\n-    response.should render_template(:index)\n+    expect(response).to render_template(:index)\n   end\n \n   it \"should do a 301 for numerical package ids\" do\n     get :show, :id => Package.find_by_name(\"rJython\").id.to_s\n-    response.should redirect_to(\"/packages/rJython\")\n-    response.status.should == \"301 Moved Permanently\"\n+    expect(response).to redirect_to(\"/packages/rJython\")\n+    expect(response.status).to eq(301)\n   end\n \n   it \"should do a 301 if package name differs in case from id\" do\n     get :show, :id => \"rjython\"\n-    response.should redirect_to(\"/packages/rJython\")\n-    response.status.should == \"301 Moved Permanently\"\n+    expect(response).to redirect_to(\"/packages/rJython\")\n+    expect(response.status).to eq(301)\n   end\n \n   it \"should not incorrectly 301 for package names with dots\" do\n     get :show, :id => \"data-table\"\n-    response.status.should == \"200 OK\"\n+    expect(response.status).to eq(200)\n   end\n \n   it \"should do a 404 for unknown packages\" do\n     get :show, :id => \"blabla\"\n-    response.status.should == \"404 Not Found\"\n-    response.should_not be_redirect\n+    expect(response.status).to eq(404)\n+    expect(response).to_not be_redirect\n   end\n \n-  it \"should redirect if not logged in\" do\n-    post :toggle_usage, :id => \"aaMI\"\n-    response.should be_redirect\n-  end\n+  describe 'POST toggle_usage' do\n+    context 'with a logged out user' do\n+      it \"should redirect if not logged in\" do\n+        post :toggle_usage, :id => \"aaMI\"\n+        expect(response).to be_redirect\n+      end\n+    end\n \n-  it \"should be possible to toggle package usage\" do\n-    login_as_user(:id => 1, :login => \"test\")\n+    context 'with a logged in user' do\n+      it \"should be possible to toggle package usage\" do\n+        login_as_user(:id => 1, :login => \"test\")\n \n-    pkg_mock = mock_model(Package)\n-    pkg_mock.should_receive(:update_score!)\n-    controller.instance_eval do\n-      current_user.should_receive(:toggle_usage).with(pkg_mock).and_return(true)\n-    end\n-    Package.should_receive(:find_by_param).with(\"aaMI\").and_return(pkg_mock)\n+        package = FactoryGirl.create(:package, :name => 'aaMI')\n+        controller.instance_eval do\n+          current_user.should_receive(:toggle_usage).with(package).and_return(true)","path":"spec/controllers/packages_controller_spec.rb","position":64,"original_position":64,"commit_id":"2d08474d77dfdb9f18bece2c0e481b74dbc09c8b","original_commit_id":"2d08474d77dfdb9f18bece2c0e481b74dbc09c8b","user":{"login":"boatrite","id":5781611,"avatar_url":"https://avatars.githubusercontent.com/u/5781611?v=3","gravatar_id":"","url":"https://api.github.com/users/boatrite","html_url":"https://github.com/boatrite","followers_url":"https://api.github.com/users/boatrite/followers","following_url":"https://api.github.com/users/boatrite/following{/other_user}","gists_url":"https://api.github.com/users/boatrite/gists{/gist_id}","starred_url":"https://api.github.com/users/boatrite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boatrite/subscriptions","organizations_url":"https://api.github.com/users/boatrite/orgs","repos_url":"https://api.github.com/users/boatrite/repos","events_url":"https://api.github.com/users/boatrite/events{/privacy}","received_events_url":"https://api.github.com/users/boatrite/received_events","type":"User","site_admin":false},"body":"The new syntax is `allow(current_user).to receive(:toggle_user).with(package).and_return(true)`","created_at":"2015-07-06T14:39:46Z","updated_at":"2015-07-06T14:39:46Z","html_url":"https://github.com/tenforwardconsulting/crantastic/pull/6#discussion_r33940401","pull_request_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/comments/33940401"},"html":{"href":"https://github.com/tenforwardconsulting/crantastic/pull/6#discussion_r33940401"},"pull_request":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6","id":34696479,"html_url":"https://github.com/tenforwardconsulting/crantastic/pull/6","diff_url":"https://github.com/tenforwardconsulting/crantastic/pull/6.diff","patch_url":"https://github.com/tenforwardconsulting/crantastic/pull/6.patch","issue_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/6","number":6,"state":"open","locked":false,"title":"Upgrade to Rails 3","user":{"login":"tylerritchie","id":158315,"avatar_url":"https://avatars.githubusercontent.com/u/158315?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerritchie","html_url":"https://github.com/tylerritchie","followers_url":"https://api.github.com/users/tylerritchie/followers","following_url":"https://api.github.com/users/tylerritchie/following{/other_user}","gists_url":"https://api.github.com/users/tylerritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerritchie/subscriptions","organizations_url":"https://api.github.com/users/tylerritchie/orgs","repos_url":"https://api.github.com/users/tylerritchie/repos","events_url":"https://api.github.com/users/tylerritchie/events{/privacy}","received_events_url":"https://api.github.com/users/tylerritchie/received_events","type":"User","site_admin":false},"body":"Howdy @Nonsense331 and @samsonasu (cc: @hadley) I know this is sort of a drive-by PR but I had started down the path of upgrading hadley/crantastic master before I saw this fork had activity, so I switched gears and got this all updated.\r\n\r\nI mostly fixed tests, but I also made the session secret an ENV value and pinned authlogic to sha512, and cleaned up some gems.\r\n\r\nI'm pretty sure there are all kinds of things that are still broken, but a green test suite is a much nicer place to start from.","created_at":"2015-05-05T05:00:19Z","updated_at":"2015-07-06T14:39:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"383d77a718ccc731716494609413e38328d93160","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6/commits","review_comments_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6/comments","review_comment_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/6/comments","statuses_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/statuses/2d08474d77dfdb9f18bece2c0e481b74dbc09c8b","head":{"label":"tylerritchie:rails-3","ref":"rails-3","sha":"2d08474d77dfdb9f18bece2c0e481b74dbc09c8b","user":{"login":"tylerritchie","id":158315,"avatar_url":"https://avatars.githubusercontent.com/u/158315?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerritchie","html_url":"https://github.com/tylerritchie","followers_url":"https://api.github.com/users/tylerritchie/followers","following_url":"https://api.github.com/users/tylerritchie/following{/other_user}","gists_url":"https://api.github.com/users/tylerritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerritchie/subscriptions","organizations_url":"https://api.github.com/users/tylerritchie/orgs","repos_url":"https://api.github.com/users/tylerritchie/repos","events_url":"https://api.github.com/users/tylerritchie/events{/privacy}","received_events_url":"https://api.github.com/users/tylerritchie/received_events","type":"User","site_admin":false},"repo":{"id":35078600,"name":"crantastic","full_name":"tylerritchie/crantastic","owner":{"login":"tylerritchie","id":158315,"avatar_url":"https://avatars.githubusercontent.com/u/158315?v=3","gravatar_id":"","url":"https://api.github.com/users/tylerritchie","html_url":"https://github.com/tylerritchie","followers_url":"https://api.github.com/users/tylerritchie/followers","following_url":"https://api.github.com/users/tylerritchie/following{/other_user}","gists_url":"https://api.github.com/users/tylerritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerritchie/subscriptions","organizations_url":"https://api.github.com/users/tylerritchie/orgs","repos_url":"https://api.github.com/users/tylerritchie/repos","events_url":"https://api.github.com/users/tylerritchie/events{/privacy}","received_events_url":"https://api.github.com/users/tylerritchie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tylerritchie/crantastic","description":"Source code for crantastic.org: a community site for R","fork":true,"url":"https://api.github.com/repos/tylerritchie/crantastic","forks_url":"https://api.github.com/repos/tylerritchie/crantastic/forks","keys_url":"https://api.github.com/repos/tylerritchie/crantastic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tylerritchie/crantastic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tylerritchie/crantastic/teams","hooks_url":"https://api.github.com/repos/tylerritchie/crantastic/hooks","issue_events_url":"https://api.github.com/repos/tylerritchie/crantastic/issues/events{/number}","events_url":"https://api.github.com/repos/tylerritchie/crantastic/events","assignees_url":"https://api.github.com/repos/tylerritchie/crantastic/assignees{/user}","branches_url":"https://api.github.com/repos/tylerritchie/crantastic/branches{/branch}","tags_url":"https://api.github.com/repos/tylerritchie/crantastic/tags","blobs_url":"https://api.github.com/repos/tylerritchie/crantastic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tylerritchie/crantastic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tylerritchie/crantastic/git/refs{/sha}","trees_url":"https://api.github.com/repos/tylerritchie/crantastic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tylerritchie/crantastic/statuses/{sha}","languages_url":"https://api.github.com/repos/tylerritchie/crantastic/languages","stargazers_url":"https://api.github.com/repos/tylerritchie/crantastic/stargazers","contributors_url":"https://api.github.com/repos/tylerritchie/crantastic/contributors","subscribers_url":"https://api.github.com/repos/tylerritchie/crantastic/subscribers","subscription_url":"https://api.github.com/repos/tylerritchie/crantastic/subscription","commits_url":"https://api.github.com/repos/tylerritchie/crantastic/commits{/sha}","git_commits_url":"https://api.github.com/repos/tylerritchie/crantastic/git/commits{/sha}","comments_url":"https://api.github.com/repos/tylerritchie/crantastic/comments{/number}","issue_comment_url":"https://api.github.com/repos/tylerritchie/crantastic/issues/comments{/number}","contents_url":"https://api.github.com/repos/tylerritchie/crantastic/contents/{+path}","compare_url":"https://api.github.com/repos/tylerritchie/crantastic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tylerritchie/crantastic/merges","archive_url":"https://api.github.com/repos/tylerritchie/crantastic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tylerritchie/crantastic/downloads","issues_url":"https://api.github.com/repos/tylerritchie/crantastic/issues{/number}","pulls_url":"https://api.github.com/repos/tylerritchie/crantastic/pulls{/number}","milestones_url":"https://api.github.com/repos/tylerritchie/crantastic/milestones{/number}","notifications_url":"https://api.github.com/repos/tylerritchie/crantastic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tylerritchie/crantastic/labels{/name}","releases_url":"https://api.github.com/repos/tylerritchie/crantastic/releases{/id}","created_at":"2015-05-05T04:50:48Z","updated_at":"2015-05-05T04:50:48Z","pushed_at":"2015-06-24T01:41:28Z","git_url":"git://github.com/tylerritchie/crantastic.git","ssh_url":"git@github.com:tylerritchie/crantastic.git","clone_url":"https://github.com/tylerritchie/crantastic.git","svn_url":"https://github.com/tylerritchie/crantastic","homepage":"http://crantastic.org","size":6575,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tenforwardconsulting:rails-3","ref":"rails-3","sha":"cb017f6ebaf82cb5e268c9f74c65a641f3a99997","user":{"login":"tenforwardconsulting","id":2042750,"avatar_url":"https://avatars.githubusercontent.com/u/2042750?v=3","gravatar_id":"","url":"https://api.github.com/users/tenforwardconsulting","html_url":"https://github.com/tenforwardconsulting","followers_url":"https://api.github.com/users/tenforwardconsulting/followers","following_url":"https://api.github.com/users/tenforwardconsulting/following{/other_user}","gists_url":"https://api.github.com/users/tenforwardconsulting/gists{/gist_id}","starred_url":"https://api.github.com/users/tenforwardconsulting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenforwardconsulting/subscriptions","organizations_url":"https://api.github.com/users/tenforwardconsulting/orgs","repos_url":"https://api.github.com/users/tenforwardconsulting/repos","events_url":"https://api.github.com/users/tenforwardconsulting/events{/privacy}","received_events_url":"https://api.github.com/users/tenforwardconsulting/received_events","type":"Organization","site_admin":false},"repo":{"id":21401433,"name":"crantastic","full_name":"tenforwardconsulting/crantastic","owner":{"login":"tenforwardconsulting","id":2042750,"avatar_url":"https://avatars.githubusercontent.com/u/2042750?v=3","gravatar_id":"","url":"https://api.github.com/users/tenforwardconsulting","html_url":"https://github.com/tenforwardconsulting","followers_url":"https://api.github.com/users/tenforwardconsulting/followers","following_url":"https://api.github.com/users/tenforwardconsulting/following{/other_user}","gists_url":"https://api.github.com/users/tenforwardconsulting/gists{/gist_id}","starred_url":"https://api.github.com/users/tenforwardconsulting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenforwardconsulting/subscriptions","organizations_url":"https://api.github.com/users/tenforwardconsulting/orgs","repos_url":"https://api.github.com/users/tenforwardconsulting/repos","events_url":"https://api.github.com/users/tenforwardconsulting/events{/privacy}","received_events_url":"https://api.github.com/users/tenforwardconsulting/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tenforwardconsulting/crantastic","description":"Source code for crantastic.org: a community site for R","fork":true,"url":"https://api.github.com/repos/tenforwardconsulting/crantastic","forks_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/forks","keys_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/teams","hooks_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/hooks","issue_events_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/events{/number}","events_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/events","assignees_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/assignees{/user}","branches_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/branches{/branch}","tags_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/tags","blobs_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/git/refs{/sha}","trees_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/statuses/{sha}","languages_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/languages","stargazers_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/stargazers","contributors_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/contributors","subscribers_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/subscribers","subscription_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/subscription","commits_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/commits{/sha}","git_commits_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/git/commits{/sha}","comments_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/comments{/number}","issue_comment_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/comments{/number}","contents_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/contents/{+path}","compare_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/merges","archive_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/downloads","issues_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues{/number}","pulls_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls{/number}","milestones_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/milestones{/number}","notifications_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/labels{/name}","releases_url":"https://api.github.com/repos/tenforwardconsulting/crantastic/releases{/id}","created_at":"2014-07-01T20:25:41Z","updated_at":"2014-12-02T23:04:16Z","pushed_at":"2015-06-25T16:58:45Z","git_url":"git://github.com/tenforwardconsulting/crantastic.git","ssh_url":"git@github.com:tenforwardconsulting/crantastic.git","clone_url":"https://github.com/tenforwardconsulting/crantastic.git","svn_url":"https://github.com/tenforwardconsulting/crantastic","homepage":"http://crantastic.org","size":6800,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6"},"html":{"href":"https://github.com/tenforwardconsulting/crantastic/pull/6"},"issue":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/6"},"comments":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/tenforwardconsulting/crantastic/statuses/2d08474d77dfdb9f18bece2c0e481b74dbc09c8b"}}}}