{"action":"created","comment":{"url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/comments/40180524","id":40180524,"diff_hunk":"@@ -2,59 +2,45 @@\n \n RSpec.describe User, type: :model do\n   it \"is valid first_name, last_name, email\" do\n-    user = User.new(\n-      first_name: Faker::Name.first_name,\n-      last_name: Faker::Name.last_name,\n-      email: Faker::Internet.email\n-      )\n+    user = FactoryGirl.new(:user)\n     expect(user).to be_valid\n   end\n \n   # Defaul expect(user).to have(1).errors_on(:first_name) has been removed from Rspec 2.9\n   # And now, Rspec 3.0, if you want use it, add gem rspec-collection_matchers to Gemfile\n   it \"is invalid without a first_name\" do\n-    user = User.new(first_name: nil)\n+    user = FactoryGirl.new(:user, first_name: nil)\n     expect(user).to have(1).errors_on(:first_name)\n   end\n \n   it \"is invalid without a last_name\" do\n-    user = User.new(last_name: nil)\n+    user = FactoryGirl.new(:user, last_name: nil)\n     expect(user).to have(1).errors_on(:last_name)\n   end\n \n   it \"is invalid without a email\" do\n-    user = User.new(email: nil)\n+    user = FactoryGirl.new(:user, email: nil)\n     expect(user).to have(2).errors_on(:email)\n   end\n   \n   it \"is invalid email format\" do\n-    user = User.new(email: \"abc\")\n+    user = FactoryGirl.new(:user, email: \"abc\")\n     expect(user).to have(1).errors_on(:email)\n   end\n \n   it \"is invalid without a duplicate email\" do\n-    User.create(\n-      first_name: Faker::Name.first_name,\n-      last_name: Faker::Name.last_name,\n-      email: \"duonghienan.dha@gmail.com\" \n-      )\n-\n-    user = User.new(\n-      first_name: Faker::Name.first_name,\n-      last_name: Faker::Name.last_name,\n-      email: \"duonghienan.dha@gmail.com\" \n-      )\n+    FactoryGirl.create(:user, email: \"duonghienan.dha@gmail.com\")\n+    user = FactoryGirl.create(:user, email: \"duonghienan.dha@gmail.com\")\n \n     expect(user).to have(1).errors_on(:email)\n   end\n   \n   it \"return full_name as a string\" do\n-    user = User.new(\n-      first_name: 'An',\n-      last_name: 'Duong Hien',\n-      email: Faker::Internet.email \n-      )\n-\n+    user = FactoryGirl.create(\n+      :user, \n+      first_name: \"first_name\", ","path":"spec/models/user_spec.rb","position":66,"original_position":66,"commit_id":"30cf2321bb21f15ef2382321525201d1a8e45fd5","original_commit_id":"30cf2321bb21f15ef2382321525201d1a8e45fd5","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Trailing whitespace detected.","created_at":"2015-09-23T08:34:22Z","updated_at":"2015-09-23T08:34:22Z","html_url":"https://github.com/dhienan/demo-rspec/pull/21#discussion_r40180524","pull_request_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/comments/40180524"},"html":{"href":"https://github.com/dhienan/demo-rspec/pull/21#discussion_r40180524"},"pull_request":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21","id":45754317,"html_url":"https://github.com/dhienan/demo-rspec/pull/21","diff_url":"https://github.com/dhienan/demo-rspec/pull/21.diff","patch_url":"https://github.com/dhienan/demo-rspec/pull/21.patch","issue_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/21","number":21,"state":"open","locked":false,"title":"Gen data by FactoriGirl","user":{"login":"dhienan","id":11751745,"avatar_url":"https://avatars.githubusercontent.com/u/11751745?v=3","gravatar_id":"","url":"https://api.github.com/users/dhienan","html_url":"https://github.com/dhienan","followers_url":"https://api.github.com/users/dhienan/followers","following_url":"https://api.github.com/users/dhienan/following{/other_user}","gists_url":"https://api.github.com/users/dhienan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhienan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhienan/subscriptions","organizations_url":"https://api.github.com/users/dhienan/orgs","repos_url":"https://api.github.com/users/dhienan/repos","events_url":"https://api.github.com/users/dhienan/events{/privacy}","received_events_url":"https://api.github.com/users/dhienan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-23T08:31:32Z","updated_at":"2015-09-23T08:34:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65cf9972a0b1ac8a5ab5f6253c35d7d7f3ad3773","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21/commits","review_comments_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21/comments","review_comment_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/21/comments","statuses_url":"https://api.github.com/repos/dhienan/demo-rspec/statuses/30cf2321bb21f15ef2382321525201d1a8e45fd5","head":{"label":"dhienan:feature/gen_data_test_by_factorygirl","ref":"feature/gen_data_test_by_factorygirl","sha":"30cf2321bb21f15ef2382321525201d1a8e45fd5","user":{"login":"dhienan","id":11751745,"avatar_url":"https://avatars.githubusercontent.com/u/11751745?v=3","gravatar_id":"","url":"https://api.github.com/users/dhienan","html_url":"https://github.com/dhienan","followers_url":"https://api.github.com/users/dhienan/followers","following_url":"https://api.github.com/users/dhienan/following{/other_user}","gists_url":"https://api.github.com/users/dhienan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhienan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhienan/subscriptions","organizations_url":"https://api.github.com/users/dhienan/orgs","repos_url":"https://api.github.com/users/dhienan/repos","events_url":"https://api.github.com/users/dhienan/events{/privacy}","received_events_url":"https://api.github.com/users/dhienan/received_events","type":"User","site_admin":false},"repo":{"id":42708839,"name":"demo-rspec","full_name":"dhienan/demo-rspec","owner":{"login":"dhienan","id":11751745,"avatar_url":"https://avatars.githubusercontent.com/u/11751745?v=3","gravatar_id":"","url":"https://api.github.com/users/dhienan","html_url":"https://github.com/dhienan","followers_url":"https://api.github.com/users/dhienan/followers","following_url":"https://api.github.com/users/dhienan/following{/other_user}","gists_url":"https://api.github.com/users/dhienan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhienan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhienan/subscriptions","organizations_url":"https://api.github.com/users/dhienan/orgs","repos_url":"https://api.github.com/users/dhienan/repos","events_url":"https://api.github.com/users/dhienan/events{/privacy}","received_events_url":"https://api.github.com/users/dhienan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhienan/demo-rspec","description":"","fork":false,"url":"https://api.github.com/repos/dhienan/demo-rspec","forks_url":"https://api.github.com/repos/dhienan/demo-rspec/forks","keys_url":"https://api.github.com/repos/dhienan/demo-rspec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhienan/demo-rspec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhienan/demo-rspec/teams","hooks_url":"https://api.github.com/repos/dhienan/demo-rspec/hooks","issue_events_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/events{/number}","events_url":"https://api.github.com/repos/dhienan/demo-rspec/events","assignees_url":"https://api.github.com/repos/dhienan/demo-rspec/assignees{/user}","branches_url":"https://api.github.com/repos/dhienan/demo-rspec/branches{/branch}","tags_url":"https://api.github.com/repos/dhienan/demo-rspec/tags","blobs_url":"https://api.github.com/repos/dhienan/demo-rspec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhienan/demo-rspec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhienan/demo-rspec/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhienan/demo-rspec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhienan/demo-rspec/statuses/{sha}","languages_url":"https://api.github.com/repos/dhienan/demo-rspec/languages","stargazers_url":"https://api.github.com/repos/dhienan/demo-rspec/stargazers","contributors_url":"https://api.github.com/repos/dhienan/demo-rspec/contributors","subscribers_url":"https://api.github.com/repos/dhienan/demo-rspec/subscribers","subscription_url":"https://api.github.com/repos/dhienan/demo-rspec/subscription","commits_url":"https://api.github.com/repos/dhienan/demo-rspec/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhienan/demo-rspec/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhienan/demo-rspec/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhienan/demo-rspec/contents/{+path}","compare_url":"https://api.github.com/repos/dhienan/demo-rspec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhienan/demo-rspec/merges","archive_url":"https://api.github.com/repos/dhienan/demo-rspec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhienan/demo-rspec/downloads","issues_url":"https://api.github.com/repos/dhienan/demo-rspec/issues{/number}","pulls_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls{/number}","milestones_url":"https://api.github.com/repos/dhienan/demo-rspec/milestones{/number}","notifications_url":"https://api.github.com/repos/dhienan/demo-rspec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhienan/demo-rspec/labels{/name}","releases_url":"https://api.github.com/repos/dhienan/demo-rspec/releases{/id}","created_at":"2015-09-18T08:22:36Z","updated_at":"2015-09-18T08:31:06Z","pushed_at":"2015-09-23T08:34:20Z","git_url":"git://github.com/dhienan/demo-rspec.git","ssh_url":"git@github.com:dhienan/demo-rspec.git","clone_url":"https://github.com/dhienan/demo-rspec.git","svn_url":"https://github.com/dhienan/demo-rspec","homepage":null,"size":0,"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":12,"forks":0,"open_issues":12,"watchers":0,"default_branch":"develop"}},"base":{"label":"dhienan:develop","ref":"develop","sha":"c3bee83def77e194eba45fb27bbb895b983e0b9e","user":{"login":"dhienan","id":11751745,"avatar_url":"https://avatars.githubusercontent.com/u/11751745?v=3","gravatar_id":"","url":"https://api.github.com/users/dhienan","html_url":"https://github.com/dhienan","followers_url":"https://api.github.com/users/dhienan/followers","following_url":"https://api.github.com/users/dhienan/following{/other_user}","gists_url":"https://api.github.com/users/dhienan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhienan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhienan/subscriptions","organizations_url":"https://api.github.com/users/dhienan/orgs","repos_url":"https://api.github.com/users/dhienan/repos","events_url":"https://api.github.com/users/dhienan/events{/privacy}","received_events_url":"https://api.github.com/users/dhienan/received_events","type":"User","site_admin":false},"repo":{"id":42708839,"name":"demo-rspec","full_name":"dhienan/demo-rspec","owner":{"login":"dhienan","id":11751745,"avatar_url":"https://avatars.githubusercontent.com/u/11751745?v=3","gravatar_id":"","url":"https://api.github.com/users/dhienan","html_url":"https://github.com/dhienan","followers_url":"https://api.github.com/users/dhienan/followers","following_url":"https://api.github.com/users/dhienan/following{/other_user}","gists_url":"https://api.github.com/users/dhienan/gists{/gist_id}","starred_url":"https://api.github.com/users/dhienan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhienan/subscriptions","organizations_url":"https://api.github.com/users/dhienan/orgs","repos_url":"https://api.github.com/users/dhienan/repos","events_url":"https://api.github.com/users/dhienan/events{/privacy}","received_events_url":"https://api.github.com/users/dhienan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhienan/demo-rspec","description":"","fork":false,"url":"https://api.github.com/repos/dhienan/demo-rspec","forks_url":"https://api.github.com/repos/dhienan/demo-rspec/forks","keys_url":"https://api.github.com/repos/dhienan/demo-rspec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhienan/demo-rspec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhienan/demo-rspec/teams","hooks_url":"https://api.github.com/repos/dhienan/demo-rspec/hooks","issue_events_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/events{/number}","events_url":"https://api.github.com/repos/dhienan/demo-rspec/events","assignees_url":"https://api.github.com/repos/dhienan/demo-rspec/assignees{/user}","branches_url":"https://api.github.com/repos/dhienan/demo-rspec/branches{/branch}","tags_url":"https://api.github.com/repos/dhienan/demo-rspec/tags","blobs_url":"https://api.github.com/repos/dhienan/demo-rspec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhienan/demo-rspec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhienan/demo-rspec/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhienan/demo-rspec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhienan/demo-rspec/statuses/{sha}","languages_url":"https://api.github.com/repos/dhienan/demo-rspec/languages","stargazers_url":"https://api.github.com/repos/dhienan/demo-rspec/stargazers","contributors_url":"https://api.github.com/repos/dhienan/demo-rspec/contributors","subscribers_url":"https://api.github.com/repos/dhienan/demo-rspec/subscribers","subscription_url":"https://api.github.com/repos/dhienan/demo-rspec/subscription","commits_url":"https://api.github.com/repos/dhienan/demo-rspec/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhienan/demo-rspec/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhienan/demo-rspec/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhienan/demo-rspec/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhienan/demo-rspec/contents/{+path}","compare_url":"https://api.github.com/repos/dhienan/demo-rspec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhienan/demo-rspec/merges","archive_url":"https://api.github.com/repos/dhienan/demo-rspec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhienan/demo-rspec/downloads","issues_url":"https://api.github.com/repos/dhienan/demo-rspec/issues{/number}","pulls_url":"https://api.github.com/repos/dhienan/demo-rspec/pulls{/number}","milestones_url":"https://api.github.com/repos/dhienan/demo-rspec/milestones{/number}","notifications_url":"https://api.github.com/repos/dhienan/demo-rspec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhienan/demo-rspec/labels{/name}","releases_url":"https://api.github.com/repos/dhienan/demo-rspec/releases{/id}","created_at":"2015-09-18T08:22:36Z","updated_at":"2015-09-18T08:31:06Z","pushed_at":"2015-09-23T08:34:20Z","git_url":"git://github.com/dhienan/demo-rspec.git","ssh_url":"git@github.com:dhienan/demo-rspec.git","clone_url":"https://github.com/dhienan/demo-rspec.git","svn_url":"https://github.com/dhienan/demo-rspec","homepage":null,"size":0,"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":12,"forks":0,"open_issues":12,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21"},"html":{"href":"https://github.com/dhienan/demo-rspec/pull/21"},"issue":{"href":"https://api.github.com/repos/dhienan/demo-rspec/issues/21"},"comments":{"href":"https://api.github.com/repos/dhienan/demo-rspec/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dhienan/demo-rspec/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/dhienan/demo-rspec/statuses/30cf2321bb21f15ef2382321525201d1a8e45fd5"}}}}