{"action":"created","comment":{"url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments/35850394","id":35850394,"diff_hunk":"@@ -0,0 +1,82 @@\n+require 'rails_helper'\n+\n+RSpec.feature 'Course: Category: Management' do\n+  let(:instance) { create(:instance) }\n+\n+  with_tenant(:instance) do\n+    let(:course) { create(:course) }\n+    before { login_as(user, scope: :user) }\n+\n+    context 'As a Course Manager' do\n+      let(:user) { course.creator }\n+      scenario 'I can create a new category' do\n+        category = build_stubbed(:course_assessment_category)\n+\n+        visit course_admin_assessments_path(course)\n+        find_link(nil, href: new_course_admin_assessments_category_path(course)).click\n+\n+        expect(current_path).to eq(new_course_admin_assessments_category_path(course))\n+        fill_in 'title', with: category.title\n+        fill_in 'weight', with: category.weight\n+        click_button 'submit'\n+\n+        expect(current_path).to eq(course_admin_assessments_path(course))\n+        expect(page).to have_selector('div.alert.alert-success')\n+      end\n+\n+      scenario 'I can edit category fields' do\n+        category = create(:course_assessment_category, course: course)\n+        category_edited = build_stubbed(:course_assessment_category)\n+\n+        visit course_admin_assessments_path(course)\n+\n+        title_field = find(:css, \"#{content_tag_selector(category)} input\\#category_title\")\n+        weight_field = find(:css, \"#{content_tag_selector(category)} input\\#category_weight\")\n+\n+        expect(title_field.value).to eq(category.title)\n+        expect(weight_field.value.to_i).to eq(category.weight)\n+\n+        title_field.set(category_edited.title)\n+        weight_field.set(category_edited.weight)\n+        click_button 'submit'\n+\n+        expect(title_field.value).to eq(category_edited.title)\n+        expect(weight_field.value.to_i).to eq(category_edited.weight)\n+        expect(page).\n+          to have_selector('div.alert.alert-success',\n+                           text: \"x#{I18n.t('course.admin.assessment_settings.update.success')}\")\n+      end\n+\n+      scenario 'I can delete a category' do\n+        category1 = create(:course_assessment_category, course: course)","path":"spec/features/course/category_management_spec.rb","position":51,"original_position":51,"commit_id":"d982cae3e1b7120f5d93e4ae8d5af09ff65721b7","original_commit_id":"d982cae3e1b7120f5d93e4ae8d5af09ff65721b7","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":"Useless assignment to variable - `category1`. Did you mean `category2`?","created_at":"2015-07-30T08:51:38Z","updated_at":"2015-07-30T08:51:38Z","html_url":"https://github.com/Coursemology/coursemology2/pull/448#discussion_r35850394","pull_request_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments/35850394"},"html":{"href":"https://github.com/Coursemology/coursemology2/pull/448#discussion_r35850394"},"pull_request":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448","id":40851799,"html_url":"https://github.com/Coursemology/coursemology2/pull/448","diff_url":"https://github.com/Coursemology/coursemology2/pull/448.diff","patch_url":"https://github.com/Coursemology/coursemology2/pull/448.patch","issue_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/448","number":448,"state":"open","locked":false,"title":"Implement category/tab management","user":{"login":"dariusf","id":4328341,"avatar_url":"https://avatars.githubusercontent.com/u/4328341?v=3","gravatar_id":"","url":"https://api.github.com/users/dariusf","html_url":"https://github.com/dariusf","followers_url":"https://api.github.com/users/dariusf/followers","following_url":"https://api.github.com/users/dariusf/following{/other_user}","gists_url":"https://api.github.com/users/dariusf/gists{/gist_id}","starred_url":"https://api.github.com/users/dariusf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariusf/subscriptions","organizations_url":"https://api.github.com/users/dariusf/orgs","repos_url":"https://api.github.com/users/dariusf/repos","events_url":"https://api.github.com/users/dariusf/events{/privacy}","received_events_url":"https://api.github.com/users/dariusf/received_events","type":"User","site_admin":false},"body":"Done via nested forms, so reordering can be implemented via drag-and-drop in future.\r\n\r\n<img width=\"1233\" alt=\"categories and tabs\" src=\"https://cloud.githubusercontent.com/assets/4328341/8893645/ab68a8e4-33cb-11e5-885d-31ee6d9d30e1.png\">","created_at":"2015-07-26T11:23:55Z","updated_at":"2015-07-30T08:51:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a00a493371b1b581531c7bb2dda3af1c5f9abce3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448/commits","review_comments_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448/comments","review_comment_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/448/comments","statuses_url":"https://api.github.com/repos/Coursemology/coursemology2/statuses/d982cae3e1b7120f5d93e4ae8d5af09ff65721b7","head":{"label":"coursemology-collab:dariusf/categories-and-tabs","ref":"dariusf/categories-and-tabs","sha":"d982cae3e1b7120f5d93e4ae8d5af09ff65721b7","user":{"login":"coursemology-collab","id":8666458,"avatar_url":"https://avatars.githubusercontent.com/u/8666458?v=3","gravatar_id":"","url":"https://api.github.com/users/coursemology-collab","html_url":"https://github.com/coursemology-collab","followers_url":"https://api.github.com/users/coursemology-collab/followers","following_url":"https://api.github.com/users/coursemology-collab/following{/other_user}","gists_url":"https://api.github.com/users/coursemology-collab/gists{/gist_id}","starred_url":"https://api.github.com/users/coursemology-collab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coursemology-collab/subscriptions","organizations_url":"https://api.github.com/users/coursemology-collab/orgs","repos_url":"https://api.github.com/users/coursemology-collab/repos","events_url":"https://api.github.com/users/coursemology-collab/events{/privacy}","received_events_url":"https://api.github.com/users/coursemology-collab/received_events","type":"Organization","site_admin":false},"repo":{"id":23697674,"name":"coursemology2","full_name":"coursemology-collab/coursemology2","owner":{"login":"coursemology-collab","id":8666458,"avatar_url":"https://avatars.githubusercontent.com/u/8666458?v=3","gravatar_id":"","url":"https://api.github.com/users/coursemology-collab","html_url":"https://github.com/coursemology-collab","followers_url":"https://api.github.com/users/coursemology-collab/followers","following_url":"https://api.github.com/users/coursemology-collab/following{/other_user}","gists_url":"https://api.github.com/users/coursemology-collab/gists{/gist_id}","starred_url":"https://api.github.com/users/coursemology-collab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coursemology-collab/subscriptions","organizations_url":"https://api.github.com/users/coursemology-collab/orgs","repos_url":"https://api.github.com/users/coursemology-collab/repos","events_url":"https://api.github.com/users/coursemology-collab/events{/privacy}","received_events_url":"https://api.github.com/users/coursemology-collab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coursemology-collab/coursemology2","description":"Rails 4 re-write of Coursemology","fork":true,"url":"https://api.github.com/repos/coursemology-collab/coursemology2","forks_url":"https://api.github.com/repos/coursemology-collab/coursemology2/forks","keys_url":"https://api.github.com/repos/coursemology-collab/coursemology2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coursemology-collab/coursemology2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coursemology-collab/coursemology2/teams","hooks_url":"https://api.github.com/repos/coursemology-collab/coursemology2/hooks","issue_events_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues/events{/number}","events_url":"https://api.github.com/repos/coursemology-collab/coursemology2/events","assignees_url":"https://api.github.com/repos/coursemology-collab/coursemology2/assignees{/user}","branches_url":"https://api.github.com/repos/coursemology-collab/coursemology2/branches{/branch}","tags_url":"https://api.github.com/repos/coursemology-collab/coursemology2/tags","blobs_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/refs{/sha}","trees_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coursemology-collab/coursemology2/statuses/{sha}","languages_url":"https://api.github.com/repos/coursemology-collab/coursemology2/languages","stargazers_url":"https://api.github.com/repos/coursemology-collab/coursemology2/stargazers","contributors_url":"https://api.github.com/repos/coursemology-collab/coursemology2/contributors","subscribers_url":"https://api.github.com/repos/coursemology-collab/coursemology2/subscribers","subscription_url":"https://api.github.com/repos/coursemology-collab/coursemology2/subscription","commits_url":"https://api.github.com/repos/coursemology-collab/coursemology2/commits{/sha}","git_commits_url":"https://api.github.com/repos/coursemology-collab/coursemology2/git/commits{/sha}","comments_url":"https://api.github.com/repos/coursemology-collab/coursemology2/comments{/number}","issue_comment_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues/comments{/number}","contents_url":"https://api.github.com/repos/coursemology-collab/coursemology2/contents/{+path}","compare_url":"https://api.github.com/repos/coursemology-collab/coursemology2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coursemology-collab/coursemology2/merges","archive_url":"https://api.github.com/repos/coursemology-collab/coursemology2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coursemology-collab/coursemology2/downloads","issues_url":"https://api.github.com/repos/coursemology-collab/coursemology2/issues{/number}","pulls_url":"https://api.github.com/repos/coursemology-collab/coursemology2/pulls{/number}","milestones_url":"https://api.github.com/repos/coursemology-collab/coursemology2/milestones{/number}","notifications_url":"https://api.github.com/repos/coursemology-collab/coursemology2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coursemology-collab/coursemology2/labels{/name}","releases_url":"https://api.github.com/repos/coursemology-collab/coursemology2/releases{/id}","created_at":"2014-09-05T09:32:07Z","updated_at":"2015-04-24T08:37:06Z","pushed_at":"2015-07-30T08:51:23Z","git_url":"git://github.com/coursemology-collab/coursemology2.git","ssh_url":"git@github.com:coursemology-collab/coursemology2.git","clone_url":"https://github.com/coursemology-collab/coursemology2.git","svn_url":"https://github.com/coursemology-collab/coursemology2","homepage":null,"size":4530,"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":"Coursemology:master","ref":"master","sha":"12e18d89d4b06b424dbf74a0c7f6ded2adee19e0","user":{"login":"Coursemology","id":4427741,"avatar_url":"https://avatars.githubusercontent.com/u/4427741?v=3","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"repo":{"id":22155032,"name":"coursemology2","full_name":"Coursemology/coursemology2","owner":{"login":"Coursemology","id":4427741,"avatar_url":"https://avatars.githubusercontent.com/u/4427741?v=3","gravatar_id":"","url":"https://api.github.com/users/Coursemology","html_url":"https://github.com/Coursemology","followers_url":"https://api.github.com/users/Coursemology/followers","following_url":"https://api.github.com/users/Coursemology/following{/other_user}","gists_url":"https://api.github.com/users/Coursemology/gists{/gist_id}","starred_url":"https://api.github.com/users/Coursemology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coursemology/subscriptions","organizations_url":"https://api.github.com/users/Coursemology/orgs","repos_url":"https://api.github.com/users/Coursemology/repos","events_url":"https://api.github.com/users/Coursemology/events{/privacy}","received_events_url":"https://api.github.com/users/Coursemology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Coursemology/coursemology2","description":"Rails 4 re-write of Coursemology","fork":false,"url":"https://api.github.com/repos/Coursemology/coursemology2","forks_url":"https://api.github.com/repos/Coursemology/coursemology2/forks","keys_url":"https://api.github.com/repos/Coursemology/coursemology2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Coursemology/coursemology2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Coursemology/coursemology2/teams","hooks_url":"https://api.github.com/repos/Coursemology/coursemology2/hooks","issue_events_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/events{/number}","events_url":"https://api.github.com/repos/Coursemology/coursemology2/events","assignees_url":"https://api.github.com/repos/Coursemology/coursemology2/assignees{/user}","branches_url":"https://api.github.com/repos/Coursemology/coursemology2/branches{/branch}","tags_url":"https://api.github.com/repos/Coursemology/coursemology2/tags","blobs_url":"https://api.github.com/repos/Coursemology/coursemology2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Coursemology/coursemology2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Coursemology/coursemology2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Coursemology/coursemology2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Coursemology/coursemology2/statuses/{sha}","languages_url":"https://api.github.com/repos/Coursemology/coursemology2/languages","stargazers_url":"https://api.github.com/repos/Coursemology/coursemology2/stargazers","contributors_url":"https://api.github.com/repos/Coursemology/coursemology2/contributors","subscribers_url":"https://api.github.com/repos/Coursemology/coursemology2/subscribers","subscription_url":"https://api.github.com/repos/Coursemology/coursemology2/subscription","commits_url":"https://api.github.com/repos/Coursemology/coursemology2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Coursemology/coursemology2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Coursemology/coursemology2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Coursemology/coursemology2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Coursemology/coursemology2/contents/{+path}","compare_url":"https://api.github.com/repos/Coursemology/coursemology2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Coursemology/coursemology2/merges","archive_url":"https://api.github.com/repos/Coursemology/coursemology2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Coursemology/coursemology2/downloads","issues_url":"https://api.github.com/repos/Coursemology/coursemology2/issues{/number}","pulls_url":"https://api.github.com/repos/Coursemology/coursemology2/pulls{/number}","milestones_url":"https://api.github.com/repos/Coursemology/coursemology2/milestones{/number}","notifications_url":"https://api.github.com/repos/Coursemology/coursemology2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Coursemology/coursemology2/labels{/name}","releases_url":"https://api.github.com/repos/Coursemology/coursemology2/releases{/id}","created_at":"2014-07-23T14:57:06Z","updated_at":"2015-07-29T08:51:36Z","pushed_at":"2015-07-30T08:51:24Z","git_url":"git://github.com/Coursemology/coursemology2.git","ssh_url":"git@github.com:Coursemology/coursemology2.git","clone_url":"https://github.com/Coursemology/coursemology2.git","svn_url":"https://github.com/Coursemology/coursemology2","homepage":null,"size":6717,"stargazers_count":13,"watchers_count":13,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":45,"forks":10,"open_issues":45,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448"},"html":{"href":"https://github.com/Coursemology/coursemology2/pull/448"},"issue":{"href":"https://api.github.com/repos/Coursemology/coursemology2/issues/448"},"comments":{"href":"https://api.github.com/repos/Coursemology/coursemology2/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Coursemology/coursemology2/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/Coursemology/coursemology2/statuses/d982cae3e1b7120f5d93e4ae8d5af09ff65721b7"}}}}