{"action":"created","comment":{"url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments/168935499","pull_request_review_id":97003393,"id":168935499,"diff_hunk":"@@ -2,18 +2,89 @@\n \n RSpec.describe User, type: :model do\n \n-  describe \"validations\" do\n+  describe \"asociations\" do\n+    it \"has_many procedure\" do\n+      assc = described_class.reflect_on_association(:procedures)\n+      expect(assc.macro).to eq :has_many\n+    end\n+  end\n+\n+  describe \"validations\" do    \n     it {expect(build(:user)).to be_valid}\n     it {expect(build(:user, email: nil)).to_not be_valid}\n     it {expect(build(:user, password: nil)).to_not be_valid}\n     it {expect(build(:user, password_confirmation: nil)).to be_valid}\n+    it {expect(build(:user, username: nil)).to be_valid}\n+    it { is_expected.to validate_presence_of(:username) }\n+    it { expect validate_uniqueness_of(:username) }\n+    it { expect allow_value('/^[a-zA-Z0-9_\\.]*$/').for(:username) }\n   end\n \n-  describe \"asociations\" do\n-    it \"has_many procedure\" do\n-      assc = described_class.reflect_on_association(:procedures)\n-      expect(assc.macro).to eq :has_many\n+  describe \"before_validation\" do\n+    it { is_expected.to callback(:set_username).before(:validation) }\n+  end\n+\n+  describe \"attr_accessors\" do\n+    it { expect have_attr_accessor(:login) }\n+    it { expect have_attr_accessor(:prevalidate_username_uniqueness) } # ahi se lo pones tu al context\n+  end\n+  \n+  describe \"#set_username\" do\n+    context \"prevalidate_username_uniqueness == true\" do ","path":"spec/models/user_spec.rb","position":37,"original_position":37,"commit_id":"e699722cc50aef9cdecd3e9b3ddbbc5175ebb275","original_commit_id":"e699722cc50aef9cdecd3e9b3ddbbc5175ebb275","user":{"login":"alexisraca","id":1482411,"avatar_url":"https://avatars2.githubusercontent.com/u/1482411?v=4","gravatar_id":"","url":"https://api.github.com/users/alexisraca","html_url":"https://github.com/alexisraca","followers_url":"https://api.github.com/users/alexisraca/followers","following_url":"https://api.github.com/users/alexisraca/following{/other_user}","gists_url":"https://api.github.com/users/alexisraca/gists{/gist_id}","starred_url":"https://api.github.com/users/alexisraca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexisraca/subscriptions","organizations_url":"https://api.github.com/users/alexisraca/orgs","repos_url":"https://api.github.com/users/alexisraca/repos","events_url":"https://api.github.com/users/alexisraca/events{/privacy}","received_events_url":"https://api.github.com/users/alexisraca/received_events","type":"User","site_admin":false},"body":"En que momento seteas este atribute_accessor como true? no lo veo en ninguna parte del contexto","created_at":"2018-02-17T23:16:22Z","updated_at":"2018-02-17T23:33:31Z","html_url":"https://github.com/MaverickRolex/notarias/pull/43#discussion_r168935499","pull_request_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments/168935499"},"html":{"href":"https://github.com/MaverickRolex/notarias/pull/43#discussion_r168935499"},"pull_request":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43","id":167541466,"html_url":"https://github.com/MaverickRolex/notarias/pull/43","diff_url":"https://github.com/MaverickRolex/notarias/pull/43.diff","patch_url":"https://github.com/MaverickRolex/notarias/pull/43.patch","issue_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/43","number":43,"state":"open","locked":false,"title":"Add username to user and before save","user":{"login":"TauroAlde","id":20530900,"avatar_url":"https://avatars1.githubusercontent.com/u/20530900?v=4","gravatar_id":"","url":"https://api.github.com/users/TauroAlde","html_url":"https://github.com/TauroAlde","followers_url":"https://api.github.com/users/TauroAlde/followers","following_url":"https://api.github.com/users/TauroAlde/following{/other_user}","gists_url":"https://api.github.com/users/TauroAlde/gists{/gist_id}","starred_url":"https://api.github.com/users/TauroAlde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TauroAlde/subscriptions","organizations_url":"https://api.github.com/users/TauroAlde/orgs","repos_url":"https://api.github.com/users/TauroAlde/repos","events_url":"https://api.github.com/users/TauroAlde/events{/privacy}","received_events_url":"https://api.github.com/users/TauroAlde/received_events","type":"User","site_admin":false},"body":"Add username to use,  before save, method set_username and validates uniqueness username","created_at":"2018-02-06T22:01:38Z","updated_at":"2018-02-17T23:33:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43/commits","review_comments_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43/comments","review_comment_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/43/comments","statuses_url":"https://api.github.com/repos/MaverickRolex/notarias/statuses/e699722cc50aef9cdecd3e9b3ddbbc5175ebb275","head":{"label":"MaverickRolex:add_username_to_user_and_before_save","ref":"add_username_to_user_and_before_save","sha":"e699722cc50aef9cdecd3e9b3ddbbc5175ebb275","user":{"login":"MaverickRolex","id":20530897,"avatar_url":"https://avatars1.githubusercontent.com/u/20530897?v=4","gravatar_id":"","url":"https://api.github.com/users/MaverickRolex","html_url":"https://github.com/MaverickRolex","followers_url":"https://api.github.com/users/MaverickRolex/followers","following_url":"https://api.github.com/users/MaverickRolex/following{/other_user}","gists_url":"https://api.github.com/users/MaverickRolex/gists{/gist_id}","starred_url":"https://api.github.com/users/MaverickRolex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaverickRolex/subscriptions","organizations_url":"https://api.github.com/users/MaverickRolex/orgs","repos_url":"https://api.github.com/users/MaverickRolex/repos","events_url":"https://api.github.com/users/MaverickRolex/events{/privacy}","received_events_url":"https://api.github.com/users/MaverickRolex/received_events","type":"User","site_admin":false},"repo":{"id":107570566,"name":"notarias","full_name":"MaverickRolex/notarias","owner":{"login":"MaverickRolex","id":20530897,"avatar_url":"https://avatars1.githubusercontent.com/u/20530897?v=4","gravatar_id":"","url":"https://api.github.com/users/MaverickRolex","html_url":"https://github.com/MaverickRolex","followers_url":"https://api.github.com/users/MaverickRolex/followers","following_url":"https://api.github.com/users/MaverickRolex/following{/other_user}","gists_url":"https://api.github.com/users/MaverickRolex/gists{/gist_id}","starred_url":"https://api.github.com/users/MaverickRolex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaverickRolex/subscriptions","organizations_url":"https://api.github.com/users/MaverickRolex/orgs","repos_url":"https://api.github.com/users/MaverickRolex/repos","events_url":"https://api.github.com/users/MaverickRolex/events{/privacy}","received_events_url":"https://api.github.com/users/MaverickRolex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaverickRolex/notarias","description":"Sistema de Control de Notarias - Ceiba - Team","fork":false,"url":"https://api.github.com/repos/MaverickRolex/notarias","forks_url":"https://api.github.com/repos/MaverickRolex/notarias/forks","keys_url":"https://api.github.com/repos/MaverickRolex/notarias/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaverickRolex/notarias/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaverickRolex/notarias/teams","hooks_url":"https://api.github.com/repos/MaverickRolex/notarias/hooks","issue_events_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/events{/number}","events_url":"https://api.github.com/repos/MaverickRolex/notarias/events","assignees_url":"https://api.github.com/repos/MaverickRolex/notarias/assignees{/user}","branches_url":"https://api.github.com/repos/MaverickRolex/notarias/branches{/branch}","tags_url":"https://api.github.com/repos/MaverickRolex/notarias/tags","blobs_url":"https://api.github.com/repos/MaverickRolex/notarias/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaverickRolex/notarias/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaverickRolex/notarias/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaverickRolex/notarias/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaverickRolex/notarias/statuses/{sha}","languages_url":"https://api.github.com/repos/MaverickRolex/notarias/languages","stargazers_url":"https://api.github.com/repos/MaverickRolex/notarias/stargazers","contributors_url":"https://api.github.com/repos/MaverickRolex/notarias/contributors","subscribers_url":"https://api.github.com/repos/MaverickRolex/notarias/subscribers","subscription_url":"https://api.github.com/repos/MaverickRolex/notarias/subscription","commits_url":"https://api.github.com/repos/MaverickRolex/notarias/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaverickRolex/notarias/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaverickRolex/notarias/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaverickRolex/notarias/contents/{+path}","compare_url":"https://api.github.com/repos/MaverickRolex/notarias/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaverickRolex/notarias/merges","archive_url":"https://api.github.com/repos/MaverickRolex/notarias/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaverickRolex/notarias/downloads","issues_url":"https://api.github.com/repos/MaverickRolex/notarias/issues{/number}","pulls_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls{/number}","milestones_url":"https://api.github.com/repos/MaverickRolex/notarias/milestones{/number}","notifications_url":"https://api.github.com/repos/MaverickRolex/notarias/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaverickRolex/notarias/labels{/name}","releases_url":"https://api.github.com/repos/MaverickRolex/notarias/releases{/id}","deployments_url":"https://api.github.com/repos/MaverickRolex/notarias/deployments","created_at":"2017-10-19T16:19:07Z","updated_at":"2017-10-19T16:21:43Z","pushed_at":"2018-02-17T18:32:59Z","git_url":"git://github.com/MaverickRolex/notarias.git","ssh_url":"git@github.com:MaverickRolex/notarias.git","clone_url":"https://github.com/MaverickRolex/notarias.git","svn_url":"https://github.com/MaverickRolex/notarias","homepage":null,"size":214,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"MaverickRolex:master","ref":"master","sha":"cf9a0b83940e7c12f364c6364adcf8ffd3ea4dea","user":{"login":"MaverickRolex","id":20530897,"avatar_url":"https://avatars1.githubusercontent.com/u/20530897?v=4","gravatar_id":"","url":"https://api.github.com/users/MaverickRolex","html_url":"https://github.com/MaverickRolex","followers_url":"https://api.github.com/users/MaverickRolex/followers","following_url":"https://api.github.com/users/MaverickRolex/following{/other_user}","gists_url":"https://api.github.com/users/MaverickRolex/gists{/gist_id}","starred_url":"https://api.github.com/users/MaverickRolex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaverickRolex/subscriptions","organizations_url":"https://api.github.com/users/MaverickRolex/orgs","repos_url":"https://api.github.com/users/MaverickRolex/repos","events_url":"https://api.github.com/users/MaverickRolex/events{/privacy}","received_events_url":"https://api.github.com/users/MaverickRolex/received_events","type":"User","site_admin":false},"repo":{"id":107570566,"name":"notarias","full_name":"MaverickRolex/notarias","owner":{"login":"MaverickRolex","id":20530897,"avatar_url":"https://avatars1.githubusercontent.com/u/20530897?v=4","gravatar_id":"","url":"https://api.github.com/users/MaverickRolex","html_url":"https://github.com/MaverickRolex","followers_url":"https://api.github.com/users/MaverickRolex/followers","following_url":"https://api.github.com/users/MaverickRolex/following{/other_user}","gists_url":"https://api.github.com/users/MaverickRolex/gists{/gist_id}","starred_url":"https://api.github.com/users/MaverickRolex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaverickRolex/subscriptions","organizations_url":"https://api.github.com/users/MaverickRolex/orgs","repos_url":"https://api.github.com/users/MaverickRolex/repos","events_url":"https://api.github.com/users/MaverickRolex/events{/privacy}","received_events_url":"https://api.github.com/users/MaverickRolex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaverickRolex/notarias","description":"Sistema de Control de Notarias - Ceiba - Team","fork":false,"url":"https://api.github.com/repos/MaverickRolex/notarias","forks_url":"https://api.github.com/repos/MaverickRolex/notarias/forks","keys_url":"https://api.github.com/repos/MaverickRolex/notarias/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaverickRolex/notarias/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaverickRolex/notarias/teams","hooks_url":"https://api.github.com/repos/MaverickRolex/notarias/hooks","issue_events_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/events{/number}","events_url":"https://api.github.com/repos/MaverickRolex/notarias/events","assignees_url":"https://api.github.com/repos/MaverickRolex/notarias/assignees{/user}","branches_url":"https://api.github.com/repos/MaverickRolex/notarias/branches{/branch}","tags_url":"https://api.github.com/repos/MaverickRolex/notarias/tags","blobs_url":"https://api.github.com/repos/MaverickRolex/notarias/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaverickRolex/notarias/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaverickRolex/notarias/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaverickRolex/notarias/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaverickRolex/notarias/statuses/{sha}","languages_url":"https://api.github.com/repos/MaverickRolex/notarias/languages","stargazers_url":"https://api.github.com/repos/MaverickRolex/notarias/stargazers","contributors_url":"https://api.github.com/repos/MaverickRolex/notarias/contributors","subscribers_url":"https://api.github.com/repos/MaverickRolex/notarias/subscribers","subscription_url":"https://api.github.com/repos/MaverickRolex/notarias/subscription","commits_url":"https://api.github.com/repos/MaverickRolex/notarias/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaverickRolex/notarias/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaverickRolex/notarias/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaverickRolex/notarias/contents/{+path}","compare_url":"https://api.github.com/repos/MaverickRolex/notarias/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaverickRolex/notarias/merges","archive_url":"https://api.github.com/repos/MaverickRolex/notarias/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaverickRolex/notarias/downloads","issues_url":"https://api.github.com/repos/MaverickRolex/notarias/issues{/number}","pulls_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls{/number}","milestones_url":"https://api.github.com/repos/MaverickRolex/notarias/milestones{/number}","notifications_url":"https://api.github.com/repos/MaverickRolex/notarias/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaverickRolex/notarias/labels{/name}","releases_url":"https://api.github.com/repos/MaverickRolex/notarias/releases{/id}","deployments_url":"https://api.github.com/repos/MaverickRolex/notarias/deployments","created_at":"2017-10-19T16:19:07Z","updated_at":"2017-10-19T16:21:43Z","pushed_at":"2018-02-17T18:32:59Z","git_url":"git://github.com/MaverickRolex/notarias.git","ssh_url":"git@github.com:MaverickRolex/notarias.git","clone_url":"https://github.com/MaverickRolex/notarias.git","svn_url":"https://github.com/MaverickRolex/notarias","homepage":null,"size":214,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43"},"html":{"href":"https://github.com/MaverickRolex/notarias/pull/43"},"issue":{"href":"https://api.github.com/repos/MaverickRolex/notarias/issues/43"},"comments":{"href":"https://api.github.com/repos/MaverickRolex/notarias/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/MaverickRolex/notarias/statuses/e699722cc50aef9cdecd3e9b3ddbbc5175ebb275"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"alexisraca"}}