{"action":"created","comment":{"url":"https://api.github.com/repos/toggl/superday/pulls/comments/86004700","pull_request_review_id":6685885,"id":86004700,"diff_hunk":"@@ -0,0 +1,160 @@\n+import XCTest\n+import Nimble\n+@testable import teferi\n+\n+class PagerViewControllerTests : XCTestCase\n+{\n+    private var metricsService : MetricsService!\n+    private var appStateService : AppStateService!\n+    private var settingsService : SettingsService!\n+    private var editStateService : EditStateService!\n+    private var persistencyService : PersistencyService!\n+    private var pagerViewController : PagerViewController!\n+    \n+    override func setUp()\n+    {\n+        super.setUp()\n+ \n+        self.metricsService = MockMetricsService()\n+        self.settingsService = MockSettingsService()\n+        self.appStateService = MockAppStateService()\n+        self.editStateService = MockEditStateService()\n+        self.persistencyService = MockPersistencyService()\n+        \n+        self.pagerViewController = PagerViewController(coder: NSCoder())!\n+        self.pagerViewController.inject(self.metricsService,\n+                                        self.appStateService,\n+                                        self.settingsService,\n+                                        self.editStateService,\n+                                        self.persistencyService)\n+        \n+        self.pagerViewController.loadViewIfNeeded()\n+        UIApplication.shared.keyWindow!.rootViewController = self.pagerViewController\n+    }\n+    \n+    override func tearDown()\n+    {\n+        self.pagerViewController.viewWillDisappear(false)\n+        self.pagerViewController = nil\n+    }\n+    \n+    func testScrollingIsDisabledWhenEnteringEditMode()\n+    {\n+        self.editStateService.notifyEditingBegan(point: CGPoint(), timeSlot: TimeSlot());\n+        \n+        let scrollViews =\n+            self.pagerViewController\n+                .view\n+                .subviews\n+                .flatMap { v in v as? UIScrollView }\n+        \n+        expect(scrollViews).to(allPass { !$0!.isScrollEnabled  })\n+    }\n+    \n+    func testScrollingIsEnabledWhenExitingEditMode()\n+    {\n+        self.editStateService.notifyEditingBegan(point: CGPoint(), timeSlot: TimeSlot());\n+        self.editStateService.notifyEditingEnded();\n+        \n+        let scrollViews =\n+            self.pagerViewController\n+                .view\n+                .subviews\n+                .flatMap { v in v as? UIScrollView }\n+        \n+        expect(scrollViews).to(allPass { $0!.isScrollEnabled  })\n+    }\n+    \n+    func testWhenTheAppGetsInactiveTheLastInactiveDateGetsSet()\n+    {\n+        self.settingsService.setLastInactiveDate(nil)\n+        self.appStateService.currentAppState = .inactive\n+        \n+        expect(self.settingsService.lastInactiveDate).toNot(beNil())\n+    }\n+    \n+    func testUiGetsRefreshedWhenTheAppGetsAwakeTheNextAfterItWentToSleep()","path":"teferiTests/ViewControllers/PagerViewControllerTests.swift","position":76,"original_position":76,"commit_id":"3a98f13031dac0d47f0fc9b4592d2c6abd2d5997","original_commit_id":"3a98f13031dac0d47f0fc9b4592d2c6abd2d5997","user":{"login":"willsb","id":7688727,"avatar_url":"https://avatars.githubusercontent.com/u/7688727?v=3","gravatar_id":"","url":"https://api.github.com/users/willsb","html_url":"https://github.com/willsb","followers_url":"https://api.github.com/users/willsb/followers","following_url":"https://api.github.com/users/willsb/following{/other_user}","gists_url":"https://api.github.com/users/willsb/gists{/gist_id}","starred_url":"https://api.github.com/users/willsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willsb/subscriptions","organizations_url":"https://api.github.com/users/willsb/orgs","repos_url":"https://api.github.com/users/willsb/repos","events_url":"https://api.github.com/users/willsb/events{/privacy}","received_events_url":"https://api.github.com/users/willsb/received_events","type":"User","site_admin":false},"body":"That's derp for `testUiGetsRefreshedWhenTheAppGoesToForegroundTheDayAfterItWentToSleep`","created_at":"2016-11-01T19:25:01Z","updated_at":"2016-11-01T19:25:01Z","html_url":"https://github.com/toggl/superday/pull/118#discussion_r86004700","pull_request_url":"https://api.github.com/repos/toggl/superday/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/toggl/superday/pulls/comments/86004700"},"html":{"href":"https://github.com/toggl/superday/pull/118#discussion_r86004700"},"pull_request":{"href":"https://api.github.com/repos/toggl/superday/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/toggl/superday/pulls/118","id":91836230,"html_url":"https://github.com/toggl/superday/pull/118","diff_url":"https://github.com/toggl/superday/pull/118.diff","patch_url":"https://github.com/toggl/superday/pull/118.patch","issue_url":"https://api.github.com/repos/toggl/superday/issues/118","number":118,"state":"open","locked":false,"title":"Unit Test ViewControllers","user":{"login":"willsb","id":7688727,"avatar_url":"https://avatars.githubusercontent.com/u/7688727?v=3","gravatar_id":"","url":"https://api.github.com/users/willsb","html_url":"https://github.com/willsb","followers_url":"https://api.github.com/users/willsb/followers","following_url":"https://api.github.com/users/willsb/following{/other_user}","gists_url":"https://api.github.com/users/willsb/gists{/gist_id}","starred_url":"https://api.github.com/users/willsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willsb/subscriptions","organizations_url":"https://api.github.com/users/willsb/orgs","repos_url":"https://api.github.com/users/willsb/repos","events_url":"https://api.github.com/users/willsb/events{/privacy}","received_events_url":"https://api.github.com/users/willsb/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-01T18:21:32Z","updated_at":"2016-11-01T19:25:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f348c9bff1a3f7df16b90bde4868b2c9473dd4ad","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/toggl/superday/pulls/118/commits","review_comments_url":"https://api.github.com/repos/toggl/superday/pulls/118/comments","review_comment_url":"https://api.github.com/repos/toggl/superday/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toggl/superday/issues/118/comments","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/3a98f13031dac0d47f0fc9b4592d2c6abd2d5997","head":{"label":"toggl:willsb-unit-test-vcs","ref":"willsb-unit-test-vcs","sha":"3a98f13031dac0d47f0fc9b4592d2c6abd2d5997","user":{"login":"toggl","id":316475,"avatar_url":"https://avatars.githubusercontent.com/u/316475?v=3","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"repo":{"id":66841580,"name":"superday","full_name":"toggl/superday","owner":{"login":"toggl","id":316475,"avatar_url":"https://avatars.githubusercontent.com/u/316475?v=3","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toggl/superday","description":"New mobile app. Teferi would be proud.","fork":false,"url":"https://api.github.com/repos/toggl/superday","forks_url":"https://api.github.com/repos/toggl/superday/forks","keys_url":"https://api.github.com/repos/toggl/superday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toggl/superday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toggl/superday/teams","hooks_url":"https://api.github.com/repos/toggl/superday/hooks","issue_events_url":"https://api.github.com/repos/toggl/superday/issues/events{/number}","events_url":"https://api.github.com/repos/toggl/superday/events","assignees_url":"https://api.github.com/repos/toggl/superday/assignees{/user}","branches_url":"https://api.github.com/repos/toggl/superday/branches{/branch}","tags_url":"https://api.github.com/repos/toggl/superday/tags","blobs_url":"https://api.github.com/repos/toggl/superday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toggl/superday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toggl/superday/git/refs{/sha}","trees_url":"https://api.github.com/repos/toggl/superday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/{sha}","languages_url":"https://api.github.com/repos/toggl/superday/languages","stargazers_url":"https://api.github.com/repos/toggl/superday/stargazers","contributors_url":"https://api.github.com/repos/toggl/superday/contributors","subscribers_url":"https://api.github.com/repos/toggl/superday/subscribers","subscription_url":"https://api.github.com/repos/toggl/superday/subscription","commits_url":"https://api.github.com/repos/toggl/superday/commits{/sha}","git_commits_url":"https://api.github.com/repos/toggl/superday/git/commits{/sha}","comments_url":"https://api.github.com/repos/toggl/superday/comments{/number}","issue_comment_url":"https://api.github.com/repos/toggl/superday/issues/comments{/number}","contents_url":"https://api.github.com/repos/toggl/superday/contents/{+path}","compare_url":"https://api.github.com/repos/toggl/superday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toggl/superday/merges","archive_url":"https://api.github.com/repos/toggl/superday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toggl/superday/downloads","issues_url":"https://api.github.com/repos/toggl/superday/issues{/number}","pulls_url":"https://api.github.com/repos/toggl/superday/pulls{/number}","milestones_url":"https://api.github.com/repos/toggl/superday/milestones{/number}","notifications_url":"https://api.github.com/repos/toggl/superday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toggl/superday/labels{/name}","releases_url":"https://api.github.com/repos/toggl/superday/releases{/id}","deployments_url":"https://api.github.com/repos/toggl/superday/deployments","created_at":"2016-08-29T12:26:20Z","updated_at":"2016-10-24T16:40:48Z","pushed_at":"2016-11-01T18:21:32Z","git_url":"git://github.com/toggl/superday.git","ssh_url":"git@github.com:toggl/superday.git","clone_url":"https://github.com/toggl/superday.git","svn_url":"https://github.com/toggl/superday","homepage":"","size":661,"stargazers_count":6,"watchers_count":6,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":6,"default_branch":"develop"}},"base":{"label":"toggl:develop","ref":"develop","sha":"91cc035015f938f1bcfcbb09fd68315fd7ce2e0f","user":{"login":"toggl","id":316475,"avatar_url":"https://avatars.githubusercontent.com/u/316475?v=3","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"repo":{"id":66841580,"name":"superday","full_name":"toggl/superday","owner":{"login":"toggl","id":316475,"avatar_url":"https://avatars.githubusercontent.com/u/316475?v=3","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toggl/superday","description":"New mobile app. Teferi would be proud.","fork":false,"url":"https://api.github.com/repos/toggl/superday","forks_url":"https://api.github.com/repos/toggl/superday/forks","keys_url":"https://api.github.com/repos/toggl/superday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toggl/superday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toggl/superday/teams","hooks_url":"https://api.github.com/repos/toggl/superday/hooks","issue_events_url":"https://api.github.com/repos/toggl/superday/issues/events{/number}","events_url":"https://api.github.com/repos/toggl/superday/events","assignees_url":"https://api.github.com/repos/toggl/superday/assignees{/user}","branches_url":"https://api.github.com/repos/toggl/superday/branches{/branch}","tags_url":"https://api.github.com/repos/toggl/superday/tags","blobs_url":"https://api.github.com/repos/toggl/superday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toggl/superday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toggl/superday/git/refs{/sha}","trees_url":"https://api.github.com/repos/toggl/superday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/{sha}","languages_url":"https://api.github.com/repos/toggl/superday/languages","stargazers_url":"https://api.github.com/repos/toggl/superday/stargazers","contributors_url":"https://api.github.com/repos/toggl/superday/contributors","subscribers_url":"https://api.github.com/repos/toggl/superday/subscribers","subscription_url":"https://api.github.com/repos/toggl/superday/subscription","commits_url":"https://api.github.com/repos/toggl/superday/commits{/sha}","git_commits_url":"https://api.github.com/repos/toggl/superday/git/commits{/sha}","comments_url":"https://api.github.com/repos/toggl/superday/comments{/number}","issue_comment_url":"https://api.github.com/repos/toggl/superday/issues/comments{/number}","contents_url":"https://api.github.com/repos/toggl/superday/contents/{+path}","compare_url":"https://api.github.com/repos/toggl/superday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toggl/superday/merges","archive_url":"https://api.github.com/repos/toggl/superday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toggl/superday/downloads","issues_url":"https://api.github.com/repos/toggl/superday/issues{/number}","pulls_url":"https://api.github.com/repos/toggl/superday/pulls{/number}","milestones_url":"https://api.github.com/repos/toggl/superday/milestones{/number}","notifications_url":"https://api.github.com/repos/toggl/superday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toggl/superday/labels{/name}","releases_url":"https://api.github.com/repos/toggl/superday/releases{/id}","deployments_url":"https://api.github.com/repos/toggl/superday/deployments","created_at":"2016-08-29T12:26:20Z","updated_at":"2016-10-24T16:40:48Z","pushed_at":"2016-11-01T18:21:32Z","git_url":"git://github.com/toggl/superday.git","ssh_url":"git@github.com:toggl/superday.git","clone_url":"https://github.com/toggl/superday.git","svn_url":"https://github.com/toggl/superday","homepage":"","size":661,"stargazers_count":6,"watchers_count":6,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":10,"forks":2,"open_issues":10,"watchers":6,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/toggl/superday/pulls/118"},"html":{"href":"https://github.com/toggl/superday/pull/118"},"issue":{"href":"https://api.github.com/repos/toggl/superday/issues/118"},"comments":{"href":"https://api.github.com/repos/toggl/superday/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/toggl/superday/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/toggl/superday/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toggl/superday/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/toggl/superday/statuses/3a98f13031dac0d47f0fc9b4592d2c6abd2d5997"}}}}
{"actor":{"display_login":"willsb"}}