{"action":"created","comment":{"url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/comments/28370540","id":28370540,"diff_hunk":"@@ -0,0 +1,61 @@\n+require \"rails_helper\"\n+\n+RSpec.describe \"Member Role\" do\n+  let(:member) { create :member }\n+  let!(:member_role_empty) { create :member_role, role: \"empty role\" }\n+  let!(:member_role_nonempty) { create :member_role, role: \"nonempty role\", members: [member] }\n+\n+  before do\n+    admin = create :admin\n+    sign_in admin\n+    expect(page).to have_content \"Signed in successfully.\"\n+  end\n+\n+  subject { page }\n+\n+  describe \"without filling in member role\" do\n+    before { visit new_admin_member_role_path }\n+    it \"renders back form with errors\" do\n+      expect { click_button \"Create Member role\" }.not_to change { MemberRole.count }\n+      expect(page).to have_content \"can't be blank\"\n+    end\n+  end\n+\n+  describe \"after filling in member role\" do\n+    before do\n+      visit new_admin_member_role_path\n+      fill_in \"Role\", with: \"Developer\"\n+    end\n+    it \"redirects to member role page on submit\" do\n+      expect { click_button \"Create Member role\" }.to change { MemberRole.count }.by(1)\n+      expect(page).to have_content \"Developer\"\n+    end\n+  end\n+\n+  describe \"after creating a duplicate member role\" do\n+    before do\n+      visit new_admin_member_role_path\n+      fill_in \"Role\", with: \"empty role\"\n+    end\n+    it \"renders back form with errors\" do\n+      expect { click_button \"Create Member role\" }.not_to change { MemberRole.count }\n+      expect(page).to have_content \"has already been taken\"\n+    end\n+  end\n+\n+  describe \"after delete\" do\n+    context \"non-empty member role\" do\n+      before { visit admin_member_roles_path }\n+      it \"renders back page with no changes\" do\n+        expect { click_link \"delete-nonempty_role\" }.not_to change { MemberRole.count }\n+      end\n+    end\n+\n+    context \"empty member role\" do\n+      before { visit admin_member_roles_path }\n+      it \"renders back page without deleted member role\" do\n+        expect { click_link \"delete-empty_role\" }.to change { MemberRole.count }.by(-1)\n+      end\n+    end\n+  end\n+end","path":"spec/features/member_role_spec.rb","position":62,"original_position":61,"commit_id":"2f68ad58615551aaa5cd9f1b70b43a320a529fec","original_commit_id":"6a28bd56b0cc48a344df2b9e282fb6bdee964ca5","user":{"login":"SamLau95","id":2468904,"avatar_url":"https://avatars.githubusercontent.com/u/2468904?v=3","gravatar_id":"","url":"https://api.github.com/users/SamLau95","html_url":"https://github.com/SamLau95","followers_url":"https://api.github.com/users/SamLau95/followers","following_url":"https://api.github.com/users/SamLau95/following{/other_user}","gists_url":"https://api.github.com/users/SamLau95/gists{/gist_id}","starred_url":"https://api.github.com/users/SamLau95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamLau95/subscriptions","organizations_url":"https://api.github.com/users/SamLau95/orgs","repos_url":"https://api.github.com/users/SamLau95/repos","events_url":"https://api.github.com/users/SamLau95/events{/privacy}","received_events_url":"https://api.github.com/users/SamLau95/received_events","type":"User","site_admin":false},"body":"So the validations themselves are tested already in the model spec. These specs are really testing the interaction in the browser and making sure that behavior is correct.","created_at":"2015-04-14T21:05:10Z","updated_at":"2015-04-14T21:05:10Z","html_url":"https://github.com/calblueprint/calblueprint.org/pull/105#discussion_r28370540","pull_request_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105","_links":{"self":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/comments/28370540"},"html":{"href":"https://github.com/calblueprint/calblueprint.org/pull/105#discussion_r28370540"},"pull_request":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105"}}},"pull_request":{"url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105","id":33229353,"html_url":"https://github.com/calblueprint/calblueprint.org/pull/105","diff_url":"https://github.com/calblueprint/calblueprint.org/pull/105.diff","patch_url":"https://github.com/calblueprint/calblueprint.org/pull/105.patch","issue_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/105","number":105,"state":"open","locked":false,"title":"Got nothing in my brain","user":{"login":"kevinshieh","id":3907025,"avatar_url":"https://avatars.githubusercontent.com/u/3907025?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinshieh","html_url":"https://github.com/kevinshieh","followers_url":"https://api.github.com/users/kevinshieh/followers","following_url":"https://api.github.com/users/kevinshieh/following{/other_user}","gists_url":"https://api.github.com/users/kevinshieh/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinshieh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinshieh/subscriptions","organizations_url":"https://api.github.com/users/kevinshieh/orgs","repos_url":"https://api.github.com/users/kevinshieh/repos","events_url":"https://api.github.com/users/kevinshieh/events{/privacy}","received_events_url":"https://api.github.com/users/kevinshieh/received_events","type":"User","site_admin":false},"body":"forgot to open a pr","created_at":"2015-04-14T06:24:12Z","updated_at":"2015-04-14T21:05:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ac05c4c1772724f600975999c0be49905ec49c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105/commits","review_comments_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105/comments","review_comment_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/105/comments","statuses_url":"https://api.github.com/repos/calblueprint/calblueprint.org/statuses/2f68ad58615551aaa5cd9f1b70b43a320a529fec","head":{"label":"calblueprint:got_nothing_in_my_brain","ref":"got_nothing_in_my_brain","sha":"2f68ad58615551aaa5cd9f1b70b43a320a529fec","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":26316088,"name":"calblueprint.org","full_name":"calblueprint/calblueprint.org","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/calblueprint.org","description":"The shiny new Blueprint Website.","fork":false,"url":"https://api.github.com/repos/calblueprint/calblueprint.org","forks_url":"https://api.github.com/repos/calblueprint/calblueprint.org/forks","keys_url":"https://api.github.com/repos/calblueprint/calblueprint.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/calblueprint.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/calblueprint.org/teams","hooks_url":"https://api.github.com/repos/calblueprint/calblueprint.org/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/calblueprint.org/events","assignees_url":"https://api.github.com/repos/calblueprint/calblueprint.org/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/calblueprint.org/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/calblueprint.org/tags","blobs_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/calblueprint.org/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/calblueprint.org/languages","stargazers_url":"https://api.github.com/repos/calblueprint/calblueprint.org/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/calblueprint.org/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/calblueprint.org/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/calblueprint.org/subscription","commits_url":"https://api.github.com/repos/calblueprint/calblueprint.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/calblueprint.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/calblueprint.org/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/calblueprint.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/calblueprint.org/merges","archive_url":"https://api.github.com/repos/calblueprint/calblueprint.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/calblueprint.org/downloads","issues_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/calblueprint.org/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/calblueprint.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/calblueprint.org/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/calblueprint.org/releases{/id}","created_at":"2014-11-07T11:01:50Z","updated_at":"2015-04-07T10:18:27Z","pushed_at":"2015-04-14T21:02:29Z","git_url":"git://github.com/calblueprint/calblueprint.org.git","ssh_url":"git@github.com:calblueprint/calblueprint.org.git","clone_url":"https://github.com/calblueprint/calblueprint.org.git","svn_url":"https://github.com/calblueprint/calblueprint.org","homepage":null,"size":15692,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":34,"forks":0,"open_issues":34,"watchers":6,"default_branch":"master"}},"base":{"label":"calblueprint:master","ref":"master","sha":"7353abdda2e59d51482fbfaa5d841f56fbe457a7","user":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"repo":{"id":26316088,"name":"calblueprint.org","full_name":"calblueprint/calblueprint.org","owner":{"login":"calblueprint","id":2729578,"avatar_url":"https://avatars.githubusercontent.com/u/2729578?v=3","gravatar_id":"","url":"https://api.github.com/users/calblueprint","html_url":"https://github.com/calblueprint","followers_url":"https://api.github.com/users/calblueprint/followers","following_url":"https://api.github.com/users/calblueprint/following{/other_user}","gists_url":"https://api.github.com/users/calblueprint/gists{/gist_id}","starred_url":"https://api.github.com/users/calblueprint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calblueprint/subscriptions","organizations_url":"https://api.github.com/users/calblueprint/orgs","repos_url":"https://api.github.com/users/calblueprint/repos","events_url":"https://api.github.com/users/calblueprint/events{/privacy}","received_events_url":"https://api.github.com/users/calblueprint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/calblueprint/calblueprint.org","description":"The shiny new Blueprint Website.","fork":false,"url":"https://api.github.com/repos/calblueprint/calblueprint.org","forks_url":"https://api.github.com/repos/calblueprint/calblueprint.org/forks","keys_url":"https://api.github.com/repos/calblueprint/calblueprint.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calblueprint/calblueprint.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calblueprint/calblueprint.org/teams","hooks_url":"https://api.github.com/repos/calblueprint/calblueprint.org/hooks","issue_events_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/events{/number}","events_url":"https://api.github.com/repos/calblueprint/calblueprint.org/events","assignees_url":"https://api.github.com/repos/calblueprint/calblueprint.org/assignees{/user}","branches_url":"https://api.github.com/repos/calblueprint/calblueprint.org/branches{/branch}","tags_url":"https://api.github.com/repos/calblueprint/calblueprint.org/tags","blobs_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calblueprint/calblueprint.org/statuses/{sha}","languages_url":"https://api.github.com/repos/calblueprint/calblueprint.org/languages","stargazers_url":"https://api.github.com/repos/calblueprint/calblueprint.org/stargazers","contributors_url":"https://api.github.com/repos/calblueprint/calblueprint.org/contributors","subscribers_url":"https://api.github.com/repos/calblueprint/calblueprint.org/subscribers","subscription_url":"https://api.github.com/repos/calblueprint/calblueprint.org/subscription","commits_url":"https://api.github.com/repos/calblueprint/calblueprint.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/calblueprint/calblueprint.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/calblueprint/calblueprint.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/calblueprint/calblueprint.org/contents/{+path}","compare_url":"https://api.github.com/repos/calblueprint/calblueprint.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calblueprint/calblueprint.org/merges","archive_url":"https://api.github.com/repos/calblueprint/calblueprint.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calblueprint/calblueprint.org/downloads","issues_url":"https://api.github.com/repos/calblueprint/calblueprint.org/issues{/number}","pulls_url":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls{/number}","milestones_url":"https://api.github.com/repos/calblueprint/calblueprint.org/milestones{/number}","notifications_url":"https://api.github.com/repos/calblueprint/calblueprint.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calblueprint/calblueprint.org/labels{/name}","releases_url":"https://api.github.com/repos/calblueprint/calblueprint.org/releases{/id}","created_at":"2014-11-07T11:01:50Z","updated_at":"2015-04-07T10:18:27Z","pushed_at":"2015-04-14T21:02:29Z","git_url":"git://github.com/calblueprint/calblueprint.org.git","ssh_url":"git@github.com:calblueprint/calblueprint.org.git","clone_url":"https://github.com/calblueprint/calblueprint.org.git","svn_url":"https://github.com/calblueprint/calblueprint.org","homepage":null,"size":15692,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":34,"forks":0,"open_issues":34,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105"},"html":{"href":"https://github.com/calblueprint/calblueprint.org/pull/105"},"issue":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/105"},"comments":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/issues/105/comments"},"review_comments":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105/comments"},"review_comment":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/pulls/105/commits"},"statuses":{"href":"https://api.github.com/repos/calblueprint/calblueprint.org/statuses/2f68ad58615551aaa5cd9f1b70b43a320a529fec"}}}}