{"action":"created","comment":{"url":"https://api.github.com/repos/IT61/it61-rails/pulls/comments/50415378","id":50415378,"diff_hunk":"@@ -0,0 +1,93 @@\n+require 'spec_helper'\n+\n+describe PasswordResetsController do\n+  describe 'POST create' do\n+    before { ActionMailer::Base.deliveries.clear }\n+    let(:user_attrs) { FactoryGirl.attributes_for(:user) }\n+\n+    context 'not existing email address' do\n+      it \"'doesn't send an email'\" do\n+        post :create, email: 'notexisting@mail.com'\n+        expect(ActionMailer::Base.deliveries.count).to eq(0)\n+      end\n+    end\n+\n+    context 'user with a valid email' do\n+      let(:user) { FactoryGirl.create :user }\n+\n+      it 'sends an email with instructions' do\n+        post :create, email: user.email\n+        expect(ActionMailer::Base.deliveries.count).to eq(1)\n+      end\n+    end\n+\n+    it 'redirects to the root url' do\n+      post :create, email: user_attrs[:email]\n+      expect(response).to redirect_to(root_url)\n+    end\n+\n+    it 'sets a flash message' do\n+      post :create, email: user_attrs[:email]\n+      expect(flash.empty?).not_to be\n+    end\n+  end\n+\n+  describe 'GET edit' do\n+    context 'valid token' do\n+      let(:user) { FactoryGirl.create :user, :with_reset_password_token }\n+\n+      it 'renders the #edit view' do\n+        get :edit, id: user.reset_password_token\n+        expect(response).to render_template(:edit)\n+      end\n+    end\n+\n+    context 'invalid token' do\n+      it 'redirects to the root url' do\n+        invalid_token = 'invalid token'\n+        get :edit, id: invalid_token\n+        expect(response).to redirect_to(root_url)\n+      end\n+    end\n+  end\n+\n+  describe 'PUT update' do\n+    let(:user) { FactoryGirl.create :user, :with_reset_password_token }","path":"spec/controllers/password_resets_controller_spec.rb","position":55,"original_position":55,"commit_id":"0bff0aa9505414e9992a1c7fd1a3f4061829cdd5","original_commit_id":"0bff0aa9505414e9992a1c7fd1a3f4061829cdd5","user":{"login":"kovalevsky","id":203871,"avatar_url":"https://avatars.githubusercontent.com/u/203871?v=3","gravatar_id":"","url":"https://api.github.com/users/kovalevsky","html_url":"https://github.com/kovalevsky","followers_url":"https://api.github.com/users/kovalevsky/followers","following_url":"https://api.github.com/users/kovalevsky/following{/other_user}","gists_url":"https://api.github.com/users/kovalevsky/gists{/gist_id}","starred_url":"https://api.github.com/users/kovalevsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovalevsky/subscriptions","organizations_url":"https://api.github.com/users/kovalevsky/orgs","repos_url":"https://api.github.com/users/kovalevsky/repos","events_url":"https://api.github.com/users/kovalevsky/events{/privacy}","received_events_url":"https://api.github.com/users/kovalevsky/received_events","type":"User","site_admin":false},"body":"`FactoryGirl` можно опускать и писать сразу `create(:user, :with_reset_password_token)`","created_at":"2016-01-21T15:32:28Z","updated_at":"2016-01-21T15:32:28Z","html_url":"https://github.com/IT61/it61-rails/pull/79#discussion_r50415378","pull_request_url":"https://api.github.com/repos/IT61/it61-rails/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/comments/50415378"},"html":{"href":"https://github.com/IT61/it61-rails/pull/79#discussion_r50415378"},"pull_request":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/IT61/it61-rails/pulls/79","id":56724334,"html_url":"https://github.com/IT61/it61-rails/pull/79","diff_url":"https://github.com/IT61/it61-rails/pull/79.diff","patch_url":"https://github.com/IT61/it61-rails/pull/79.patch","issue_url":"https://api.github.com/repos/IT61/it61-rails/issues/79","number":79,"state":"open","locked":false,"title":"Reset password","user":{"login":"pplevako","id":1630962,"avatar_url":"https://avatars.githubusercontent.com/u/1630962?v=3","gravatar_id":"","url":"https://api.github.com/users/pplevako","html_url":"https://github.com/pplevako","followers_url":"https://api.github.com/users/pplevako/followers","following_url":"https://api.github.com/users/pplevako/following{/other_user}","gists_url":"https://api.github.com/users/pplevako/gists{/gist_id}","starred_url":"https://api.github.com/users/pplevako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pplevako/subscriptions","organizations_url":"https://api.github.com/users/pplevako/orgs","repos_url":"https://api.github.com/users/pplevako/repos","events_url":"https://api.github.com/users/pplevako/events{/privacy}","received_events_url":"https://api.github.com/users/pplevako/received_events","type":"User","site_admin":false},"body":"С тестами для \r\n- мейлера UserMailer\r\n- контроллера PasswordResetsController","created_at":"2016-01-21T09:38:15Z","updated_at":"2016-01-21T15:32:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64f3253cf953cd0ab7e96478b1098f4e16a36b4e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/IT61/it61-rails/pulls/79/commits","review_comments_url":"https://api.github.com/repos/IT61/it61-rails/pulls/79/comments","review_comment_url":"https://api.github.com/repos/IT61/it61-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IT61/it61-rails/issues/79/comments","statuses_url":"https://api.github.com/repos/IT61/it61-rails/statuses/0bff0aa9505414e9992a1c7fd1a3f4061829cdd5","head":{"label":"pplevako:reset-password","ref":"reset-password","sha":"0bff0aa9505414e9992a1c7fd1a3f4061829cdd5","user":{"login":"pplevako","id":1630962,"avatar_url":"https://avatars.githubusercontent.com/u/1630962?v=3","gravatar_id":"","url":"https://api.github.com/users/pplevako","html_url":"https://github.com/pplevako","followers_url":"https://api.github.com/users/pplevako/followers","following_url":"https://api.github.com/users/pplevako/following{/other_user}","gists_url":"https://api.github.com/users/pplevako/gists{/gist_id}","starred_url":"https://api.github.com/users/pplevako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pplevako/subscriptions","organizations_url":"https://api.github.com/users/pplevako/orgs","repos_url":"https://api.github.com/users/pplevako/repos","events_url":"https://api.github.com/users/pplevako/events{/privacy}","received_events_url":"https://api.github.com/users/pplevako/received_events","type":"User","site_admin":false},"repo":{"id":46730057,"name":"it61-rails","full_name":"pplevako/it61-rails","owner":{"login":"pplevako","id":1630962,"avatar_url":"https://avatars.githubusercontent.com/u/1630962?v=3","gravatar_id":"","url":"https://api.github.com/users/pplevako","html_url":"https://github.com/pplevako","followers_url":"https://api.github.com/users/pplevako/followers","following_url":"https://api.github.com/users/pplevako/following{/other_user}","gists_url":"https://api.github.com/users/pplevako/gists{/gist_id}","starred_url":"https://api.github.com/users/pplevako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pplevako/subscriptions","organizations_url":"https://api.github.com/users/pplevako/orgs","repos_url":"https://api.github.com/users/pplevako/repos","events_url":"https://api.github.com/users/pplevako/events{/privacy}","received_events_url":"https://api.github.com/users/pplevako/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pplevako/it61-rails","description":"Сайт Ростовского IT-сообщества","fork":true,"url":"https://api.github.com/repos/pplevako/it61-rails","forks_url":"https://api.github.com/repos/pplevako/it61-rails/forks","keys_url":"https://api.github.com/repos/pplevako/it61-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pplevako/it61-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pplevako/it61-rails/teams","hooks_url":"https://api.github.com/repos/pplevako/it61-rails/hooks","issue_events_url":"https://api.github.com/repos/pplevako/it61-rails/issues/events{/number}","events_url":"https://api.github.com/repos/pplevako/it61-rails/events","assignees_url":"https://api.github.com/repos/pplevako/it61-rails/assignees{/user}","branches_url":"https://api.github.com/repos/pplevako/it61-rails/branches{/branch}","tags_url":"https://api.github.com/repos/pplevako/it61-rails/tags","blobs_url":"https://api.github.com/repos/pplevako/it61-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pplevako/it61-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pplevako/it61-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/pplevako/it61-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pplevako/it61-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/pplevako/it61-rails/languages","stargazers_url":"https://api.github.com/repos/pplevako/it61-rails/stargazers","contributors_url":"https://api.github.com/repos/pplevako/it61-rails/contributors","subscribers_url":"https://api.github.com/repos/pplevako/it61-rails/subscribers","subscription_url":"https://api.github.com/repos/pplevako/it61-rails/subscription","commits_url":"https://api.github.com/repos/pplevako/it61-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/pplevako/it61-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/pplevako/it61-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/pplevako/it61-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/pplevako/it61-rails/contents/{+path}","compare_url":"https://api.github.com/repos/pplevako/it61-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pplevako/it61-rails/merges","archive_url":"https://api.github.com/repos/pplevako/it61-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pplevako/it61-rails/downloads","issues_url":"https://api.github.com/repos/pplevako/it61-rails/issues{/number}","pulls_url":"https://api.github.com/repos/pplevako/it61-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/pplevako/it61-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/pplevako/it61-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pplevako/it61-rails/labels{/name}","releases_url":"https://api.github.com/repos/pplevako/it61-rails/releases{/id}","created_at":"2015-11-23T15:40:54Z","updated_at":"2015-11-23T15:40:55Z","pushed_at":"2016-01-20T17:28:28Z","git_url":"git://github.com/pplevako/it61-rails.git","ssh_url":"git@github.com:pplevako/it61-rails.git","clone_url":"https://github.com/pplevako/it61-rails.git","svn_url":"https://github.com/pplevako/it61-rails","homepage":"www.it61.info","size":1223,"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":"master"}},"base":{"label":"IT61:master","ref":"master","sha":"97fa6d4b6ebf0a591eab297318b05bcbd9e06562","user":{"login":"IT61","id":5947793,"avatar_url":"https://avatars.githubusercontent.com/u/5947793?v=3","gravatar_id":"","url":"https://api.github.com/users/IT61","html_url":"https://github.com/IT61","followers_url":"https://api.github.com/users/IT61/followers","following_url":"https://api.github.com/users/IT61/following{/other_user}","gists_url":"https://api.github.com/users/IT61/gists{/gist_id}","starred_url":"https://api.github.com/users/IT61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IT61/subscriptions","organizations_url":"https://api.github.com/users/IT61/orgs","repos_url":"https://api.github.com/users/IT61/repos","events_url":"https://api.github.com/users/IT61/events{/privacy}","received_events_url":"https://api.github.com/users/IT61/received_events","type":"Organization","site_admin":false},"repo":{"id":20156805,"name":"it61-rails","full_name":"IT61/it61-rails","owner":{"login":"IT61","id":5947793,"avatar_url":"https://avatars.githubusercontent.com/u/5947793?v=3","gravatar_id":"","url":"https://api.github.com/users/IT61","html_url":"https://github.com/IT61","followers_url":"https://api.github.com/users/IT61/followers","following_url":"https://api.github.com/users/IT61/following{/other_user}","gists_url":"https://api.github.com/users/IT61/gists{/gist_id}","starred_url":"https://api.github.com/users/IT61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IT61/subscriptions","organizations_url":"https://api.github.com/users/IT61/orgs","repos_url":"https://api.github.com/users/IT61/repos","events_url":"https://api.github.com/users/IT61/events{/privacy}","received_events_url":"https://api.github.com/users/IT61/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IT61/it61-rails","description":"Сайт Ростовского IT-сообщества","fork":false,"url":"https://api.github.com/repos/IT61/it61-rails","forks_url":"https://api.github.com/repos/IT61/it61-rails/forks","keys_url":"https://api.github.com/repos/IT61/it61-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IT61/it61-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IT61/it61-rails/teams","hooks_url":"https://api.github.com/repos/IT61/it61-rails/hooks","issue_events_url":"https://api.github.com/repos/IT61/it61-rails/issues/events{/number}","events_url":"https://api.github.com/repos/IT61/it61-rails/events","assignees_url":"https://api.github.com/repos/IT61/it61-rails/assignees{/user}","branches_url":"https://api.github.com/repos/IT61/it61-rails/branches{/branch}","tags_url":"https://api.github.com/repos/IT61/it61-rails/tags","blobs_url":"https://api.github.com/repos/IT61/it61-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IT61/it61-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IT61/it61-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/IT61/it61-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IT61/it61-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/IT61/it61-rails/languages","stargazers_url":"https://api.github.com/repos/IT61/it61-rails/stargazers","contributors_url":"https://api.github.com/repos/IT61/it61-rails/contributors","subscribers_url":"https://api.github.com/repos/IT61/it61-rails/subscribers","subscription_url":"https://api.github.com/repos/IT61/it61-rails/subscription","commits_url":"https://api.github.com/repos/IT61/it61-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/IT61/it61-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/IT61/it61-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/IT61/it61-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/IT61/it61-rails/contents/{+path}","compare_url":"https://api.github.com/repos/IT61/it61-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IT61/it61-rails/merges","archive_url":"https://api.github.com/repos/IT61/it61-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IT61/it61-rails/downloads","issues_url":"https://api.github.com/repos/IT61/it61-rails/issues{/number}","pulls_url":"https://api.github.com/repos/IT61/it61-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/IT61/it61-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/IT61/it61-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IT61/it61-rails/labels{/name}","releases_url":"https://api.github.com/repos/IT61/it61-rails/releases{/id}","created_at":"2014-05-25T14:42:22Z","updated_at":"2016-01-15T11:34:19Z","pushed_at":"2016-01-21T09:38:16Z","git_url":"git://github.com/IT61/it61-rails.git","ssh_url":"git@github.com:IT61/it61-rails.git","clone_url":"https://github.com/IT61/it61-rails.git","svn_url":"https://github.com/IT61/it61-rails","homepage":"www.it61.info","size":1228,"stargazers_count":21,"watchers_count":21,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":15,"forks":16,"open_issues":15,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/79"},"html":{"href":"https://github.com/IT61/it61-rails/pull/79"},"issue":{"href":"https://api.github.com/repos/IT61/it61-rails/issues/79"},"comments":{"href":"https://api.github.com/repos/IT61/it61-rails/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IT61/it61-rails/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/IT61/it61-rails/statuses/0bff0aa9505414e9992a1c7fd1a3f4061829cdd5"}}}}