{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/osra/pulls/comments/22904363","id":22904363,"diff_hunk":"@@ -31,4 +31,74 @@ def foobar_action\n     expect(response).to render_template 'index'\n   end\n \n+  describe '#edit and #update' do\n+    before :each do\n+      @old_user = FactoryGirl.build_stubbed(:user)\n+      expect(User).to receive(:find).and_return(@old_user)\n+    end    \n+\n+    specify 'editing renders the edit view' do\n+      get :edit, id: @old_user.id\n+      expect(response).to render_template 'edit'\n+    end\n+\n+    it 'handles invalid updates' do\n+      allow(@old_user).to receive(:save).and_return(false)\n+      post :update, id: @old_user.id, user: { email: 'some email address'}\n+      expect(response).to render_template 'edit'\n+      new_user = controller.instance_variable_get(:@user)\n+      expect(new_user[:email]).to eq 'some email address'\n+      expect(flash[:success]).to be_nil\n+    end\n+\n+    it 'handles valid updates' do\n+      allow(@old_user).to receive(:save).and_return(true)\n+      post :update, id: @old_user.id, user: { email: 'some email address'}\n+      expect(response).to redirect_to(hq_user_path(@old_user))\n+      expect(flash[:success]).to_not be_nil\n+    end\n+\n+  end\n+\n+  describe '#new' do\n+    \n+    before :each do\n+      @new_user = FactoryGirl.build_stubbed(:user, user_name: nil, email: nil)","path":"spec/controllers/hq/users_controller_spec.rb","position":45,"original_position":45,"commit_id":"b196d052162597d0bdc4e1c89bab6e556a3a014b","original_commit_id":"b196d052162597d0bdc4e1c89bab6e556a3a014b","user":{"login":"PurityControl","id":7509180,"avatar_url":"https://avatars.githubusercontent.com/u/7509180?v=3","gravatar_id":"","url":"https://api.github.com/users/PurityControl","html_url":"https://github.com/PurityControl","followers_url":"https://api.github.com/users/PurityControl/followers","following_url":"https://api.github.com/users/PurityControl/following{/other_user}","gists_url":"https://api.github.com/users/PurityControl/gists{/gist_id}","starred_url":"https://api.github.com/users/PurityControl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PurityControl/subscriptions","organizations_url":"https://api.github.com/users/PurityControl/orgs","repos_url":"https://api.github.com/users/PurityControl/repos","events_url":"https://api.github.com/users/PurityControl/events{/privacy}","received_events_url":"https://api.github.com/users/PurityControl/received_events","type":"User","site_admin":false},"body":"Why factory girl for a new user?","created_at":"2015-01-13T23:18:53Z","updated_at":"2015-01-13T23:18:53Z","html_url":"https://github.com/AgileVentures/osra/pull/283#discussion_r22904363","pull_request_url":"https://api.github.com/repos/AgileVentures/osra/pulls/283","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/comments/22904363"},"html":{"href":"https://github.com/AgileVentures/osra/pull/283#discussion_r22904363"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/osra/pulls/283","id":27300184,"html_url":"https://github.com/AgileVentures/osra/pull/283","diff_url":"https://github.com/AgileVentures/osra/pull/283.diff","patch_url":"https://github.com/AgileVentures/osra/pull/283.patch","issue_url":"https://api.github.com/repos/AgileVentures/osra/issues/283","number":283,"state":"open","locked":false,"title":"Osra333 users new and create","user":{"login":"robbiejackson","id":5058681,"avatar_url":"https://avatars.githubusercontent.com/u/5058681?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiejackson","html_url":"https://github.com/robbiejackson","followers_url":"https://api.github.com/users/robbiejackson/followers","following_url":"https://api.github.com/users/robbiejackson/following{/other_user}","gists_url":"https://api.github.com/users/robbiejackson/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiejackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiejackson/subscriptions","organizations_url":"https://api.github.com/users/robbiejackson/orgs","repos_url":"https://api.github.com/users/robbiejackson/repos","events_url":"https://api.github.com/users/robbiejackson/events{/privacy}","received_events_url":"https://api.github.com/users/robbiejackson/received_events","type":"User","site_admin":false},"body":"Users controller changed to support #new and #create.\r\nAssociated views and test specs created.","created_at":"2015-01-13T20:05:30Z","updated_at":"2015-01-13T23:18:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9acba02e13d6b5a72926bcb1826b0caacfd08a60","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/osra/pulls/283/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/osra/pulls/283/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/osra/pulls/comments/{number}","comments_url":"https://api.github.com/repos/AgileVentures/osra/issues/283/comments","statuses_url":"https://api.github.com/repos/AgileVentures/osra/statuses/b196d052162597d0bdc4e1c89bab6e556a3a014b","head":{"label":"robbiejackson:osra333-Users-new-and-create","ref":"osra333-Users-new-and-create","sha":"b196d052162597d0bdc4e1c89bab6e556a3a014b","user":{"login":"robbiejackson","id":5058681,"avatar_url":"https://avatars.githubusercontent.com/u/5058681?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiejackson","html_url":"https://github.com/robbiejackson","followers_url":"https://api.github.com/users/robbiejackson/followers","following_url":"https://api.github.com/users/robbiejackson/following{/other_user}","gists_url":"https://api.github.com/users/robbiejackson/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiejackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiejackson/subscriptions","organizations_url":"https://api.github.com/users/robbiejackson/orgs","repos_url":"https://api.github.com/users/robbiejackson/repos","events_url":"https://api.github.com/users/robbiejackson/events{/privacy}","received_events_url":"https://api.github.com/users/robbiejackson/received_events","type":"User","site_admin":false},"repo":{"id":27240806,"name":"osra","full_name":"robbiejackson/osra","owner":{"login":"robbiejackson","id":5058681,"avatar_url":"https://avatars.githubusercontent.com/u/5058681?v=3","gravatar_id":"","url":"https://api.github.com/users/robbiejackson","html_url":"https://github.com/robbiejackson","followers_url":"https://api.github.com/users/robbiejackson/followers","following_url":"https://api.github.com/users/robbiejackson/following{/other_user}","gists_url":"https://api.github.com/users/robbiejackson/gists{/gist_id}","starred_url":"https://api.github.com/users/robbiejackson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbiejackson/subscriptions","organizations_url":"https://api.github.com/users/robbiejackson/orgs","repos_url":"https://api.github.com/users/robbiejackson/repos","events_url":"https://api.github.com/users/robbiejackson/events{/privacy}","received_events_url":"https://api.github.com/users/robbiejackson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robbiejackson/osra","description":"Sponsor orphans in Syria & insure basic life & education requirements for Syrian children","fork":true,"url":"https://api.github.com/repos/robbiejackson/osra","forks_url":"https://api.github.com/repos/robbiejackson/osra/forks","keys_url":"https://api.github.com/repos/robbiejackson/osra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robbiejackson/osra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robbiejackson/osra/teams","hooks_url":"https://api.github.com/repos/robbiejackson/osra/hooks","issue_events_url":"https://api.github.com/repos/robbiejackson/osra/issues/events{/number}","events_url":"https://api.github.com/repos/robbiejackson/osra/events","assignees_url":"https://api.github.com/repos/robbiejackson/osra/assignees{/user}","branches_url":"https://api.github.com/repos/robbiejackson/osra/branches{/branch}","tags_url":"https://api.github.com/repos/robbiejackson/osra/tags","blobs_url":"https://api.github.com/repos/robbiejackson/osra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robbiejackson/osra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robbiejackson/osra/git/refs{/sha}","trees_url":"https://api.github.com/repos/robbiejackson/osra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robbiejackson/osra/statuses/{sha}","languages_url":"https://api.github.com/repos/robbiejackson/osra/languages","stargazers_url":"https://api.github.com/repos/robbiejackson/osra/stargazers","contributors_url":"https://api.github.com/repos/robbiejackson/osra/contributors","subscribers_url":"https://api.github.com/repos/robbiejackson/osra/subscribers","subscription_url":"https://api.github.com/repos/robbiejackson/osra/subscription","commits_url":"https://api.github.com/repos/robbiejackson/osra/commits{/sha}","git_commits_url":"https://api.github.com/repos/robbiejackson/osra/git/commits{/sha}","comments_url":"https://api.github.com/repos/robbiejackson/osra/comments{/number}","issue_comment_url":"https://api.github.com/repos/robbiejackson/osra/issues/comments/{number}","contents_url":"https://api.github.com/repos/robbiejackson/osra/contents/{+path}","compare_url":"https://api.github.com/repos/robbiejackson/osra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robbiejackson/osra/merges","archive_url":"https://api.github.com/repos/robbiejackson/osra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robbiejackson/osra/downloads","issues_url":"https://api.github.com/repos/robbiejackson/osra/issues{/number}","pulls_url":"https://api.github.com/repos/robbiejackson/osra/pulls{/number}","milestones_url":"https://api.github.com/repos/robbiejackson/osra/milestones{/number}","notifications_url":"https://api.github.com/repos/robbiejackson/osra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robbiejackson/osra/labels{/name}","releases_url":"https://api.github.com/repos/robbiejackson/osra/releases{/id}","created_at":"2014-11-27T20:45:12Z","updated_at":"2015-01-05T15:58:13Z","pushed_at":"2015-01-13T20:03:29Z","git_url":"git://github.com/robbiejackson/osra.git","ssh_url":"git@github.com:robbiejackson/osra.git","clone_url":"https://github.com/robbiejackson/osra.git","svn_url":"https://github.com/robbiejackson/osra","homepage":null,"size":1856,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"AgileVentures:develop","ref":"develop","sha":"6a81db105754689de2b33bd40066938385a0844d","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":18855271,"name":"osra","full_name":"AgileVentures/osra","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/osra","description":"Sponsor orphans in Syria & ensure basic life & education requirements for Syrian children","fork":false,"url":"https://api.github.com/repos/AgileVentures/osra","forks_url":"https://api.github.com/repos/AgileVentures/osra/forks","keys_url":"https://api.github.com/repos/AgileVentures/osra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/osra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/osra/teams","hooks_url":"https://api.github.com/repos/AgileVentures/osra/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/osra/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/osra/events","assignees_url":"https://api.github.com/repos/AgileVentures/osra/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/osra/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/osra/tags","blobs_url":"https://api.github.com/repos/AgileVentures/osra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/osra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/osra/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/osra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/osra/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/osra/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/osra/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/osra/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/osra/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/osra/subscription","commits_url":"https://api.github.com/repos/AgileVentures/osra/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/osra/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/osra/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/osra/issues/comments/{number}","contents_url":"https://api.github.com/repos/AgileVentures/osra/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/osra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/osra/merges","archive_url":"https://api.github.com/repos/AgileVentures/osra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/osra/downloads","issues_url":"https://api.github.com/repos/AgileVentures/osra/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/osra/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/osra/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/osra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/osra/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/osra/releases{/id}","created_at":"2014-04-16T20:43:09Z","updated_at":"2015-01-13T11:54:33Z","pushed_at":"2015-01-13T11:54:33Z","git_url":"git://github.com/AgileVentures/osra.git","ssh_url":"git@github.com:AgileVentures/osra.git","clone_url":"https://github.com/AgileVentures/osra.git","svn_url":"https://github.com/AgileVentures/osra","homepage":"","size":4481,"stargazers_count":9,"watchers_count":9,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":11,"forks":28,"open_issues":11,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/283"},"html":{"href":"https://github.com/AgileVentures/osra/pull/283"},"issue":{"href":"https://api.github.com/repos/AgileVentures/osra/issues/283"},"comments":{"href":"https://api.github.com/repos/AgileVentures/osra/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/osra/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/osra/statuses/b196d052162597d0bdc4e1c89bab6e556a3a014b"}}}}