{"action":"created","comment":{"url":"https://api.github.com/repos/ndlib/annex-ims/pulls/comments/57788717","id":57788717,"diff_hunk":"@@ -0,0 +1,37 @@\n+require 'rails_helper'\n+\n+RSpec.describe GetUserType do\n+  it \"returns 'admin' for an user with admin type\" do\n+    user = FactoryGirl.create(:user, id: 1, admin: true)\n+    expect(GetUserType.call(user)).to eq('admin')\n+    expect(GetUserType.call(user)).to_not eq('worker')\n+  end\n+\n+  it \"returns 'worker' for an user with worker type\" do\n+    user = FactoryGirl.create(:user, id: 1, worker: true)\n+    expect(GetUserType.call(user)).to eq('worker')\n+    expect(GetUserType.call(user)).to_not eq('admin')\n+  end\n+\n+  it \"returns 'disabled' for an user without any type\" do\n+    user = FactoryGirl.create(:user, id: 1)\n+    expect(GetUserType.call(user)).to eq('disabled')\n+    expect(GetUserType.call(user)).to_not eq('worker')\n+    expect(GetUserType.call(user)).to_not eq('admin')\n+  end\n+\n+  it \"returns 'disabled' for an user without admin and worker types\" do\n+    user = FactoryGirl.create(:user, id: 1, admin: false, worker: false)\n+    expect(GetUserType.call(user)).to eq('disabled')","path":"spec/services/get_user_type_spec.rb","position":25,"original_position":25,"commit_id":"5e0b50723da79f576ce0d783e03716877a046468","original_commit_id":"5e0b50723da79f576ce0d783e03716877a046468","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2016-03-29T19:53:13Z","updated_at":"2016-03-29T19:53:13Z","html_url":"https://github.com/ndlib/annex-ims/pull/146#discussion_r57788717","pull_request_url":"https://api.github.com/repos/ndlib/annex-ims/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/comments/57788717"},"html":{"href":"https://github.com/ndlib/annex-ims/pull/146#discussion_r57788717"},"pull_request":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/ndlib/annex-ims/pulls/146","id":64486734,"html_url":"https://github.com/ndlib/annex-ims/pull/146","diff_url":"https://github.com/ndlib/annex-ims/pull/146.diff","patch_url":"https://github.com/ndlib/annex-ims/pull/146.patch","issue_url":"https://api.github.com/repos/ndlib/annex-ims/issues/146","number":146,"state":"open","locked":false,"title":"Updates for users page AIMS-335","user":{"login":"BiigY","id":16779935,"avatar_url":"https://avatars.githubusercontent.com/u/16779935?v=3","gravatar_id":"","url":"https://api.github.com/users/BiigY","html_url":"https://github.com/BiigY","followers_url":"https://api.github.com/users/BiigY/followers","following_url":"https://api.github.com/users/BiigY/following{/other_user}","gists_url":"https://api.github.com/users/BiigY/gists{/gist_id}","starred_url":"https://api.github.com/users/BiigY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BiigY/subscriptions","organizations_url":"https://api.github.com/users/BiigY/orgs","repos_url":"https://api.github.com/users/BiigY/repos","events_url":"https://api.github.com/users/BiigY/events{/privacy}","received_events_url":"https://api.github.com/users/BiigY/received_events","type":"User","site_admin":false},"body":"Admins can now update the type of user for existing users in the database via the users page, which now has select options for user types and update button. Every time the user type is changed, there will be a notification on top of the page that will give details of the update. Also the current user is disabled to change own user type due to a safety requirement.","created_at":"2016-03-29T15:42:31Z","updated_at":"2016-03-29T19:53:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e44998371e379c5d75778b7596c5e53fd3a6b52b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ndlib/annex-ims/pulls/146/commits","review_comments_url":"https://api.github.com/repos/ndlib/annex-ims/pulls/146/comments","review_comment_url":"https://api.github.com/repos/ndlib/annex-ims/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ndlib/annex-ims/issues/146/comments","statuses_url":"https://api.github.com/repos/ndlib/annex-ims/statuses/5e0b50723da79f576ce0d783e03716877a046468","head":{"label":"ndlib:AIMS-335-add-worker-permissions","ref":"AIMS-335-add-worker-permissions","sha":"5e0b50723da79f576ce0d783e03716877a046468","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":27182637,"name":"annex-ims","full_name":"ndlib/annex-ims","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/annex-ims","description":"IRIS: Integrated Retrieval and Inventory System","fork":false,"url":"https://api.github.com/repos/ndlib/annex-ims","forks_url":"https://api.github.com/repos/ndlib/annex-ims/forks","keys_url":"https://api.github.com/repos/ndlib/annex-ims/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/annex-ims/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/annex-ims/teams","hooks_url":"https://api.github.com/repos/ndlib/annex-ims/hooks","issue_events_url":"https://api.github.com/repos/ndlib/annex-ims/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/annex-ims/events","assignees_url":"https://api.github.com/repos/ndlib/annex-ims/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/annex-ims/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/annex-ims/tags","blobs_url":"https://api.github.com/repos/ndlib/annex-ims/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/annex-ims/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/annex-ims/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/annex-ims/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/annex-ims/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/annex-ims/languages","stargazers_url":"https://api.github.com/repos/ndlib/annex-ims/stargazers","contributors_url":"https://api.github.com/repos/ndlib/annex-ims/contributors","subscribers_url":"https://api.github.com/repos/ndlib/annex-ims/subscribers","subscription_url":"https://api.github.com/repos/ndlib/annex-ims/subscription","commits_url":"https://api.github.com/repos/ndlib/annex-ims/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/annex-ims/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/annex-ims/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/annex-ims/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/annex-ims/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/annex-ims/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/annex-ims/merges","archive_url":"https://api.github.com/repos/ndlib/annex-ims/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/annex-ims/downloads","issues_url":"https://api.github.com/repos/ndlib/annex-ims/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/annex-ims/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/annex-ims/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/annex-ims/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/annex-ims/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/annex-ims/releases{/id}","deployments_url":"https://api.github.com/repos/ndlib/annex-ims/deployments","created_at":"2014-11-26T15:16:57Z","updated_at":"2016-01-13T13:03:51Z","pushed_at":"2016-03-29T19:53:06Z","git_url":"git://github.com/ndlib/annex-ims.git","ssh_url":"git@github.com:ndlib/annex-ims.git","clone_url":"https://github.com/ndlib/annex-ims.git","svn_url":"https://github.com/ndlib/annex-ims","homepage":"","size":1045,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"ndlib:master","ref":"master","sha":"e83ad8e1c177b92a280c8668af6738c0016c2043","user":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"repo":{"id":27182637,"name":"annex-ims","full_name":"ndlib/annex-ims","owner":{"login":"ndlib","id":160943,"avatar_url":"https://avatars.githubusercontent.com/u/160943?v=3","gravatar_id":"","url":"https://api.github.com/users/ndlib","html_url":"https://github.com/ndlib","followers_url":"https://api.github.com/users/ndlib/followers","following_url":"https://api.github.com/users/ndlib/following{/other_user}","gists_url":"https://api.github.com/users/ndlib/gists{/gist_id}","starred_url":"https://api.github.com/users/ndlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndlib/subscriptions","organizations_url":"https://api.github.com/users/ndlib/orgs","repos_url":"https://api.github.com/users/ndlib/repos","events_url":"https://api.github.com/users/ndlib/events{/privacy}","received_events_url":"https://api.github.com/users/ndlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ndlib/annex-ims","description":"IRIS: Integrated Retrieval and Inventory System","fork":false,"url":"https://api.github.com/repos/ndlib/annex-ims","forks_url":"https://api.github.com/repos/ndlib/annex-ims/forks","keys_url":"https://api.github.com/repos/ndlib/annex-ims/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndlib/annex-ims/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndlib/annex-ims/teams","hooks_url":"https://api.github.com/repos/ndlib/annex-ims/hooks","issue_events_url":"https://api.github.com/repos/ndlib/annex-ims/issues/events{/number}","events_url":"https://api.github.com/repos/ndlib/annex-ims/events","assignees_url":"https://api.github.com/repos/ndlib/annex-ims/assignees{/user}","branches_url":"https://api.github.com/repos/ndlib/annex-ims/branches{/branch}","tags_url":"https://api.github.com/repos/ndlib/annex-ims/tags","blobs_url":"https://api.github.com/repos/ndlib/annex-ims/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndlib/annex-ims/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndlib/annex-ims/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndlib/annex-ims/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndlib/annex-ims/statuses/{sha}","languages_url":"https://api.github.com/repos/ndlib/annex-ims/languages","stargazers_url":"https://api.github.com/repos/ndlib/annex-ims/stargazers","contributors_url":"https://api.github.com/repos/ndlib/annex-ims/contributors","subscribers_url":"https://api.github.com/repos/ndlib/annex-ims/subscribers","subscription_url":"https://api.github.com/repos/ndlib/annex-ims/subscription","commits_url":"https://api.github.com/repos/ndlib/annex-ims/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndlib/annex-ims/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndlib/annex-ims/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndlib/annex-ims/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndlib/annex-ims/contents/{+path}","compare_url":"https://api.github.com/repos/ndlib/annex-ims/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndlib/annex-ims/merges","archive_url":"https://api.github.com/repos/ndlib/annex-ims/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndlib/annex-ims/downloads","issues_url":"https://api.github.com/repos/ndlib/annex-ims/issues{/number}","pulls_url":"https://api.github.com/repos/ndlib/annex-ims/pulls{/number}","milestones_url":"https://api.github.com/repos/ndlib/annex-ims/milestones{/number}","notifications_url":"https://api.github.com/repos/ndlib/annex-ims/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndlib/annex-ims/labels{/name}","releases_url":"https://api.github.com/repos/ndlib/annex-ims/releases{/id}","deployments_url":"https://api.github.com/repos/ndlib/annex-ims/deployments","created_at":"2014-11-26T15:16:57Z","updated_at":"2016-01-13T13:03:51Z","pushed_at":"2016-03-29T19:53:06Z","git_url":"git://github.com/ndlib/annex-ims.git","ssh_url":"git@github.com:ndlib/annex-ims.git","clone_url":"https://github.com/ndlib/annex-ims.git","svn_url":"https://github.com/ndlib/annex-ims","homepage":"","size":1045,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/146"},"html":{"href":"https://github.com/ndlib/annex-ims/pull/146"},"issue":{"href":"https://api.github.com/repos/ndlib/annex-ims/issues/146"},"comments":{"href":"https://api.github.com/repos/ndlib/annex-ims/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ndlib/annex-ims/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/ndlib/annex-ims/statuses/5e0b50723da79f576ce0d783e03716877a046468"}}}}