GitHub PullRequestReviewCommentEvent at 2014-06-06 03:43:09
Repository: stackflow
Actor: jerielabayon
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/comments/13475532","id":13475532,"diff_hunk":"@@ -0,0 +1,146 @@\n+require 'rails_helper'\n+describe QuestionsController do \n+  it { should use_before_filter(:check_login) }\n+\n+\n+  describe '#index' do\n+    it 'renders the index template' do\n+      get :index\n+      expect(response).to render_template(:index)\n+    end\n+  end\n+\n+\n+  describe '#show' do\n+\n+    let (:question) { FactoryGirl.create(:question_with_user) }\n+\n+    it 'renders the show template' do\n+      get :show, :id => question\n+      expect(response).to render_template(:show)\n+    end\n+\n+  end\n+\n+\n+  describe '#new', :signed_in => true do\n+    it 'renders the new template' do\n+      get :new\n+      expect(response).to render_template(:new)\n+    end\n+  end\n+\n+\n+  describe '#create', :signed_in => true  do\n+\n+    let(:question) { FactoryGirl.attributes_for(:question) }\n+\n+    context 'when parameters are valid' do\n+\n+      it 'shows a flash message' do\n+        post :create, :question => question\n+        expect(flash[:notice]).to_not be_nil\n+      end\n+\n+      it 'saves the question to the database' do\n+        post :create, :question => question\n+        expect(assigns[:question].persisted?).to be true\n+      end\n+\n+      it 'redirects to its question page' do\n+        post :create, :question => question\n+        expect(response).to redirect_to assigns(:question)\n+      end\n+    end\n+\n+    context 'when parameters are invalid' do\n+\n+      it 'cannot create a question' do\n+        post :create, :question => FactoryGirl.attributes_for(:invalid_question)\n+        expect(assigns[:question].persisted?).to be false\n+      end\n+\n+      it 'redirects to the new template' do\n+        post :create, :question => FactoryGirl.attributes_for(:invalid_question)\n+        expect(response).to render_template(:new)\n+      end\n+    end\n+    \n+  end\n+\n+\n+  describe '#edit', :signed_in => true do\n+\n+    context 'when logged in as the asker' do\n+\n+      let(:editquestion) { FactoryGirl.create(:question, :user => user) }\n+\n+      it 'renders the edit template' do\n+        get :edit, :id => editquestion\n+        expect(response).to render_template(:edit)\n+      end\n+    end\n+\n+    context 'when logged in as someone other than the asker' do\n+\n+      let(:editquestion) { FactoryGirl.create(:question_with_user) }\n+\n+      it 'redirects back to the question' do\n+        get :edit, :id => editquestion\n+        expect(response).to redirect_to(editquestion)\n+      end\n+    end\n+\n+  end\n+\n+\n+  describe '#update', :signed_in => true do\n+\n+    let(:question) { FactoryGirl.create(:question_with_user) }\n+    let(:edited_question) { FactoryGirl.attributes_for(:question) }\n+    \n+    context 'when attributes are valid' do\n+      it 'updates the title field' do\n+        put :update, :id => question, :question => edited_question\n+        expect(assigns[:question].title).to eq(edited_question[:title])\n+      end\n+\n+      it 'updates the entry field' do\n+        put :update, :id => question, :question => edited_question\n+        expect(assigns[:question].entry).to eq(edited_question[:entry])\n+      end\n+\n+      it 'redirects to the question page' do\n+        put :update, :id => question, :question => edited_question\n+        expect(response).to redirect_to(question)\n+      end\n+    end\n+\n+    context 'when attributes are invalid' do\n+      it 'renders the edit template' do\n+        session[:user_id] = question.user\n+        put :update, :id => question, :question => FactoryGirl.attributes_for(:invalid_question)\n+        expect(response).to render_template(:edit)\n+      end\n+    end\n+  end\n+\n+\n+  describe '#destroy' do","path":"spec/controllers/question_controller_spec.rb","position":129,"original_position":129,"commit_id":"bca6d17209d1861ce53aa8318b4901c97e6fccd3","original_commit_id":"bca6d17209d1861ce53aa8318b4901c97e6fccd3","user":{"login":"jerielabayon","id":329151,"avatar_url":"https://avatars.githubusercontent.com/u/329151?","gravatar_id":"090fbb94bea317e5f4fa1c0da747dfcb","url":"https://api.github.com/users/jerielabayon","html_url":"https://github.com/jerielabayon","followers_url":"https://api.github.com/users/jerielabayon/followers","following_url":"https://api.github.com/users/jerielabayon/following{/other_user}","gists_url":"https://api.github.com/users/jerielabayon/gists{/gist_id}","starred_url":"https://api.github.com/users/jerielabayon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerielabayon/subscriptions","organizations_url":"https://api.github.com/users/jerielabayon/orgs","repos_url":"https://api.github.com/users/jerielabayon/repos","events_url":"https://api.github.com/users/jerielabayon/events{/privacy}","received_events_url":"https://api.github.com/users/jerielabayon/received_events","type":"User","site_admin":false},"body":"There should be two contexts here. :)","created_at":"2014-06-06T03:43:09Z","updated_at":"2014-06-06T03:43:09Z","html_url":"https://github.com/fjdgallardo/stackflow/pull/3#discussion_r13475532","pull_request_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/comments/13475532"},"html":{"href":"https://github.com/fjdgallardo/stackflow/pull/3#discussion_r13475532"},"pull_request":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3","id":16416607,"html_url":"https://github.com/fjdgallardo/stackflow/pull/3","diff_url":"https://github.com/fjdgallardo/stackflow/pull/3.diff","patch_url":"https://github.com/fjdgallardo/stackflow/pull/3.patch","issue_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/3","number":3,"state":"open","title":"Tests","user":{"login":"fjdgallardo","id":1917290,"avatar_url":"https://avatars.githubusercontent.com/u/1917290?","gravatar_id":"4ad4e36cedc935073a3a7e8f8c2bb38c","url":"https://api.github.com/users/fjdgallardo","html_url":"https://github.com/fjdgallardo","followers_url":"https://api.github.com/users/fjdgallardo/followers","following_url":"https://api.github.com/users/fjdgallardo/following{/other_user}","gists_url":"https://api.github.com/users/fjdgallardo/gists{/gist_id}","starred_url":"https://api.github.com/users/fjdgallardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjdgallardo/subscriptions","organizations_url":"https://api.github.com/users/fjdgallardo/orgs","repos_url":"https://api.github.com/users/fjdgallardo/repos","events_url":"https://api.github.com/users/fjdgallardo/events{/privacy}","received_events_url":"https://api.github.com/users/fjdgallardo/received_events","type":"User","site_admin":false},"body":"Added tests for models. ","created_at":"2014-05-28T09:16:01Z","updated_at":"2014-06-06T03:43:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcd20b4abfc7451f2fb6ae73e2287c8af80af5bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3/commits","review_comments_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3/comments","review_comment_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/comments/{number}","comments_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/3/comments","statuses_url":"https://api.github.com/repos/fjdgallardo/stackflow/statuses/bca6d17209d1861ce53aa8318b4901c97e6fccd3","head":{"label":"fjdgallardo:tests","ref":"tests","sha":"bca6d17209d1861ce53aa8318b4901c97e6fccd3","user":{"login":"fjdgallardo","id":1917290,"avatar_url":"https://avatars.githubusercontent.com/u/1917290?","gravatar_id":"4ad4e36cedc935073a3a7e8f8c2bb38c","url":"https://api.github.com/users/fjdgallardo","html_url":"https://github.com/fjdgallardo","followers_url":"https://api.github.com/users/fjdgallardo/followers","following_url":"https://api.github.com/users/fjdgallardo/following{/other_user}","gists_url":"https://api.github.com/users/fjdgallardo/gists{/gist_id}","starred_url":"https://api.github.com/users/fjdgallardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjdgallardo/subscriptions","organizations_url":"https://api.github.com/users/fjdgallardo/orgs","repos_url":"https://api.github.com/users/fjdgallardo/repos","events_url":"https://api.github.com/users/fjdgallardo/events{/privacy}","received_events_url":"https://api.github.com/users/fjdgallardo/received_events","type":"User","site_admin":false},"repo":{"id":19727135,"name":"stackflow","full_name":"fjdgallardo/stackflow","owner":{"login":"fjdgallardo","id":1917290,"avatar_url":"https://avatars.githubusercontent.com/u/1917290?","gravatar_id":"4ad4e36cedc935073a3a7e8f8c2bb38c","url":"https://api.github.com/users/fjdgallardo","html_url":"https://github.com/fjdgallardo","followers_url":"https://api.github.com/users/fjdgallardo/followers","following_url":"https://api.github.com/users/fjdgallardo/following{/other_user}","gists_url":"https://api.github.com/users/fjdgallardo/gists{/gist_id}","starred_url":"https://api.github.com/users/fjdgallardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjdgallardo/subscriptions","organizations_url":"https://api.github.com/users/fjdgallardo/orgs","repos_url":"https://api.github.com/users/fjdgallardo/repos","events_url":"https://api.github.com/users/fjdgallardo/events{/privacy}","received_events_url":"https://api.github.com/users/fjdgallardo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fjdgallardo/stackflow","description":"stackoverflow","fork":false,"url":"https://api.github.com/repos/fjdgallardo/stackflow","forks_url":"https://api.github.com/repos/fjdgallardo/stackflow/forks","keys_url":"https://api.github.com/repos/fjdgallardo/stackflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fjdgallardo/stackflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fjdgallardo/stackflow/teams","hooks_url":"https://api.github.com/repos/fjdgallardo/stackflow/hooks","issue_events_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/events{/number}","events_url":"https://api.github.com/repos/fjdgallardo/stackflow/events","assignees_url":"https://api.github.com/repos/fjdgallardo/stackflow/assignees{/user}","branches_url":"https://api.github.com/repos/fjdgallardo/stackflow/branches{/branch}","tags_url":"https://api.github.com/repos/fjdgallardo/stackflow/tags","blobs_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fjdgallardo/stackflow/statuses/{sha}","languages_url":"https://api.github.com/repos/fjdgallardo/stackflow/languages","stargazers_url":"https://api.github.com/repos/fjdgallardo/stackflow/stargazers","contributors_url":"https://api.github.com/repos/fjdgallardo/stackflow/contributors","subscribers_url":"https://api.github.com/repos/fjdgallardo/stackflow/subscribers","subscription_url":"https://api.github.com/repos/fjdgallardo/stackflow/subscription","commits_url":"https://api.github.com/repos/fjdgallardo/stackflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/fjdgallardo/stackflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/comments/{number}","contents_url":"https://api.github.com/repos/fjdgallardo/stackflow/contents/{+path}","compare_url":"https://api.github.com/repos/fjdgallardo/stackflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fjdgallardo/stackflow/merges","archive_url":"https://api.github.com/repos/fjdgallardo/stackflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fjdgallardo/stackflow/downloads","issues_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues{/number}","pulls_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls{/number}","milestones_url":"https://api.github.com/repos/fjdgallardo/stackflow/milestones{/number}","notifications_url":"https://api.github.com/repos/fjdgallardo/stackflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fjdgallardo/stackflow/labels{/name}","releases_url":"https://api.github.com/repos/fjdgallardo/stackflow/releases{/id}","created_at":"2014-05-13T05:36:09Z","updated_at":"2014-06-05T10:39:57Z","pushed_at":"2014-06-05T10:40:00Z","git_url":"git://github.com/fjdgallardo/stackflow.git","ssh_url":"git@github.com:fjdgallardo/stackflow.git","clone_url":"https://github.com/fjdgallardo/stackflow.git","svn_url":"https://github.com/fjdgallardo/stackflow","homepage":null,"size":4564,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"fjdgallardo:master","ref":"master","sha":"9b382480e902c0cc0ad234bc8208f50864b83ee2","user":{"login":"fjdgallardo","id":1917290,"avatar_url":"https://avatars.githubusercontent.com/u/1917290?","gravatar_id":"4ad4e36cedc935073a3a7e8f8c2bb38c","url":"https://api.github.com/users/fjdgallardo","html_url":"https://github.com/fjdgallardo","followers_url":"https://api.github.com/users/fjdgallardo/followers","following_url":"https://api.github.com/users/fjdgallardo/following{/other_user}","gists_url":"https://api.github.com/users/fjdgallardo/gists{/gist_id}","starred_url":"https://api.github.com/users/fjdgallardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjdgallardo/subscriptions","organizations_url":"https://api.github.com/users/fjdgallardo/orgs","repos_url":"https://api.github.com/users/fjdgallardo/repos","events_url":"https://api.github.com/users/fjdgallardo/events{/privacy}","received_events_url":"https://api.github.com/users/fjdgallardo/received_events","type":"User","site_admin":false},"repo":{"id":19727135,"name":"stackflow","full_name":"fjdgallardo/stackflow","owner":{"login":"fjdgallardo","id":1917290,"avatar_url":"https://avatars.githubusercontent.com/u/1917290?","gravatar_id":"4ad4e36cedc935073a3a7e8f8c2bb38c","url":"https://api.github.com/users/fjdgallardo","html_url":"https://github.com/fjdgallardo","followers_url":"https://api.github.com/users/fjdgallardo/followers","following_url":"https://api.github.com/users/fjdgallardo/following{/other_user}","gists_url":"https://api.github.com/users/fjdgallardo/gists{/gist_id}","starred_url":"https://api.github.com/users/fjdgallardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjdgallardo/subscriptions","organizations_url":"https://api.github.com/users/fjdgallardo/orgs","repos_url":"https://api.github.com/users/fjdgallardo/repos","events_url":"https://api.github.com/users/fjdgallardo/events{/privacy}","received_events_url":"https://api.github.com/users/fjdgallardo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fjdgallardo/stackflow","description":"stackoverflow","fork":false,"url":"https://api.github.com/repos/fjdgallardo/stackflow","forks_url":"https://api.github.com/repos/fjdgallardo/stackflow/forks","keys_url":"https://api.github.com/repos/fjdgallardo/stackflow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fjdgallardo/stackflow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fjdgallardo/stackflow/teams","hooks_url":"https://api.github.com/repos/fjdgallardo/stackflow/hooks","issue_events_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/events{/number}","events_url":"https://api.github.com/repos/fjdgallardo/stackflow/events","assignees_url":"https://api.github.com/repos/fjdgallardo/stackflow/assignees{/user}","branches_url":"https://api.github.com/repos/fjdgallardo/stackflow/branches{/branch}","tags_url":"https://api.github.com/repos/fjdgallardo/stackflow/tags","blobs_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/refs{/sha}","trees_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fjdgallardo/stackflow/statuses/{sha}","languages_url":"https://api.github.com/repos/fjdgallardo/stackflow/languages","stargazers_url":"https://api.github.com/repos/fjdgallardo/stackflow/stargazers","contributors_url":"https://api.github.com/repos/fjdgallardo/stackflow/contributors","subscribers_url":"https://api.github.com/repos/fjdgallardo/stackflow/subscribers","subscription_url":"https://api.github.com/repos/fjdgallardo/stackflow/subscription","commits_url":"https://api.github.com/repos/fjdgallardo/stackflow/commits{/sha}","git_commits_url":"https://api.github.com/repos/fjdgallardo/stackflow/git/commits{/sha}","comments_url":"https://api.github.com/repos/fjdgallardo/stackflow/comments{/number}","issue_comment_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues/comments/{number}","contents_url":"https://api.github.com/repos/fjdgallardo/stackflow/contents/{+path}","compare_url":"https://api.github.com/repos/fjdgallardo/stackflow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fjdgallardo/stackflow/merges","archive_url":"https://api.github.com/repos/fjdgallardo/stackflow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fjdgallardo/stackflow/downloads","issues_url":"https://api.github.com/repos/fjdgallardo/stackflow/issues{/number}","pulls_url":"https://api.github.com/repos/fjdgallardo/stackflow/pulls{/number}","milestones_url":"https://api.github.com/repos/fjdgallardo/stackflow/milestones{/number}","notifications_url":"https://api.github.com/repos/fjdgallardo/stackflow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fjdgallardo/stackflow/labels{/name}","releases_url":"https://api.github.com/repos/fjdgallardo/stackflow/releases{/id}","created_at":"2014-05-13T05:36:09Z","updated_at":"2014-06-05T10:39:57Z","pushed_at":"2014-06-05T10:40:00Z","git_url":"git://github.com/fjdgallardo/stackflow.git","ssh_url":"git@github.com:fjdgallardo/stackflow.git","clone_url":"https://github.com/fjdgallardo/stackflow.git","svn_url":"https://github.com/fjdgallardo/stackflow","homepage":null,"size":4564,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3"},"html":{"href":"https://github.com/fjdgallardo/stackflow/pull/3"},"issue":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/issues/3"},"comments":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/fjdgallardo/stackflow/statuses/bca6d17209d1861ce53aa8318b4901c97e6fccd3"}}}}