{"action":"created","comment":{"url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/comments/235962785","pull_request_review_id":177954238,"id":235962785,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTk2Mjc4NQ==","diff_hunk":"@@ -0,0 +1,46 @@\n+require 'rails_helper'\n+\n+RSpec.describe HomePageViewModel do\n+  describe '#featured_events' do\n+    context 'when there are no events' do\n+      subject { described_class.new.featured_events }\n+\n+      it 'should return empty' do\n+        is_expected.to be_empty\n+      end\n+    end\n+\n+    context 'when events exist' do\n+      let!(:event1) { FactoryBot.create :event }\n+      let!(:event2) { FactoryBot.create :event }\n+      let!(:event3) { FactoryBot.create :event }\n+      let!(:event4) { FactoryBot.create :event }\n+      subject { described_class.new.featured_events }\n+\n+      it 'should return last 3' do\n+        is_expected.to eq([event4, event3, event2])\n+      end\n+    end\n+  end\n+\n+  describe '#losest_events' do\n+    context 'when there are no events' do\n+      subject { described_class.new.closest_events }\n+\n+      it 'should return empty' do\n+        is_expected.to be_empty\n+      end\n+    end\n+    context 'when events exist' do\n+      let!(:event1) { FactoryBot.create :event }\n+      let!(:event2) { FactoryBot.create :event }\n+      let!(:event3) { FactoryBot.create :event }\n+      let!(:event4) { FactoryBot.create :event }\n+      subject { described_class.new.closest_events }\n+\n+      it 'should return closest 3' do\n+        is_expected.to eq([event1, event2, event3, event4].sort_by(&:date).take(3))","path":"spec/view_models/home_page_view_model_spec.rb","position":42,"original_position":42,"commit_id":"dbda0fbb3167367ba0e6572500b1c7b21d54938d","original_commit_id":"dbda0fbb3167367ba0e6572500b1c7b21d54938d","user":{"login":"piotrimbierowicz","id":1816352,"node_id":"MDQ6VXNlcjE4MTYzNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1816352?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrimbierowicz","html_url":"https://github.com/piotrimbierowicz","followers_url":"https://api.github.com/users/piotrimbierowicz/followers","following_url":"https://api.github.com/users/piotrimbierowicz/following{/other_user}","gists_url":"https://api.github.com/users/piotrimbierowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrimbierowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrimbierowicz/subscriptions","organizations_url":"https://api.github.com/users/piotrimbierowicz/orgs","repos_url":"https://api.github.com/users/piotrimbierowicz/repos","events_url":"https://api.github.com/users/piotrimbierowicz/events{/privacy}","received_events_url":"https://api.github.com/users/piotrimbierowicz/received_events","type":"User","site_admin":false},"body":"Użycie `.sort_by(&:date).take(3)` jest zdradliwe, bo czasem nie wiadomio czy `date` nie będzie nilem w teście (w dużym projekcie łatwo o zmianę `spec/factories/events.rb` przez innego członka zespołu) i wtedy test może przechodzić, ale nie będzie rzetelny ","created_at":"2018-11-23T14:52:15Z","updated_at":"2018-11-23T14:52:15Z","html_url":"https://github.com/Zvrbsky/ror_project/pull/3#discussion_r235962785","pull_request_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/comments/235962785"},"html":{"href":"https://github.com/Zvrbsky/ror_project/pull/3#discussion_r235962785"},"pull_request":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3"}},"in_reply_to_id":235962238},"pull_request":{"url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3","id":232138426,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMTM4NDI2","html_url":"https://github.com/Zvrbsky/ror_project/pull/3","diff_url":"https://github.com/Zvrbsky/ror_project/pull/3.diff","patch_url":"https://github.com/Zvrbsky/ror_project/pull/3.patch","issue_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/3","number":3,"state":"open","locked":false,"title":"Week4","user":{"login":"Zvrbsky","id":34569565,"node_id":"MDQ6VXNlcjM0NTY5NTY1","avatar_url":"https://avatars1.githubusercontent.com/u/34569565?v=4","gravatar_id":"","url":"https://api.github.com/users/Zvrbsky","html_url":"https://github.com/Zvrbsky","followers_url":"https://api.github.com/users/Zvrbsky/followers","following_url":"https://api.github.com/users/Zvrbsky/following{/other_user}","gists_url":"https://api.github.com/users/Zvrbsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Zvrbsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zvrbsky/subscriptions","organizations_url":"https://api.github.com/users/Zvrbsky/orgs","repos_url":"https://api.github.com/users/Zvrbsky/repos","events_url":"https://api.github.com/users/Zvrbsky/events{/privacy}","received_events_url":"https://api.github.com/users/Zvrbsky/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-19T22:54:58Z","updated_at":"2018-11-23T14:52:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89597834f43fba8e5861a3a0c114b2df6f3db9e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/3/comments","statuses_url":"https://api.github.com/repos/Zvrbsky/ror_project/statuses/dbda0fbb3167367ba0e6572500b1c7b21d54938d","head":{"label":"Zvrbsky:week4","ref":"week4","sha":"dbda0fbb3167367ba0e6572500b1c7b21d54938d","user":{"login":"Zvrbsky","id":34569565,"node_id":"MDQ6VXNlcjM0NTY5NTY1","avatar_url":"https://avatars1.githubusercontent.com/u/34569565?v=4","gravatar_id":"","url":"https://api.github.com/users/Zvrbsky","html_url":"https://github.com/Zvrbsky","followers_url":"https://api.github.com/users/Zvrbsky/followers","following_url":"https://api.github.com/users/Zvrbsky/following{/other_user}","gists_url":"https://api.github.com/users/Zvrbsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Zvrbsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zvrbsky/subscriptions","organizations_url":"https://api.github.com/users/Zvrbsky/orgs","repos_url":"https://api.github.com/users/Zvrbsky/repos","events_url":"https://api.github.com/users/Zvrbsky/events{/privacy}","received_events_url":"https://api.github.com/users/Zvrbsky/received_events","type":"User","site_admin":false},"repo":{"id":153003649,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwMDM2NDk=","name":"ror_project","full_name":"Zvrbsky/ror_project","private":false,"owner":{"login":"Zvrbsky","id":34569565,"node_id":"MDQ6VXNlcjM0NTY5NTY1","avatar_url":"https://avatars1.githubusercontent.com/u/34569565?v=4","gravatar_id":"","url":"https://api.github.com/users/Zvrbsky","html_url":"https://github.com/Zvrbsky","followers_url":"https://api.github.com/users/Zvrbsky/followers","following_url":"https://api.github.com/users/Zvrbsky/following{/other_user}","gists_url":"https://api.github.com/users/Zvrbsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Zvrbsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zvrbsky/subscriptions","organizations_url":"https://api.github.com/users/Zvrbsky/orgs","repos_url":"https://api.github.com/users/Zvrbsky/repos","events_url":"https://api.github.com/users/Zvrbsky/events{/privacy}","received_events_url":"https://api.github.com/users/Zvrbsky/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Zvrbsky/ror_project","description":null,"fork":false,"url":"https://api.github.com/repos/Zvrbsky/ror_project","forks_url":"https://api.github.com/repos/Zvrbsky/ror_project/forks","keys_url":"https://api.github.com/repos/Zvrbsky/ror_project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zvrbsky/ror_project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zvrbsky/ror_project/teams","hooks_url":"https://api.github.com/repos/Zvrbsky/ror_project/hooks","issue_events_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/events{/number}","events_url":"https://api.github.com/repos/Zvrbsky/ror_project/events","assignees_url":"https://api.github.com/repos/Zvrbsky/ror_project/assignees{/user}","branches_url":"https://api.github.com/repos/Zvrbsky/ror_project/branches{/branch}","tags_url":"https://api.github.com/repos/Zvrbsky/ror_project/tags","blobs_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zvrbsky/ror_project/statuses/{sha}","languages_url":"https://api.github.com/repos/Zvrbsky/ror_project/languages","stargazers_url":"https://api.github.com/repos/Zvrbsky/ror_project/stargazers","contributors_url":"https://api.github.com/repos/Zvrbsky/ror_project/contributors","subscribers_url":"https://api.github.com/repos/Zvrbsky/ror_project/subscribers","subscription_url":"https://api.github.com/repos/Zvrbsky/ror_project/subscription","commits_url":"https://api.github.com/repos/Zvrbsky/ror_project/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zvrbsky/ror_project/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zvrbsky/ror_project/contents/{+path}","compare_url":"https://api.github.com/repos/Zvrbsky/ror_project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zvrbsky/ror_project/merges","archive_url":"https://api.github.com/repos/Zvrbsky/ror_project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zvrbsky/ror_project/downloads","issues_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues{/number}","pulls_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls{/number}","milestones_url":"https://api.github.com/repos/Zvrbsky/ror_project/milestones{/number}","notifications_url":"https://api.github.com/repos/Zvrbsky/ror_project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zvrbsky/ror_project/labels{/name}","releases_url":"https://api.github.com/repos/Zvrbsky/ror_project/releases{/id}","deployments_url":"https://api.github.com/repos/Zvrbsky/ror_project/deployments","created_at":"2018-10-14T18:07:31Z","updated_at":"2018-11-19T19:48:09Z","pushed_at":"2018-11-19T22:54:59Z","git_url":"git://github.com/Zvrbsky/ror_project.git","ssh_url":"git@github.com:Zvrbsky/ror_project.git","clone_url":"https://github.com/Zvrbsky/ror_project.git","svn_url":"https://github.com/Zvrbsky/ror_project","homepage":null,"size":196,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Zvrbsky:master","ref":"master","sha":"e57a9654ca0d99156fc01a8c4b7a2b257ac249eb","user":{"login":"Zvrbsky","id":34569565,"node_id":"MDQ6VXNlcjM0NTY5NTY1","avatar_url":"https://avatars1.githubusercontent.com/u/34569565?v=4","gravatar_id":"","url":"https://api.github.com/users/Zvrbsky","html_url":"https://github.com/Zvrbsky","followers_url":"https://api.github.com/users/Zvrbsky/followers","following_url":"https://api.github.com/users/Zvrbsky/following{/other_user}","gists_url":"https://api.github.com/users/Zvrbsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Zvrbsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zvrbsky/subscriptions","organizations_url":"https://api.github.com/users/Zvrbsky/orgs","repos_url":"https://api.github.com/users/Zvrbsky/repos","events_url":"https://api.github.com/users/Zvrbsky/events{/privacy}","received_events_url":"https://api.github.com/users/Zvrbsky/received_events","type":"User","site_admin":false},"repo":{"id":153003649,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwMDM2NDk=","name":"ror_project","full_name":"Zvrbsky/ror_project","private":false,"owner":{"login":"Zvrbsky","id":34569565,"node_id":"MDQ6VXNlcjM0NTY5NTY1","avatar_url":"https://avatars1.githubusercontent.com/u/34569565?v=4","gravatar_id":"","url":"https://api.github.com/users/Zvrbsky","html_url":"https://github.com/Zvrbsky","followers_url":"https://api.github.com/users/Zvrbsky/followers","following_url":"https://api.github.com/users/Zvrbsky/following{/other_user}","gists_url":"https://api.github.com/users/Zvrbsky/gists{/gist_id}","starred_url":"https://api.github.com/users/Zvrbsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zvrbsky/subscriptions","organizations_url":"https://api.github.com/users/Zvrbsky/orgs","repos_url":"https://api.github.com/users/Zvrbsky/repos","events_url":"https://api.github.com/users/Zvrbsky/events{/privacy}","received_events_url":"https://api.github.com/users/Zvrbsky/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Zvrbsky/ror_project","description":null,"fork":false,"url":"https://api.github.com/repos/Zvrbsky/ror_project","forks_url":"https://api.github.com/repos/Zvrbsky/ror_project/forks","keys_url":"https://api.github.com/repos/Zvrbsky/ror_project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zvrbsky/ror_project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zvrbsky/ror_project/teams","hooks_url":"https://api.github.com/repos/Zvrbsky/ror_project/hooks","issue_events_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/events{/number}","events_url":"https://api.github.com/repos/Zvrbsky/ror_project/events","assignees_url":"https://api.github.com/repos/Zvrbsky/ror_project/assignees{/user}","branches_url":"https://api.github.com/repos/Zvrbsky/ror_project/branches{/branch}","tags_url":"https://api.github.com/repos/Zvrbsky/ror_project/tags","blobs_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zvrbsky/ror_project/statuses/{sha}","languages_url":"https://api.github.com/repos/Zvrbsky/ror_project/languages","stargazers_url":"https://api.github.com/repos/Zvrbsky/ror_project/stargazers","contributors_url":"https://api.github.com/repos/Zvrbsky/ror_project/contributors","subscribers_url":"https://api.github.com/repos/Zvrbsky/ror_project/subscribers","subscription_url":"https://api.github.com/repos/Zvrbsky/ror_project/subscription","commits_url":"https://api.github.com/repos/Zvrbsky/ror_project/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zvrbsky/ror_project/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zvrbsky/ror_project/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zvrbsky/ror_project/contents/{+path}","compare_url":"https://api.github.com/repos/Zvrbsky/ror_project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zvrbsky/ror_project/merges","archive_url":"https://api.github.com/repos/Zvrbsky/ror_project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zvrbsky/ror_project/downloads","issues_url":"https://api.github.com/repos/Zvrbsky/ror_project/issues{/number}","pulls_url":"https://api.github.com/repos/Zvrbsky/ror_project/pulls{/number}","milestones_url":"https://api.github.com/repos/Zvrbsky/ror_project/milestones{/number}","notifications_url":"https://api.github.com/repos/Zvrbsky/ror_project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zvrbsky/ror_project/labels{/name}","releases_url":"https://api.github.com/repos/Zvrbsky/ror_project/releases{/id}","deployments_url":"https://api.github.com/repos/Zvrbsky/ror_project/deployments","created_at":"2018-10-14T18:07:31Z","updated_at":"2018-11-19T19:48:09Z","pushed_at":"2018-11-19T22:54:59Z","git_url":"git://github.com/Zvrbsky/ror_project.git","ssh_url":"git@github.com:Zvrbsky/ror_project.git","clone_url":"https://github.com/Zvrbsky/ror_project.git","svn_url":"https://github.com/Zvrbsky/ror_project","homepage":null,"size":196,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3"},"html":{"href":"https://github.com/Zvrbsky/ror_project/pull/3"},"issue":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/issues/3"},"comments":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Zvrbsky/ror_project/statuses/dbda0fbb3167367ba0e6572500b1c7b21d54938d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"piotrimbierowicz"}}