{"action":"created","comment":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/62722164","id":62722164,"diff_hunk":"@@ -571,4 +571,79 @@\n       end\n     end\n   end\n+\n+  describe 'GET #my_competitions' do","path":"WcaOnRails/spec/controllers/competitions_controller_spec.rb","position":5,"original_position":5,"commit_id":"d02034b308553a02b4f0bd16eec8ecb2e6982c16","original_commit_id":"d02034b308553a02b4f0bd16eec8ecb2e6982c16","user":{"login":"larspetrus","id":755243,"avatar_url":"https://avatars.githubusercontent.com/u/755243?v=3","gravatar_id":"","url":"https://api.github.com/users/larspetrus","html_url":"https://github.com/larspetrus","followers_url":"https://api.github.com/users/larspetrus/followers","following_url":"https://api.github.com/users/larspetrus/following{/other_user}","gists_url":"https://api.github.com/users/larspetrus/gists{/gist_id}","starred_url":"https://api.github.com/users/larspetrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larspetrus/subscriptions","organizations_url":"https://api.github.com/users/larspetrus/orgs","repos_url":"https://api.github.com/users/larspetrus/repos","events_url":"https://api.github.com/users/larspetrus/events{/privacy}","received_events_url":"https://api.github.com/users/larspetrus/received_events","type":"User","site_admin":false},"body":"This is a good and ambitious test! \r\n\r\nSome improvements/suggestions:\r\n\r\n* I don't see any test of the ` || Date.today + 20.year` part. If you remove that, I assume the test still passes? You probably need a competition without start date.\r\n\r\n* The value of @competitions is not tested. If it's used, it should be tested. If not, it should lose the @.\r\n\r\n* The \"one assertion per test\" pattern gets very wordy and a bit confusing here. I would do them like this:\r\n\r\n    context 'when signed in as an organizer user' do\r\n      it 'shows my past and upcoming competitions' do\r\n        sign_in organizer1\r\n\r\n        get :my_competitions\r\n\r\n        expect(assigns(:not_past_competitions)).to eq [future_competition1, future_competition2, future_competition3]\r\n        expect(assigns(:past_competitions)).to eq [past_competition1, past_competition3]\r\n      end\r\n    end\r\n","created_at":"2016-05-10T18:06:30Z","updated_at":"2016-05-10T18:06:30Z","html_url":"https://github.com/cubing/worldcubeassociation.org/pull/597#discussion_r62722164","pull_request_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597","_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/62722164"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/597#discussion_r62722164"},"pull_request":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597"}}},"pull_request":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597","id":69342473,"html_url":"https://github.com/cubing/worldcubeassociation.org/pull/597","diff_url":"https://github.com/cubing/worldcubeassociation.org/pull/597.diff","patch_url":"https://github.com/cubing/worldcubeassociation.org/pull/597.patch","issue_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/597","number":597,"state":"open","locked":false,"title":"On the \"My competitions\" page show competitions without a date or country","user":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"body":"Fixes #495. I modified competitions_controller.rb to put all competitions without a start date first and then sort all competitions that have a start date in reverse order. To ensure the date_range was displayed without error I modified the wca_date_range method to only return the date_range if both a from_date and to_date are passed in. In the view I fixed a bug with <tbody> being shown for each row. Only display the country.name if the country has been selected.\r\n\r\nLet me know your thoughts.","created_at":"2016-05-09T13:09:35Z","updated_at":"2016-05-10T18:06:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ea1ba4e0beb23eae550567a39c2304b8e80775c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597/commits","review_comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597/comments","review_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/597/comments","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/d02034b308553a02b4f0bd16eec8ecb2e6982c16","head":{"label":"pingskills:iss495","ref":"iss495","sha":"d02034b308553a02b4f0bd16eec8ecb2e6982c16","user":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"repo":{"id":56292449,"name":"worldcubeassociation.org","full_name":"pingskills/worldcubeassociation.org","owner":{"login":"pingskills","id":4403168,"avatar_url":"https://avatars.githubusercontent.com/u/4403168?v=3","gravatar_id":"","url":"https://api.github.com/users/pingskills","html_url":"https://github.com/pingskills","followers_url":"https://api.github.com/users/pingskills/followers","following_url":"https://api.github.com/users/pingskills/following{/other_user}","gists_url":"https://api.github.com/users/pingskills/gists{/gist_id}","starred_url":"https://api.github.com/users/pingskills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingskills/subscriptions","organizations_url":"https://api.github.com/users/pingskills/orgs","repos_url":"https://api.github.com/users/pingskills/repos","events_url":"https://api.github.com/users/pingskills/events{/privacy}","received_events_url":"https://api.github.com/users/pingskills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pingskills/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":true,"url":"https://api.github.com/repos/pingskills/worldcubeassociation.org","forks_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/pingskills/worldcubeassociation.org/deployments","created_at":"2016-04-15T05:05:13Z","updated_at":"2016-04-15T05:05:21Z","pushed_at":"2016-05-10T14:41:54Z","git_url":"git://github.com/pingskills/worldcubeassociation.org.git","ssh_url":"git@github.com:pingskills/worldcubeassociation.org.git","clone_url":"https://github.com/pingskills/worldcubeassociation.org.git","svn_url":"https://github.com/pingskills/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":54642,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"cubing:master","ref":"master","sha":"9998edd118e34b0d86df316ebb2a58ffab6f64fe","user":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"repo":{"id":34161579,"name":"worldcubeassociation.org","full_name":"cubing/worldcubeassociation.org","owner":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cubing/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":false,"url":"https://api.github.com/repos/cubing/worldcubeassociation.org","forks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/deployments","created_at":"2015-04-18T10:21:53Z","updated_at":"2016-05-05T14:39:14Z","pushed_at":"2016-05-10T17:44:54Z","git_url":"git://github.com/cubing/worldcubeassociation.org.git","ssh_url":"git@github.com:cubing/worldcubeassociation.org.git","clone_url":"https://github.com/cubing/worldcubeassociation.org.git","svn_url":"https://github.com/cubing/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":54780,"stargazers_count":13,"watchers_count":13,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":150,"forks":26,"open_issues":150,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/597"},"issue":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/597"},"comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/597/comments"},"review_comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597/comments"},"review_comment":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/597/commits"},"statuses":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/d02034b308553a02b4f0bd16eec8ecb2e6982c16"}}}}