{"action":"created","comment":{"url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/comments/66151011","id":66151011,"diff_hunk":"@@ -20,27 +20,142 @@\n       end\n     end\n   end\n-  describe 'total score' do\n-    it 'should be zero when initialized' do\n+  describe 'total_score' do\n+    it 'initializes to zero' do\n       expect(participant.total_score).to eql 0\n     end\n-    it 'should increase by quiz score' do\n+    it 'increases by quiz score' do\n       quiz_score = create :quiz_score\n       expect { participant.update quiz_score: quiz_score }\n         .to change { participant.total_score }\n         .by(quiz_score.score)\n     end\n-    it 'should increase by circle check score' do\n+    it 'increases by circle check score' do\n       circle_check_score = create :circle_check_score\n       expect { participant.update circle_check_score: circle_check_score }\n         .to change { participant.total_score }\n         .by(circle_check_score.score)\n     end\n-    it 'should increase by onboard judging score' do\n+    it 'increases by onboard judging score' do\n       onboard_judging = create :onboard_judging\n       expect { participant.update onboard_judging: onboard_judging }\n         .to change { participant.total_score }\n         .by(onboard_judging.score)\n     end\n   end\n+  describe 'maneuver_score' do\n+    it 'returns the maneuver score' do\n+      maneuver_partip = create :maneuver_participant, :perfect_score\n+      expect(maneuver_partip.participant.maneuver_score).to eql 50\n+    end\n+  end\n+  describe 'display_information' do\n+    let!(:participant) { create :participant }\n+    context 'displays bus information' do\n+      it 'returns valid string' do\n+        expected = participant.bus.number\n+        expect(participant.display_information(:bus)).to eql expected\n+      end\n+    end\n+    context 'displays participant information' do\n+      it 'returns valid string' do\n+        expect(participant.display_information(:name)).to eql participant.name\n+      end\n+    end\n+    context 'displays number information' do\n+      it 'returns valid string' do\n+        expected = '#' + participant.number.to_s\n+        expect(participant.display_information(:number)).to eql expected\n+      end\n+    end\n+    context 'displays name' do\n+      it 'shows name' do\n+        participant.update! name: 'Person'\n+        expect(participant.display_information(:name)).to eql 'Person'\n+      end\n+    end\n+    context 'displays three options' do\n+      it 'splits up options' do\n+        name = participant.name\n+        bus_number = participant.bus.number\n+        number = participant.number.to_s\n+        exp =  name + ' (' + bus_number + ', #' + number + ')'\n+        expect(participant.display_information(:name, :bus, :number)).to eql exp\n+      end\n+    end\n+  end\n+  describe 'next_number' do\n+    it 'returns the last non-nil participant number' do\n+      create :participant\n+      p_2 = create :participant\n+      expect(Participant.next_number).to eql p_2.number + 1\n+    end\n+  end\n+end\n+describe 'scoreboard order' do\n+  context 'total score' do\n+    it 'sorts participants by total score' do\n+      onboard_judge_1 = create :onboard_judging, :perfect\n+      onboard_judge_2 = create :onboard_judging, minutes_elapsed: 8\n+      onboard_judge_3 = create :onboard_judging, minutes_elapsed: 9\n+      participant_1 = onboard_judge_1.participant\n+      participant_2 = onboard_judge_2.participant\n+      participant_3 = onboard_judge_3.participant\n+      expected = [participant_1, participant_2, participant_3]\n+      expect(Participant.scoreboard_order(:total_score)).to eql expected\n+    end\n+  end\n+  context 'maneuver score' do\n+    it 'sorts participants by maneuver score' do\n+      maneuver_partip_1 = create :maneuver_participant, :perfect_score\n+      maneuver_partip_2 = create :maneuver_participant,\n+                                 :perfect_score, reversed_direction: 1\n+      maneuver_partip_3 = create :maneuver_participant,\n+                                 :perfect_score, reversed_direction: 2\n+      participant_1 = maneuver_partip_1.participant\n+      participant_2 = maneuver_partip_2.participant\n+      participant_3 = maneuver_partip_3.participant\n+      expected = [participant_1, participant_2, participant_3]\n+      expect(Participant.scoreboard_order(:maneuver_score)).to eql expected\n+    end\n+  end\n+  context 'participant_name' do\n+    it 'sorts participants by participant name' do\n+      participant_1 = create :participant, name: 'Akiva'\n+      participant_2 = create :participant, name: 'Arta'\n+      participant_3 = create :participant, name: 'Molly'\n+      expected = [participant_1, participant_2, participant_3]\n+      expect(Participant.scoreboard_order(:participant_name)).to eq expected\n+    end\n+  end\n+  context 'participant_number' do\n+    it 'sorts participants by participant number' do\n+      participant_1 = create :participant\n+      participant_2 = create :participant\n+      participant_3 = create :participant\n+      expected = [participant_1, participant_2, participant_3]\n+      expect(Participant.scoreboard_order(:participant_number)).to eq expected\n+    end\n+  end\n+end\n+\n+describe 'top_20' do\n+  context 'excluding anyone not in top 20' do\n+    it 'exludes participant with 21st highest score' do\n+      20.times { create :maneuver_participant, :perfect_score }\n+      create :maneuver_participant, :perfect_score,\n+             reversed_direction: 2\n+      top_20 = Participant.top_20\n+      expect !top_20.include?(Participant.last)","path":"spec/models/participant_spec.rb","position":135,"original_position":135,"commit_id":"c7dabab28f5eb08c7a1ea79407133ce8ed3aa689","original_commit_id":"c7dabab28f5eb08c7a1ea79407133ce8ed3aa689","user":{"login":"dfaulken","id":3988134,"avatar_url":"https://avatars.githubusercontent.com/u/3988134?v=3","gravatar_id":"","url":"https://api.github.com/users/dfaulken","html_url":"https://github.com/dfaulken","followers_url":"https://api.github.com/users/dfaulken/followers","following_url":"https://api.github.com/users/dfaulken/following{/other_user}","gists_url":"https://api.github.com/users/dfaulken/gists{/gist_id}","starred_url":"https://api.github.com/users/dfaulken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfaulken/subscriptions","organizations_url":"https://api.github.com/users/dfaulken/orgs","repos_url":"https://api.github.com/users/dfaulken/repos","events_url":"https://api.github.com/users/dfaulken/events{/privacy}","received_events_url":"https://api.github.com/users/dfaulken/received_events","type":"User","site_admin":false},"body":"expect(top_20).not_to include Participant.last","created_at":"2016-06-07T20:55:58Z","updated_at":"2016-06-07T20:55:58Z","html_url":"https://github.com/umts/umasstransit.rodeo/pull/47#discussion_r66151011","pull_request_url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/comments/66151011"},"html":{"href":"https://github.com/umts/umasstransit.rodeo/pull/47#discussion_r66151011"},"pull_request":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47","id":72742838,"html_url":"https://github.com/umts/umasstransit.rodeo/pull/47","diff_url":"https://github.com/umts/umasstransit.rodeo/pull/47.diff","patch_url":"https://github.com/umts/umasstransit.rodeo/pull/47.patch","issue_url":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/47","number":47,"state":"open","locked":false,"title":"Signup and Roles Page with Specs","user":{"login":"AkivaGreen","id":15308734,"avatar_url":"https://avatars.githubusercontent.com/u/15308734?v=3","gravatar_id":"","url":"https://api.github.com/users/AkivaGreen","html_url":"https://github.com/AkivaGreen","followers_url":"https://api.github.com/users/AkivaGreen/followers","following_url":"https://api.github.com/users/AkivaGreen/following{/other_user}","gists_url":"https://api.github.com/users/AkivaGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/AkivaGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkivaGreen/subscriptions","organizations_url":"https://api.github.com/users/AkivaGreen/orgs","repos_url":"https://api.github.com/users/AkivaGreen/repos","events_url":"https://api.github.com/users/AkivaGreen/events{/privacy}","received_events_url":"https://api.github.com/users/AkivaGreen/received_events","type":"User","site_admin":false},"body":"Addresses #15 ","created_at":"2016-06-06T16:58:49Z","updated_at":"2016-06-07T20:55:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0af436fdcadd61be44e2b1dd747f61d6dd4bd958","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47/commits","review_comments_url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47/comments","review_comment_url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/47/comments","statuses_url":"https://api.github.com/repos/umts/umasstransit.rodeo/statuses/c7dabab28f5eb08c7a1ea79407133ce8ed3aa689","head":{"label":"AkivaGreen:master","ref":"master","sha":"c7dabab28f5eb08c7a1ea79407133ce8ed3aa689","user":{"login":"AkivaGreen","id":15308734,"avatar_url":"https://avatars.githubusercontent.com/u/15308734?v=3","gravatar_id":"","url":"https://api.github.com/users/AkivaGreen","html_url":"https://github.com/AkivaGreen","followers_url":"https://api.github.com/users/AkivaGreen/followers","following_url":"https://api.github.com/users/AkivaGreen/following{/other_user}","gists_url":"https://api.github.com/users/AkivaGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/AkivaGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkivaGreen/subscriptions","organizations_url":"https://api.github.com/users/AkivaGreen/orgs","repos_url":"https://api.github.com/users/AkivaGreen/repos","events_url":"https://api.github.com/users/AkivaGreen/events{/privacy}","received_events_url":"https://api.github.com/users/AkivaGreen/received_events","type":"User","site_admin":false},"repo":{"id":59503322,"name":"umasstransit.rodeo","full_name":"AkivaGreen/umasstransit.rodeo","owner":{"login":"AkivaGreen","id":15308734,"avatar_url":"https://avatars.githubusercontent.com/u/15308734?v=3","gravatar_id":"","url":"https://api.github.com/users/AkivaGreen","html_url":"https://github.com/AkivaGreen","followers_url":"https://api.github.com/users/AkivaGreen/followers","following_url":"https://api.github.com/users/AkivaGreen/following{/other_user}","gists_url":"https://api.github.com/users/AkivaGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/AkivaGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkivaGreen/subscriptions","organizations_url":"https://api.github.com/users/AkivaGreen/orgs","repos_url":"https://api.github.com/users/AkivaGreen/repos","events_url":"https://api.github.com/users/AkivaGreen/events{/privacy}","received_events_url":"https://api.github.com/users/AkivaGreen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AkivaGreen/umasstransit.rodeo","description":"Website for our annual Roadeo safety driving competition.","fork":true,"url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo","forks_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/forks","keys_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/teams","hooks_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/hooks","issue_events_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/issues/events{/number}","events_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/events","assignees_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/assignees{/user}","branches_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/branches{/branch}","tags_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/tags","blobs_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/statuses/{sha}","languages_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/languages","stargazers_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/stargazers","contributors_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/contributors","subscribers_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/subscribers","subscription_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/subscription","commits_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/contents/{+path}","compare_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/merges","archive_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/downloads","issues_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/issues{/number}","pulls_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/pulls{/number}","milestones_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/milestones{/number}","notifications_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/labels{/name}","releases_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/releases{/id}","deployments_url":"https://api.github.com/repos/AkivaGreen/umasstransit.rodeo/deployments","created_at":"2016-05-23T17:18:52Z","updated_at":"2016-05-23T17:18:53Z","pushed_at":"2016-06-07T18:36:47Z","git_url":"git://github.com/AkivaGreen/umasstransit.rodeo.git","ssh_url":"git@github.com:AkivaGreen/umasstransit.rodeo.git","clone_url":"https://github.com/AkivaGreen/umasstransit.rodeo.git","svn_url":"https://github.com/AkivaGreen/umasstransit.rodeo","homepage":"","size":7100,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"umts:master","ref":"master","sha":"27d275eb02e6f81310fdebd0e281364069e00ddc","user":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"repo":{"id":54588283,"name":"umasstransit.rodeo","full_name":"umts/umasstransit.rodeo","owner":{"login":"umts","id":398175,"avatar_url":"https://avatars.githubusercontent.com/u/398175?v=3","gravatar_id":"","url":"https://api.github.com/users/umts","html_url":"https://github.com/umts","followers_url":"https://api.github.com/users/umts/followers","following_url":"https://api.github.com/users/umts/following{/other_user}","gists_url":"https://api.github.com/users/umts/gists{/gist_id}","starred_url":"https://api.github.com/users/umts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umts/subscriptions","organizations_url":"https://api.github.com/users/umts/orgs","repos_url":"https://api.github.com/users/umts/repos","events_url":"https://api.github.com/users/umts/events{/privacy}","received_events_url":"https://api.github.com/users/umts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/umts/umasstransit.rodeo","description":"Website for our annual Roadeo safety driving competition.","fork":false,"url":"https://api.github.com/repos/umts/umasstransit.rodeo","forks_url":"https://api.github.com/repos/umts/umasstransit.rodeo/forks","keys_url":"https://api.github.com/repos/umts/umasstransit.rodeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umts/umasstransit.rodeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umts/umasstransit.rodeo/teams","hooks_url":"https://api.github.com/repos/umts/umasstransit.rodeo/hooks","issue_events_url":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/events{/number}","events_url":"https://api.github.com/repos/umts/umasstransit.rodeo/events","assignees_url":"https://api.github.com/repos/umts/umasstransit.rodeo/assignees{/user}","branches_url":"https://api.github.com/repos/umts/umasstransit.rodeo/branches{/branch}","tags_url":"https://api.github.com/repos/umts/umasstransit.rodeo/tags","blobs_url":"https://api.github.com/repos/umts/umasstransit.rodeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umts/umasstransit.rodeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umts/umasstransit.rodeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/umts/umasstransit.rodeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umts/umasstransit.rodeo/statuses/{sha}","languages_url":"https://api.github.com/repos/umts/umasstransit.rodeo/languages","stargazers_url":"https://api.github.com/repos/umts/umasstransit.rodeo/stargazers","contributors_url":"https://api.github.com/repos/umts/umasstransit.rodeo/contributors","subscribers_url":"https://api.github.com/repos/umts/umasstransit.rodeo/subscribers","subscription_url":"https://api.github.com/repos/umts/umasstransit.rodeo/subscription","commits_url":"https://api.github.com/repos/umts/umasstransit.rodeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/umts/umasstransit.rodeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/umts/umasstransit.rodeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/umts/umasstransit.rodeo/contents/{+path}","compare_url":"https://api.github.com/repos/umts/umasstransit.rodeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umts/umasstransit.rodeo/merges","archive_url":"https://api.github.com/repos/umts/umasstransit.rodeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umts/umasstransit.rodeo/downloads","issues_url":"https://api.github.com/repos/umts/umasstransit.rodeo/issues{/number}","pulls_url":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls{/number}","milestones_url":"https://api.github.com/repos/umts/umasstransit.rodeo/milestones{/number}","notifications_url":"https://api.github.com/repos/umts/umasstransit.rodeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umts/umasstransit.rodeo/labels{/name}","releases_url":"https://api.github.com/repos/umts/umasstransit.rodeo/releases{/id}","deployments_url":"https://api.github.com/repos/umts/umasstransit.rodeo/deployments","created_at":"2016-03-23T19:43:19Z","updated_at":"2016-04-27T20:27:14Z","pushed_at":"2016-06-07T18:37:12Z","git_url":"git://github.com/umts/umasstransit.rodeo.git","ssh_url":"git@github.com:umts/umasstransit.rodeo.git","clone_url":"https://github.com/umts/umasstransit.rodeo.git","svn_url":"https://github.com/umts/umasstransit.rodeo","homepage":"","size":7084,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47"},"html":{"href":"https://github.com/umts/umasstransit.rodeo/pull/47"},"issue":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/47"},"comments":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/umts/umasstransit.rodeo/statuses/c7dabab28f5eb08c7a1ea79407133ce8ed3aa689"}}}}
{"actor":{"display_login":"dfaulken"}}