{"action":"created","comment":{"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments/45398652","id":45398652,"diff_hunk":"@@ -0,0 +1,76 @@\n+require 'rails_helper'\n+include Devise::TestHelpers\n+\n+RSpec.describe AgencyAdminController, type: :controller do\n+\n+  context 'Routing' do\n+    it 'routes GET /agency_admin/home to agency_admin#home' do\n+      expect(get: '/agency_admin/home').to route_to(\n+            controller: 'agency_admin', action: 'home')\n+    end\n+  end\n+  \n+  describe 'Determine from signed-in user:' do\n+    before(:each) do\n+      @agency = FactoryGirl.create(:agency)\n+      @manager_role = FactoryGirl.create(:agency_role,\n+                              role: AgencyRole::ROLE[:AM])\n+      @admin_role   = FactoryGirl.create(:agency_role,\n+                              role: AgencyRole::ROLE[:AA])\n+      @job_developer_role = FactoryGirl.create(:agency_role,\n+                              role: AgencyRole::ROLE[:JD])\n+      \n+      @agency_manager = FactoryGirl.build(:agency_person, agency: @agency)\n+      @agency_manager.agency_roles << @manager_role\n+      @agency_manager.save!\n+      \n+      @agency_admin = FactoryGirl.build(:agency_person, agency: @agency)\n+      @agency_admin.agency_roles << @admin_role\n+      @agency_admin.save!\n+      \n+      @job_developer = FactoryGirl.build(:agency_person, agency: @agency)\n+      @job_developer.agency_roles << @job_developer_role\n+      @job_developer.save!\n+    end\n+    \n+    it 'this agency - from agency manager' do\n+      sign_in @agency_manager\n+      expect(Agency.this_agency(@agency_manager)).to eq @agency","path":"spec/controllers/agency_admin_controller_spec.rb","position":null,"original_position":38,"commit_id":"bc613d6cb2c51ab28da07ff9041a2a414ac2fa4a","original_commit_id":"bf3dbc594bee795fc9e26844e75455e8db27c99b","user":{"login":"patmbolger","id":9968213,"avatar_url":"https://avatars.githubusercontent.com/u/9968213?v=3","gravatar_id":"","url":"https://api.github.com/users/patmbolger","html_url":"https://github.com/patmbolger","followers_url":"https://api.github.com/users/patmbolger/followers","following_url":"https://api.github.com/users/patmbolger/following{/other_user}","gists_url":"https://api.github.com/users/patmbolger/gists{/gist_id}","starred_url":"https://api.github.com/users/patmbolger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patmbolger/subscriptions","organizations_url":"https://api.github.com/users/patmbolger/orgs","repos_url":"https://api.github.com/users/patmbolger/repos","events_url":"https://api.github.com/users/patmbolger/events{/privacy}","received_events_url":"https://api.github.com/users/patmbolger/received_events","type":"User","site_admin":false},"body":"My point is that 'current_user' does not seem to be available in the spec test, but I think it *should* be.  I may need some help to get that to work.","created_at":"2015-11-19T20:54:00Z","updated_at":"2015-11-19T20:54:00Z","html_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/127#discussion_r45398652","pull_request_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments/45398652"},"html":{"href":"https://github.com/AgileVentures/MetPlus_PETS/pull/127#discussion_r45398652"},"pull_request":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127","id":51141729,"html_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/127","diff_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/127.diff","patch_url":"https://github.com/AgileVentures/MetPlus_PETS/pull/127.patch","issue_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/127","number":127,"state":"open","locked":false,"title":"Connects to AgileVentures/MetPlus_tracker#11","user":{"login":"patmbolger","id":9968213,"avatar_url":"https://avatars.githubusercontent.com/u/9968213?v=3","gravatar_id":"","url":"https://api.github.com/users/patmbolger","html_url":"https://github.com/patmbolger","followers_url":"https://api.github.com/users/patmbolger/followers","following_url":"https://api.github.com/users/patmbolger/following{/other_user}","gists_url":"https://api.github.com/users/patmbolger/gists{/gist_id}","starred_url":"https://api.github.com/users/patmbolger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patmbolger/subscriptions","organizations_url":"https://api.github.com/users/patmbolger/orgs","repos_url":"https://api.github.com/users/patmbolger/repos","events_url":"https://api.github.com/users/patmbolger/events{/privacy}","received_events_url":"https://api.github.com/users/patmbolger/received_events","type":"User","site_admin":false},"body":"- Added agency_admin controller and functional tests for that controller\r\n- Added \"Admin\" button to main menu if signed_in user is Agency Admin\r\n- Implemented initial \"main admin\" page\r\n- Added methods to determine 1) agency, 2) agency admin and 3) agency manager from sign in user (if user is an AgencyPerson)\r\n- Added a constant (ROLE) to AgencyRole and CompanyRole.  This specifies the exact strings to be used for the various roles.\r\n- Changed code to reflect use of these constants (factories, unit tests, seeds.db, etc.)\r\n- Added 'fax' and 'description' attributes to Agency\r\n- Added initial cucumber scenarios for agency admin features (log in, go to main admin page)","created_at":"2015-11-18T21:03:19Z","updated_at":"2015-11-19T20:54:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad53feebee4f35f29bd25ecbebb9eb620cd72ec2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127/commits","review_comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127/comments","review_comment_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/127/comments","statuses_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/bc613d6cb2c51ab28da07ff9041a2a414ac2fa4a","head":{"label":"patmbolger:admin-login","ref":"admin-login","sha":"bc613d6cb2c51ab28da07ff9041a2a414ac2fa4a","user":{"login":"patmbolger","id":9968213,"avatar_url":"https://avatars.githubusercontent.com/u/9968213?v=3","gravatar_id":"","url":"https://api.github.com/users/patmbolger","html_url":"https://github.com/patmbolger","followers_url":"https://api.github.com/users/patmbolger/followers","following_url":"https://api.github.com/users/patmbolger/following{/other_user}","gists_url":"https://api.github.com/users/patmbolger/gists{/gist_id}","starred_url":"https://api.github.com/users/patmbolger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patmbolger/subscriptions","organizations_url":"https://api.github.com/users/patmbolger/orgs","repos_url":"https://api.github.com/users/patmbolger/repos","events_url":"https://api.github.com/users/patmbolger/events{/privacy}","received_events_url":"https://api.github.com/users/patmbolger/received_events","type":"User","site_admin":false},"repo":{"id":42128421,"name":"MetPlus_PETS","full_name":"patmbolger/MetPlus_PETS","owner":{"login":"patmbolger","id":9968213,"avatar_url":"https://avatars.githubusercontent.com/u/9968213?v=3","gravatar_id":"","url":"https://api.github.com/users/patmbolger","html_url":"https://github.com/patmbolger","followers_url":"https://api.github.com/users/patmbolger/followers","following_url":"https://api.github.com/users/patmbolger/following{/other_user}","gists_url":"https://api.github.com/users/patmbolger/gists{/gist_id}","starred_url":"https://api.github.com/users/patmbolger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patmbolger/subscriptions","organizations_url":"https://api.github.com/users/patmbolger/orgs","repos_url":"https://api.github.com/users/patmbolger/repos","events_url":"https://api.github.com/users/patmbolger/events{/privacy}","received_events_url":"https://api.github.com/users/patmbolger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/patmbolger/MetPlus_PETS","description":"Front End for the MetPlus project","fork":true,"url":"https://api.github.com/repos/patmbolger/MetPlus_PETS","forks_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/forks","keys_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/teams","hooks_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/hooks","issue_events_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/issues/events{/number}","events_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/events","assignees_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/assignees{/user}","branches_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/branches{/branch}","tags_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/tags","blobs_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/git/refs{/sha}","trees_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/statuses/{sha}","languages_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/languages","stargazers_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/stargazers","contributors_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/contributors","subscribers_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/subscribers","subscription_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/subscription","commits_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/commits{/sha}","git_commits_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/git/commits{/sha}","comments_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/comments{/number}","issue_comment_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/issues/comments{/number}","contents_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/contents/{+path}","compare_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/merges","archive_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/downloads","issues_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/issues{/number}","pulls_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/pulls{/number}","milestones_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/milestones{/number}","notifications_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/labels{/name}","releases_url":"https://api.github.com/repos/patmbolger/MetPlus_PETS/releases{/id}","created_at":"2015-09-08T17:37:16Z","updated_at":"2015-09-08T17:37:17Z","pushed_at":"2015-11-19T20:38:25Z","git_url":"git://github.com/patmbolger/MetPlus_PETS.git","ssh_url":"git@github.com:patmbolger/MetPlus_PETS.git","clone_url":"https://github.com/patmbolger/MetPlus_PETS.git","svn_url":"https://github.com/patmbolger/MetPlus_PETS","homepage":null,"size":307,"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":"AgileVentures:development","ref":"development","sha":"1c8ca3f61cae0dd7c0ea07e32031a7a1959a5e31","user":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"repo":{"id":41921394,"name":"MetPlus_PETS","full_name":"AgileVentures/MetPlus_PETS","owner":{"login":"AgileVentures","id":5116968,"avatar_url":"https://avatars.githubusercontent.com/u/5116968?v=3","gravatar_id":"","url":"https://api.github.com/users/AgileVentures","html_url":"https://github.com/AgileVentures","followers_url":"https://api.github.com/users/AgileVentures/followers","following_url":"https://api.github.com/users/AgileVentures/following{/other_user}","gists_url":"https://api.github.com/users/AgileVentures/gists{/gist_id}","starred_url":"https://api.github.com/users/AgileVentures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AgileVentures/subscriptions","organizations_url":"https://api.github.com/users/AgileVentures/orgs","repos_url":"https://api.github.com/users/AgileVentures/repos","events_url":"https://api.github.com/users/AgileVentures/events{/privacy}","received_events_url":"https://api.github.com/users/AgileVentures/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AgileVentures/MetPlus_PETS","description":"Front End for the MetPlus project","fork":false,"url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS","forks_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/forks","keys_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/teams","hooks_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/hooks","issue_events_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/events{/number}","events_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/events","assignees_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/assignees{/user}","branches_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/branches{/branch}","tags_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/tags","blobs_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/{sha}","languages_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/languages","stargazers_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/stargazers","contributors_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/contributors","subscribers_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/subscribers","subscription_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/subscription","commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/contents/{+path}","compare_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/merges","archive_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/downloads","issues_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues{/number}","pulls_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls{/number}","milestones_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/milestones{/number}","notifications_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/labels{/name}","releases_url":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/releases{/id}","created_at":"2015-09-04T14:51:35Z","updated_at":"2015-09-04T15:28:43Z","pushed_at":"2015-11-19T20:53:05Z","git_url":"git://github.com/AgileVentures/MetPlus_PETS.git","ssh_url":"git@github.com:AgileVentures/MetPlus_PETS.git","clone_url":"https://github.com/AgileVentures/MetPlus_PETS.git","svn_url":"https://github.com/AgileVentures/MetPlus_PETS","homepage":null,"size":967,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":4,"forks":10,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127"},"html":{"href":"https://github.com/AgileVentures/MetPlus_PETS/pull/127"},"issue":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/127"},"comments":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/AgileVentures/MetPlus_PETS/statuses/bc613d6cb2c51ab28da07ff9041a2a414ac2fa4a"}}}}