{"action":"created","comment":{"url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments/168928946","pull_request_review_id":97381297,"id":168928946,"diff_hunk":"@@ -1,5 +1,34 @@\n require 'rails_helper'\n \n RSpec.describe UserGroup, type: :model do\n-  pending \"add some examples to (or delete) #{__FILE__}\"\n+  \n+  describe \"validations\" do\n+    it { expect(create(:user_group, user: create(:user), group: create(:group))).to be_valid }\n+    it { expect(build(:user_group, user_id: nil)).to_not be_valid }\n+    it { expect(build(:user_group, group_id: nil)).to_not be_valid }\n+    context \"user_group record exist\" do\n+      before(:each) do\n+        @user1 = create(:user)\n+        @user2 = create(:user)\n+        @group1 = create(:group, name: \"group name 1\")\n+        @group2 = create(:group, name: \"group name 2\")\n+      end\n+      it \"user and group combination not exist must be valid\" do\n+        create(:user_group, user_id: @user1.id, group_id: @group2.id)\n+        expect(build(:user_group, user_id: @user2.id, group_id: @group2.id)).to be_valid\n+      end\n+      it \"user and group combination already exist not be valid\" do","path":"spec/models/user_group_spec.rb","position":21,"original_position":21,"commit_id":"5b76638235f368889e46c4eea86ebd643848c8d4","original_commit_id":"5b76638235f368889e46c4eea86ebd643848c8d4","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":"un espacio","created_at":"2018-02-17T18:22:52Z","updated_at":"2018-02-17T18:23:02Z","html_url":"https://github.com/MaverickRolex/notarias/pull/53#discussion_r168928946","pull_request_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments/168928946"},"html":{"href":"https://github.com/MaverickRolex/notarias/pull/53#discussion_r168928946"},"pull_request":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53","id":169551137,"html_url":"https://github.com/MaverickRolex/notarias/pull/53","diff_url":"https://github.com/MaverickRolex/notarias/pull/53.diff","patch_url":"https://github.com/MaverickRolex/notarias/pull/53.patch","issue_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/53","number":53,"state":"open","locked":false,"title":"Made user_group migration add indexation on user and group id, and RSpec tests","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},"body":"Made migration on user_group to add indexation on user_id and group_id columns to validate uniqueness on combinations, was make a rails validation on user_group model to made same validation. EXAMPLE:\r\nUserGroup.create(user_id: 1, group_id: 1) - create ok\r\nUserGroup.create(user_id: 1, group_id: 1) - rollback\r\nUserGroup.create(user_id: 1, group_id: 2) - create ok\r\nUserGroup.create(user_id: 2, group_id: 2) - create ok\r\nUserGroup.create(user_id: 2, group_id: 1) - create ok\r\nUserGroup.create(user_id: 2, group_id: 2) - rollback\r\nMake all RSpec tests for all validation and relations","created_at":"2018-02-16T05:34:13Z","updated_at":"2018-02-17T18:23:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbbc681851830220a498fe8770fac759992adeef","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53/commits","review_comments_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53/comments","review_comment_url":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MaverickRolex/notarias/issues/53/comments","statuses_url":"https://api.github.com/repos/MaverickRolex/notarias/statuses/5b76638235f368889e46c4eea86ebd643848c8d4","head":{"label":"MaverickRolex:user_group_relations_rspec_tests","ref":"user_group_relations_rspec_tests","sha":"5b76638235f368889e46c4eea86ebd643848c8d4","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-16T23:25:22Z","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":211,"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":9,"license":null,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"MaverickRolex:master","ref":"master","sha":"c74887233b20e791125c6a9ff96598c42972e10a","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-16T23:25:22Z","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":211,"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":9,"license":null,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53"},"html":{"href":"https://github.com/MaverickRolex/notarias/pull/53"},"issue":{"href":"https://api.github.com/repos/MaverickRolex/notarias/issues/53"},"comments":{"href":"https://api.github.com/repos/MaverickRolex/notarias/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MaverickRolex/notarias/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/MaverickRolex/notarias/statuses/5b76638235f368889e46c4eea86ebd643848c8d4"}},"author_association":"OWNER"}}
{"actor":{"display_login":"alexisraca"}}