{"action":"created","comment":{"url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/comments/59079161","id":59079161,"diff_hunk":"@@ -0,0 +1,62 @@\n+require 'rails_helper'\n+require 'support/authentication_helper'\n+\n+feature 'User edits profile', %Q{\n+  As an authenticated user\n+  I want to update my information\n+  So that I can keep my profile current\n+} do\n+\n+#   Acceptance Criteria:\n+# - I must be logged in & current user\n+# - There is a link to 'Edit Profile'\n+# - The edit profile page has form for:\n+#   - First Name\n+#   - Last Name\n+#   - Date of Birth\n+# - The form requires user to provide all required information\n+# - My profile is updated once I click \"update profile\"\n+\n+  scenario 'user logs in and wants to edit profile' do\n+    user = FactoryGirl.create(:user)\n+    sign_in(user)\n+\n+    expect(page).to have_content \"Edit Profile\"\n+\n+    click_link \"Edit Profile\"\n+\n+    expect(page).to have_content \"First Name\"\n+    expect(page).to have_content \"Last Name\"\n+    expect(page).to have_content \"Date of Birth\"\n+    expect(page).to have_content \"Email\"\n+    expect(page).to have_content \"Password\"\n+  end\n+\n+  scenario 'user provides valid information' do\n+    user = FactoryGirl.create(:user)\n+    sign_in(user)\n+\n+    click_link \"Edit Profile\"\n+\n+    fill_in \"First Name\", with: user.first_name\n+    fill_in \"Last Name\", with: \"Smith\"\n+    fill_in \"Date of Birth\", with: user.dob\n+    fill_in \"Email\", with: \"test@example.com\"\n+    fill_in \"Current password\", with: user.password\n+    click_button \"Update\"\n+\n+    expect(page).to have_content \"Your account has been updated successfully.\"\n+  end\n+\n+  scenario 'user provides invalid information' do\n+    user = FactoryGirl.create(:user)\n+    sign_in(user)\n+\n+    click_link \"Edit Profile\"\n+\n+    click_button \"Update\"\n+\n+    expect(page).to have_content \"can't be blank\"\n+  end","path":"spec/features/user_edits_profile_spec.rb","position":60,"original_position":60,"commit_id":"70acc0a181379367c41218759392328eed85cd87","original_commit_id":"70acc0a181379367c41218759392328eed85cd87","user":{"login":"cmkoller","id":8670086,"avatar_url":"https://avatars.githubusercontent.com/u/8670086?v=3","gravatar_id":"","url":"https://api.github.com/users/cmkoller","html_url":"https://github.com/cmkoller","followers_url":"https://api.github.com/users/cmkoller/followers","following_url":"https://api.github.com/users/cmkoller/following{/other_user}","gists_url":"https://api.github.com/users/cmkoller/gists{/gist_id}","starred_url":"https://api.github.com/users/cmkoller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmkoller/subscriptions","organizations_url":"https://api.github.com/users/cmkoller/orgs","repos_url":"https://api.github.com/users/cmkoller/repos","events_url":"https://api.github.com/users/cmkoller/events{/privacy}","received_events_url":"https://api.github.com/users/cmkoller/received_events","type":"User","site_admin":false},"body":"I think it would be useful to have an additional test in this file that checks to see what happens when a user isn't signed in! I'd recommend using `context` blocks to specify the two different \"contexts\" like so:\r\n\r\n```\r\nfeature \"...\" do\r\n  context \"user is signed in\" do\r\n    let!(:user) { FactoryGirl.create(:user) }\r\n\r\n    before(:each) do\r\n      # this code will run before each scenario IN THIS CONTEXT\r\n      sign_in(user)\r\n    end\r\n\r\n    scenario \"...\" do\r\n      ...\r\n    end\r\n\r\n    # other scenarios\r\n  end\r\n\r\n  context \"user is not signed in\" do\r\n    scenario \"does not see Edit Profile button\" do\r\n      ...\r\n    end\r\n  end\r\nend","created_at":"2016-04-08T19:45:10Z","updated_at":"2016-04-08T19:45:10Z","html_url":"https://github.com/rowlandjl/Medication-Tracker/pull/6#discussion_r59079161","pull_request_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/comments/59079161"},"html":{"href":"https://github.com/rowlandjl/Medication-Tracker/pull/6#discussion_r59079161"},"pull_request":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6","id":65835730,"html_url":"https://github.com/rowlandjl/Medication-Tracker/pull/6","diff_url":"https://github.com/rowlandjl/Medication-Tracker/pull/6.diff","patch_url":"https://github.com/rowlandjl/Medication-Tracker/pull/6.patch","issue_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/6","number":6,"state":"open","locked":false,"title":"edit profile tests","user":{"login":"rowlandjl","id":14290075,"avatar_url":"https://avatars.githubusercontent.com/u/14290075?v=3","gravatar_id":"","url":"https://api.github.com/users/rowlandjl","html_url":"https://github.com/rowlandjl","followers_url":"https://api.github.com/users/rowlandjl/followers","following_url":"https://api.github.com/users/rowlandjl/following{/other_user}","gists_url":"https://api.github.com/users/rowlandjl/gists{/gist_id}","starred_url":"https://api.github.com/users/rowlandjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowlandjl/subscriptions","organizations_url":"https://api.github.com/users/rowlandjl/orgs","repos_url":"https://api.github.com/users/rowlandjl/repos","events_url":"https://api.github.com/users/rowlandjl/events{/privacy}","received_events_url":"https://api.github.com/users/rowlandjl/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-08T19:30:09Z","updated_at":"2016-04-08T19:45:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d0f26e425601e04b66e32c027be874a9472784e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6/commits","review_comments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6/comments","review_comment_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/6/comments","statuses_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/statuses/70acc0a181379367c41218759392328eed85cd87","head":{"label":"rowlandjl:user_edits_profile","ref":"user_edits_profile","sha":"70acc0a181379367c41218759392328eed85cd87","user":{"login":"rowlandjl","id":14290075,"avatar_url":"https://avatars.githubusercontent.com/u/14290075?v=3","gravatar_id":"","url":"https://api.github.com/users/rowlandjl","html_url":"https://github.com/rowlandjl","followers_url":"https://api.github.com/users/rowlandjl/followers","following_url":"https://api.github.com/users/rowlandjl/following{/other_user}","gists_url":"https://api.github.com/users/rowlandjl/gists{/gist_id}","starred_url":"https://api.github.com/users/rowlandjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowlandjl/subscriptions","organizations_url":"https://api.github.com/users/rowlandjl/orgs","repos_url":"https://api.github.com/users/rowlandjl/repos","events_url":"https://api.github.com/users/rowlandjl/events{/privacy}","received_events_url":"https://api.github.com/users/rowlandjl/received_events","type":"User","site_admin":false},"repo":{"id":55525937,"name":"Medication-Tracker","full_name":"rowlandjl/Medication-Tracker","owner":{"login":"rowlandjl","id":14290075,"avatar_url":"https://avatars.githubusercontent.com/u/14290075?v=3","gravatar_id":"","url":"https://api.github.com/users/rowlandjl","html_url":"https://github.com/rowlandjl","followers_url":"https://api.github.com/users/rowlandjl/followers","following_url":"https://api.github.com/users/rowlandjl/following{/other_user}","gists_url":"https://api.github.com/users/rowlandjl/gists{/gist_id}","starred_url":"https://api.github.com/users/rowlandjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowlandjl/subscriptions","organizations_url":"https://api.github.com/users/rowlandjl/orgs","repos_url":"https://api.github.com/users/rowlandjl/repos","events_url":"https://api.github.com/users/rowlandjl/events{/privacy}","received_events_url":"https://api.github.com/users/rowlandjl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rowlandjl/Medication-Tracker","description":"","fork":false,"url":"https://api.github.com/repos/rowlandjl/Medication-Tracker","forks_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/forks","keys_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/teams","hooks_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/hooks","issue_events_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/events{/number}","events_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/events","assignees_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/assignees{/user}","branches_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/branches{/branch}","tags_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/tags","blobs_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/languages","stargazers_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/stargazers","contributors_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/contributors","subscribers_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/subscribers","subscription_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/subscription","commits_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/contents/{+path}","compare_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/merges","archive_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/downloads","issues_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues{/number}","pulls_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/labels{/name}","releases_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/releases{/id}","deployments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/deployments","created_at":"2016-04-05T16:56:47Z","updated_at":"2016-04-05T17:46:39Z","pushed_at":"2016-04-08T19:31:01Z","git_url":"git://github.com/rowlandjl/Medication-Tracker.git","ssh_url":"git@github.com:rowlandjl/Medication-Tracker.git","clone_url":"https://github.com/rowlandjl/Medication-Tracker.git","svn_url":"https://github.com/rowlandjl/Medication-Tracker","homepage":null,"size":97,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"rowlandjl:user_signs_out","ref":"user_signs_out","sha":"9b35e95939a52241216e5ae7c4036372233a9cc1","user":{"login":"rowlandjl","id":14290075,"avatar_url":"https://avatars.githubusercontent.com/u/14290075?v=3","gravatar_id":"","url":"https://api.github.com/users/rowlandjl","html_url":"https://github.com/rowlandjl","followers_url":"https://api.github.com/users/rowlandjl/followers","following_url":"https://api.github.com/users/rowlandjl/following{/other_user}","gists_url":"https://api.github.com/users/rowlandjl/gists{/gist_id}","starred_url":"https://api.github.com/users/rowlandjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowlandjl/subscriptions","organizations_url":"https://api.github.com/users/rowlandjl/orgs","repos_url":"https://api.github.com/users/rowlandjl/repos","events_url":"https://api.github.com/users/rowlandjl/events{/privacy}","received_events_url":"https://api.github.com/users/rowlandjl/received_events","type":"User","site_admin":false},"repo":{"id":55525937,"name":"Medication-Tracker","full_name":"rowlandjl/Medication-Tracker","owner":{"login":"rowlandjl","id":14290075,"avatar_url":"https://avatars.githubusercontent.com/u/14290075?v=3","gravatar_id":"","url":"https://api.github.com/users/rowlandjl","html_url":"https://github.com/rowlandjl","followers_url":"https://api.github.com/users/rowlandjl/followers","following_url":"https://api.github.com/users/rowlandjl/following{/other_user}","gists_url":"https://api.github.com/users/rowlandjl/gists{/gist_id}","starred_url":"https://api.github.com/users/rowlandjl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowlandjl/subscriptions","organizations_url":"https://api.github.com/users/rowlandjl/orgs","repos_url":"https://api.github.com/users/rowlandjl/repos","events_url":"https://api.github.com/users/rowlandjl/events{/privacy}","received_events_url":"https://api.github.com/users/rowlandjl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rowlandjl/Medication-Tracker","description":"","fork":false,"url":"https://api.github.com/repos/rowlandjl/Medication-Tracker","forks_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/forks","keys_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/teams","hooks_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/hooks","issue_events_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/events{/number}","events_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/events","assignees_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/assignees{/user}","branches_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/branches{/branch}","tags_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/tags","blobs_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/refs{/sha}","trees_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/statuses/{sha}","languages_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/languages","stargazers_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/stargazers","contributors_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/contributors","subscribers_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/subscribers","subscription_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/subscription","commits_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/commits{/sha}","git_commits_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/git/commits{/sha}","comments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/comments{/number}","issue_comment_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/comments{/number}","contents_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/contents/{+path}","compare_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/merges","archive_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/downloads","issues_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues{/number}","pulls_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls{/number}","milestones_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/milestones{/number}","notifications_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/labels{/name}","releases_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/releases{/id}","deployments_url":"https://api.github.com/repos/rowlandjl/Medication-Tracker/deployments","created_at":"2016-04-05T16:56:47Z","updated_at":"2016-04-05T17:46:39Z","pushed_at":"2016-04-08T19:31:01Z","git_url":"git://github.com/rowlandjl/Medication-Tracker.git","ssh_url":"git@github.com:rowlandjl/Medication-Tracker.git","clone_url":"https://github.com/rowlandjl/Medication-Tracker.git","svn_url":"https://github.com/rowlandjl/Medication-Tracker","homepage":null,"size":97,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6"},"html":{"href":"https://github.com/rowlandjl/Medication-Tracker/pull/6"},"issue":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/6"},"comments":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/rowlandjl/Medication-Tracker/statuses/70acc0a181379367c41218759392328eed85cd87"}}}}