payload: {"action":"created","comment":{"url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/comments/312313471","pull_request_review_id":272924407,"id":312313471,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMjMxMzQ3MQ==","diff_hunk":"@@ -0,0 +1,233 @@\n+require \"rails_helper\"\n+include SessionsHelper\n+\n+RSpec.describe CategoriesController, type: :controller do\n+  let(:category) {FactoryBot.create :category}\n+  let(:room) {FactoryBot.create :room, category_id: category.id}\n+  subject {FactoryBot.create :category}\n+  let(:valid_attributes) {FactoryBot.attributes_for :category}\n+  let(:invalid_attributes) {FactoryBot.attributes_for :category, name: \"\"}\n+  \n+  context \"not login\" do\n+    describe \"GET #index\" do\n+      let!(:categories) { FactoryBot.create_list :category, 3 }\n+\n+      it \"assigns @categories\" do\n+        expect(assigns(:categories)).to eq assigns(:categories)\n+      end\n+\n+      it \"not login index\" do\n+        get :index\n+        expect(response).to redirect_to login_url\n+      end\n+    end\n+\n+    describe \"GET #new\" do\n+      it \"assigns @category\" do\n+        expect(assigns(:category)).to eq assigns(:category)\n+      end\n+\n+      it \"not login new\" do\n+        get :index\n+        expect(response).to redirect_to login_url\n+      end\n+    end\n+\n+    describe \"GET #edit\" do\n+      it \"assigns @category\" do\n+        expect(assigns(:category)).to eq assigns 1\n+      end\n+\n+      it \"not login edit\" do\n+        get :index\n+        expect(response).to redirect_to login_url\n+      end\n+    end\n+\n+    describe \"GET #show\" do\n+      it \"assigns @category\" do\n+        expect(assigns(:category)).to eq assigns 1 \n+      end\n+\n+      it \"not login show\" do\n+        get :index\n+        expect(response).to redirect_to login_url\n+      end\n+    end\n+  end\n+  \n+  context \"user is administrator\" do\n+    before do\n+      admin = FactoryBot.create :user, role: 1, room_id: room.id\n+      log_in admin\n+    end\n+\n+    describe \"GET #index\" do\n+      let!(:categories) { FactoryBot.create_list :category, 3 }\n+\n+      it \"assigns @categories\" do\n+        expect(assigns(:categories)).to eq assigns(:categories)\n+      end\n+\n+      it \"logined get index\" do\n+        get :index\n+        expect(response).to render_template \"index\"\n+      end\n+    end\n+\n+    describe \"GET #new\" do\n+      it \"assigns @category\" do\n+        expect(assigns(:category)).to eq assigns(:category)\n+      end\n+\n+      it \"logined get new\" do\n+        get :new\n+        expect(response).to render_template \"new\"\n+      end\n+    end\n+\n+    describe \"GET #edit\" do\n+      it \"assigns @category\" do\n+        expect(assigns(:category)).to eq assigns(:category)\n+      end\n+\n+      it \"logined get edit\" do\n+        get :edit, params: {id: subject}","path":"spec/controllers/category_controller_spec.rb","position":95,"original_position":95,"commit_id":"b939d138508de22fb4d990f8566fa0579e2c0726","original_commit_id":"b939d138508de22fb4d990f8566fa0579e2c0726","user":{"login":"hungct-1121","id":49508133,"node_id":"MDQ6VXNlcjQ5NTA4MTMz","avatar_url":"https://avatars1.githubusercontent.com/u/49508133?v=4","gravatar_id":"","url":"https://api.github.com/users/hungct-1121","html_url":"https://github.com/hungct-1121","followers_url":"https://api.github.com/users/hungct-1121/followers","following_url":"https://api.github.com/users/hungct-1121/following{/other_user}","gists_url":"https://api.github.com/users/hungct-1121/gists{/gist_id}","starred_url":"https://api.github.com/users/hungct-1121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hungct-1121/subscriptions","organizations_url":"https://api.github.com/users/hungct-1121/orgs","repos_url":"https://api.github.com/users/hungct-1121/repos","events_url":"https://api.github.com/users/hungct-1121/events{/privacy}","received_events_url":"https://api.github.com/users/hungct-1121/received_events","type":"User","site_admin":false},"body":"cần id mà đưa cả object vào thế này hả em ???","created_at":"2019-08-09T02:52:52Z","updated_at":"2019-08-09T02:54:24Z","html_url":"https://github.com/awesome-academy/Room-Management/pull/15#discussion_r312313471","pull_request_url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/comments/312313471"},"html":{"href":"https://github.com/awesome-academy/Room-Management/pull/15#discussion_r312313471"},"pull_request":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15","id":305024616,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA1MDI0NjE2","html_url":"https://github.com/awesome-academy/Room-Management/pull/15","diff_url":"https://github.com/awesome-academy/Room-Management/pull/15.diff","patch_url":"https://github.com/awesome-academy/Room-Management/pull/15.patch","issue_url":"https://api.github.com/repos/awesome-academy/Room-Management/issues/15","number":15,"state":"open","locked":false,"title":"Rspec category controller","user":{"login":"dangph-1996","id":52390198,"node_id":"MDQ6VXNlcjUyMzkwMTk4","avatar_url":"https://avatars0.githubusercontent.com/u/52390198?v=4","gravatar_id":"","url":"https://api.github.com/users/dangph-1996","html_url":"https://github.com/dangph-1996","followers_url":"https://api.github.com/users/dangph-1996/followers","following_url":"https://api.github.com/users/dangph-1996/following{/other_user}","gists_url":"https://api.github.com/users/dangph-1996/gists{/gist_id}","starred_url":"https://api.github.com/users/dangph-1996/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangph-1996/subscriptions","organizations_url":"https://api.github.com/users/dangph-1996/orgs","repos_url":"https://api.github.com/users/dangph-1996/repos","events_url":"https://api.github.com/users/dangph-1996/events{/privacy}","received_events_url":"https://api.github.com/users/dangph-1996/received_events","type":"User","site_admin":false},"body":"==> Tittle: Rpec Controller Category\r\n\r\n==> Redmine: https://edu-redmine.sun-asterisk.vn/issues/16128\r\n\r\n==> Attachment File: \r\n","created_at":"2019-08-07T07:53:47Z","updated_at":"2019-08-09T02:54:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbcd5e416bac691053b2080a726aa8bd9967a73b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15/commits","review_comments_url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15/comments","review_comment_url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awesome-academy/Room-Management/issues/15/comments","statuses_url":"https://api.github.com/repos/awesome-academy/Room-Management/statuses/b939d138508de22fb4d990f8566fa0579e2c0726","head":{"label":"dangph-1996:Rspec_category_controller","ref":"Rspec_category_controller","sha":"b939d138508de22fb4d990f8566fa0579e2c0726","user":{"login":"dangph-1996","id":52390198,"node_id":"MDQ6VXNlcjUyMzkwMTk4","avatar_url":"https://avatars0.githubusercontent.com/u/52390198?v=4","gravatar_id":"","url":"https://api.github.com/users/dangph-1996","html_url":"https://github.com/dangph-1996","followers_url":"https://api.github.com/users/dangph-1996/followers","following_url":"https://api.github.com/users/dangph-1996/following{/other_user}","gists_url":"https://api.github.com/users/dangph-1996/gists{/gist_id}","starred_url":"https://api.github.com/users/dangph-1996/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangph-1996/subscriptions","organizations_url":"https://api.github.com/users/dangph-1996/orgs","repos_url":"https://api.github.com/users/dangph-1996/repos","events_url":"https://api.github.com/users/dangph-1996/events{/privacy}","received_events_url":"https://api.github.com/users/dangph-1996/received_events","type":"User","site_admin":false},"repo":{"id":198366687,"node_id":"MDEwOlJlcG9zaXRvcnkxOTgzNjY2ODc=","name":"Room-Management","full_name":"dangph-1996/Room-Management","private":false,"owner":{"login":"dangph-1996","id":52390198,"node_id":"MDQ6VXNlcjUyMzkwMTk4","avatar_url":"https://avatars0.githubusercontent.com/u/52390198?v=4","gravatar_id":"","url":"https://api.github.com/users/dangph-1996","html_url":"https://github.com/dangph-1996","followers_url":"https://api.github.com/users/dangph-1996/followers","following_url":"https://api.github.com/users/dangph-1996/following{/other_user}","gists_url":"https://api.github.com/users/dangph-1996/gists{/gist_id}","starred_url":"https://api.github.com/users/dangph-1996/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangph-1996/subscriptions","organizations_url":"https://api.github.com/users/dangph-1996/orgs","repos_url":"https://api.github.com/users/dangph-1996/repos","events_url":"https://api.github.com/users/dangph-1996/events{/privacy}","received_events_url":"https://api.github.com/users/dangph-1996/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dangph-1996/Room-Management","description":null,"fork":true,"url":"https://api.github.com/repos/dangph-1996/Room-Management","forks_url":"https://api.github.com/repos/dangph-1996/Room-Management/forks","keys_url":"https://api.github.com/repos/dangph-1996/Room-Management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dangph-1996/Room-Management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dangph-1996/Room-Management/teams","hooks_url":"https://api.github.com/repos/dangph-1996/Room-Management/hooks","issue_events_url":"https://api.github.com/repos/dangph-1996/Room-Management/issues/events{/number}","events_url":"https://api.github.com/repos/dangph-1996/Room-Management/events","assignees_url":"https://api.github.com/repos/dangph-1996/Room-Management/assignees{/user}","branches_url":"https://api.github.com/repos/dangph-1996/Room-Management/branches{/branch}","tags_url":"https://api.github.com/repos/dangph-1996/Room-Management/tags","blobs_url":"https://api.github.com/repos/dangph-1996/Room-Management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dangph-1996/Room-Management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dangph-1996/Room-Management/git/refs{/sha}","trees_url":"https://api.github.com/repos/dangph-1996/Room-Management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dangph-1996/Room-Management/statuses/{sha}","languages_url":"https://api.github.com/repos/dangph-1996/Room-Management/languages","stargazers_url":"https://api.github.com/repos/dangph-1996/Room-Management/stargazers","contributors_url":"https://api.github.com/repos/dangph-1996/Room-Management/contributors","subscribers_url":"https://api.github.com/repos/dangph-1996/Room-Management/subscribers","subscription_url":"https://api.github.com/repos/dangph-1996/Room-Management/subscription","commits_url":"https://api.github.com/repos/dangph-1996/Room-Management/commits{/sha}","git_commits_url":"https://api.github.com/repos/dangph-1996/Room-Management/git/commits{/sha}","comments_url":"https://api.github.com/repos/dangph-1996/Room-Management/comments{/number}","issue_comment_url":"https://api.github.com/repos/dangph-1996/Room-Management/issues/comments{/number}","contents_url":"https://api.github.com/repos/dangph-1996/Room-Management/contents/{+path}","compare_url":"https://api.github.com/repos/dangph-1996/Room-Management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dangph-1996/Room-Management/merges","archive_url":"https://api.github.com/repos/dangph-1996/Room-Management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dangph-1996/Room-Management/downloads","issues_url":"https://api.github.com/repos/dangph-1996/Room-Management/issues{/number}","pulls_url":"https://api.github.com/repos/dangph-1996/Room-Management/pulls{/number}","milestones_url":"https://api.github.com/repos/dangph-1996/Room-Management/milestones{/number}","notifications_url":"https://api.github.com/repos/dangph-1996/Room-Management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dangph-1996/Room-Management/labels{/name}","releases_url":"https://api.github.com/repos/dangph-1996/Room-Management/releases{/id}","deployments_url":"https://api.github.com/repos/dangph-1996/Room-Management/deployments","created_at":"2019-07-23T06:29:47Z","updated_at":"2019-07-23T06:29:50Z","pushed_at":"2019-08-09T02:40:18Z","git_url":"git://github.com/dangph-1996/Room-Management.git","ssh_url":"git@github.com:dangph-1996/Room-Management.git","clone_url":"https://github.com/dangph-1996/Room-Management.git","svn_url":"https://github.com/dangph-1996/Room-Management","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awesome-academy:master","ref":"master","sha":"3538b15d3f7dfeb5eda4f0ab586d4bf4f84ec9db","user":{"login":"awesome-academy","id":33895223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1MjIz","avatar_url":"https://avatars0.githubusercontent.com/u/33895223?v=4","gravatar_id":"","url":"https://api.github.com/users/awesome-academy","html_url":"https://github.com/awesome-academy","followers_url":"https://api.github.com/users/awesome-academy/followers","following_url":"https://api.github.com/users/awesome-academy/following{/other_user}","gists_url":"https://api.github.com/users/awesome-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/awesome-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesome-academy/subscriptions","organizations_url":"https://api.github.com/users/awesome-academy/orgs","repos_url":"https://api.github.com/users/awesome-academy/repos","events_url":"https://api.github.com/users/awesome-academy/events{/privacy}","received_events_url":"https://api.github.com/users/awesome-academy/received_events","type":"Organization","site_admin":false},"repo":{"id":198327294,"node_id":"MDEwOlJlcG9zaXRvcnkxOTgzMjcyOTQ=","name":"Room-Management","full_name":"awesome-academy/Room-Management","private":false,"owner":{"login":"awesome-academy","id":33895223,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzODk1MjIz","avatar_url":"https://avatars0.githubusercontent.com/u/33895223?v=4","gravatar_id":"","url":"https://api.github.com/users/awesome-academy","html_url":"https://github.com/awesome-academy","followers_url":"https://api.github.com/users/awesome-academy/followers","following_url":"https://api.github.com/users/awesome-academy/following{/other_user}","gists_url":"https://api.github.com/users/awesome-academy/gists{/gist_id}","starred_url":"https://api.github.com/users/awesome-academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesome-academy/subscriptions","organizations_url":"https://api.github.com/users/awesome-academy/orgs","repos_url":"https://api.github.com/users/awesome-academy/repos","events_url":"https://api.github.com/users/awesome-academy/events{/privacy}","received_events_url":"https://api.github.com/users/awesome-academy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/awesome-academy/Room-Management","description":null,"fork":false,"url":"https://api.github.com/repos/awesome-academy/Room-Management","forks_url":"https://api.github.com/repos/awesome-academy/Room-Management/forks","keys_url":"https://api.github.com/repos/awesome-academy/Room-Management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awesome-academy/Room-Management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awesome-academy/Room-Management/teams","hooks_url":"https://api.github.com/repos/awesome-academy/Room-Management/hooks","issue_events_url":"https://api.github.com/repos/awesome-academy/Room-Management/issues/events{/number}","events_url":"https://api.github.com/repos/awesome-academy/Room-Management/events","assignees_url":"https://api.github.com/repos/awesome-academy/Room-Management/assignees{/user}","branches_url":"https://api.github.com/repos/awesome-academy/Room-Management/branches{/branch}","tags_url":"https://api.github.com/repos/awesome-academy/Room-Management/tags","blobs_url":"https://api.github.com/repos/awesome-academy/Room-Management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awesome-academy/Room-Management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awesome-academy/Room-Management/git/refs{/sha}","trees_url":"https://api.github.com/repos/awesome-academy/Room-Management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awesome-academy/Room-Management/statuses/{sha}","languages_url":"https://api.github.com/repos/awesome-academy/Room-Management/languages","stargazers_url":"https://api.github.com/repos/awesome-academy/Room-Management/stargazers","contributors_url":"https://api.github.com/repos/awesome-academy/Room-Management/contributors","subscribers_url":"https://api.github.com/repos/awesome-academy/Room-Management/subscribers","subscription_url":"https://api.github.com/repos/awesome-academy/Room-Management/subscription","commits_url":"https://api.github.com/repos/awesome-academy/Room-Management/commits{/sha}","git_commits_url":"https://api.github.com/repos/awesome-academy/Room-Management/git/commits{/sha}","comments_url":"https://api.github.com/repos/awesome-academy/Room-Management/comments{/number}","issue_comment_url":"https://api.github.com/repos/awesome-academy/Room-Management/issues/comments{/number}","contents_url":"https://api.github.com/repos/awesome-academy/Room-Management/contents/{+path}","compare_url":"https://api.github.com/repos/awesome-academy/Room-Management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awesome-academy/Room-Management/merges","archive_url":"https://api.github.com/repos/awesome-academy/Room-Management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awesome-academy/Room-Management/downloads","issues_url":"https://api.github.com/repos/awesome-academy/Room-Management/issues{/number}","pulls_url":"https://api.github.com/repos/awesome-academy/Room-Management/pulls{/number}","milestones_url":"https://api.github.com/repos/awesome-academy/Room-Management/milestones{/number}","notifications_url":"https://api.github.com/repos/awesome-academy/Room-Management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awesome-academy/Room-Management/labels{/name}","releases_url":"https://api.github.com/repos/awesome-academy/Room-Management/releases{/id}","deployments_url":"https://api.github.com/repos/awesome-academy/Room-Management/deployments","created_at":"2019-07-23T01:22:51Z","updated_at":"2019-08-07T08:53:21Z","pushed_at":"2019-08-09T02:40:20Z","git_url":"git://github.com/awesome-academy/Room-Management.git","ssh_url":"git@github.com:awesome-academy/Room-Management.git","clone_url":"https://github.com/awesome-academy/Room-Management.git","svn_url":"https://github.com/awesome-academy/Room-Management","homepage":null,"size":218,"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":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15"},"html":{"href":"https://github.com/awesome-academy/Room-Management/pull/15"},"issue":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/issues/15"},"comments":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/awesome-academy/Room-Management/statuses/b939d138508de22fb4d990f8566fa0579e2c0726"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"hungct-1121"}}