{"action":"created","comment":{"url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/comments/87993422","pull_request_review_id":8578374,"id":87993422,"diff_hunk":"@@ -0,0 +1,287 @@\n+//\n+//  Copyright © 2016 Zalando SE. All rights reserved.\n+//\n+\n+import XCTest\n+import Nimble\n+import AtlasMockAPI\n+\n+@testable import AtlasUI\n+@testable import AtlasSDK\n+\n+class LoggedInActionHandlerTests: XCTestCase {\n+\n+    var mockedDelegate: CheckoutSummaryActionHandlerDelegateMock?\n+\n+    override class func setUp() {\n+        super.setUp()\n+        try! AtlasMockAPI.startServer()\n+        APIAccessToken.store(\"TestToken\")\n+    }\n+\n+    override class func tearDown() {\n+        super.tearDown()\n+        try! AtlasMockAPI.stopServer()\n+        APIAccessToken.delete()\n+    }\n+\n+    func testNoPaymentMethodSelected() {\n+        let actionHandler = createActionHandler()\n+        actionHandler?.handleSubmitButton()\n+        expect(UserMessage.errorDisplayed).toEventually(equal(true))\n+    }\n+\n+    func testPlaceOrder() {\n+        let actionHandler = createActionHandler()\n+        let cartCheckout = createCartCheckout()\n+        guard let selectedArticleUnit = mockedDelegate?.viewModel.dataModel.selectedArticleUnit else { return fail() }\n+\n+        let dataModel = CheckoutSummaryDataModel(selectedArticleUnit: selectedArticleUnit, cartCheckout: cartCheckout)\n+        mockedDelegate?.viewModel.dataModel = dataModel\n+        actionHandler?.handleSubmitButton()\n+        expect(self.mockedDelegate?.actionHandler as? OrderPlacedActionHandler).toNotEventually(beNil())\n+    }\n+\n+    func testPriceChange() {\n+        let actionHandler = createActionHandler()\n+        let cartCheckout = createCartCheckout()\n+        guard let selectedArticleUnit = mockedDelegate?.viewModel.dataModel.selectedArticleUnit else { return fail() }\n+\n+        let dataModel = CheckoutSummaryDataModel(selectedArticleUnit: selectedArticleUnit,\n+                                                 shippingAddress: cartCheckout?.checkout?.shippingAddress,\n+                                                 billingAddress: cartCheckout?.checkout?.billingAddress,\n+                                                 paymentMethod: cartCheckout?.checkout?.payment.selected?.method,\n+                                                 shippingPrice: 0,\n+                                                 totalPrice: MoneyAmount(string: \"0.1\"),\n+                                                 delivery: cartCheckout?.checkout?.delivery)\n+        mockedDelegate?.viewModel.dataModel = dataModel\n+        actionHandler?.handleSubmitButton()\n+        expect(UserMessage.errorDisplayed).toEventually(equal(true))\n+    }\n+\n+    func testPaymentMethodRemoved() {\n+        let _ = createActionHandler()\n+        guard let selectedArticleUnit = mockedDelegate?.viewModel.dataModel.selectedArticleUnit else { return fail() }\n+\n+        let dataModel1 = CheckoutSummaryDataModel(selectedArticleUnit: selectedArticleUnit,\n+                                                  shippingAddress: nil,\n+                                                  billingAddress: nil,\n+                                                  paymentMethod: \"PAYPAL\",\n+                                                  shippingPrice: 0,\n+                                                  totalPrice: 0,\n+                                                  delivery: nil)\n+        let dataModel2 = CheckoutSummaryDataModel(selectedArticleUnit: selectedArticleUnit,\n+                                                  shippingAddress: nil,\n+                                                  billingAddress: nil,\n+                                                  paymentMethod: nil,\n+                                                  shippingPrice: 0,\n+                                                  totalPrice: 0,\n+                                                  delivery: nil)\n+        mockedDelegate?.viewModel.dataModel = dataModel1\n+        mockedDelegate?.viewModel.dataModel = dataModel2\n+        expect(UserMessage.errorDisplayed).toEventually(equal(true))","path":"AtlasUI/AtlasUITests/LoggedInActionHandlerTests.swift","position":82,"original_position":82,"commit_id":"ad751b19fa10d1785357ea7fb77a6c7b4aaeb631","original_commit_id":"ad751b19fa10d1785357ea7fb77a6c7b4aaeb631","user":{"login":"bonkey","id":39100,"avatar_url":"https://avatars.githubusercontent.com/u/39100?v=3","gravatar_id":"","url":"https://api.github.com/users/bonkey","html_url":"https://github.com/bonkey","followers_url":"https://api.github.com/users/bonkey/followers","following_url":"https://api.github.com/users/bonkey/following{/other_user}","gists_url":"https://api.github.com/users/bonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/bonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bonkey/subscriptions","organizations_url":"https://api.github.com/users/bonkey/orgs","repos_url":"https://api.github.com/users/bonkey/repos","events_url":"https://api.github.com/users/bonkey/events{/privacy}","received_events_url":"https://api.github.com/users/bonkey/received_events","type":"User","site_admin":false},"body":"`toEventually(beTrue())`","created_at":"2016-11-15T11:03:25Z","updated_at":"2016-11-15T11:09:52Z","html_url":"https://github.com/zalando-incubator/atlas-ios/pull/553#discussion_r87993422","pull_request_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553","_links":{"self":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/comments/87993422"},"html":{"href":"https://github.com/zalando-incubator/atlas-ios/pull/553#discussion_r87993422"},"pull_request":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553"}}},"pull_request":{"url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553","id":93535565,"html_url":"https://github.com/zalando-incubator/atlas-ios/pull/553","diff_url":"https://github.com/zalando-incubator/atlas-ios/pull/553.diff","patch_url":"https://github.com/zalando-incubator/atlas-ios/pull/553.patch","issue_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/553","number":553,"state":"open","locked":false,"title":"#314: Checkout Summary Refactor ","user":{"login":"hani-ibrahim","id":5626418,"avatar_url":"https://avatars.githubusercontent.com/u/5626418?v=3","gravatar_id":"","url":"https://api.github.com/users/hani-ibrahim","html_url":"https://github.com/hani-ibrahim","followers_url":"https://api.github.com/users/hani-ibrahim/followers","following_url":"https://api.github.com/users/hani-ibrahim/following{/other_user}","gists_url":"https://api.github.com/users/hani-ibrahim/gists{/gist_id}","starred_url":"https://api.github.com/users/hani-ibrahim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hani-ibrahim/subscriptions","organizations_url":"https://api.github.com/users/hani-ibrahim/orgs","repos_url":"https://api.github.com/users/hani-ibrahim/repos","events_url":"https://api.github.com/users/hani-ibrahim/events{/privacy}","received_events_url":"https://api.github.com/users/hani-ibrahim/received_events","type":"User","site_admin":false},"body":"fixing #314 \r\nfixing #550 \r\nfixing #551 \r\nfixing #552 \r\n\r\nremaining fixing tests ","created_at":"2016-11-14T09:50:02Z","updated_at":"2016-11-15T11:09:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"707c39d44d01e7967b16ff2f93a521d81e9acce7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553/commits","review_comments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553/comments","review_comment_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/553/comments","statuses_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/statuses/ad751b19fa10d1785357ea7fb77a6c7b4aaeb631","head":{"label":"zalando-incubator:issue-314","ref":"issue-314","sha":"ad751b19fa10d1785357ea7fb77a6c7b4aaeb631","user":{"login":"zalando-incubator","id":18533786,"avatar_url":"https://avatars.githubusercontent.com/u/18533786?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando-incubator","html_url":"https://github.com/zalando-incubator","followers_url":"https://api.github.com/users/zalando-incubator/followers","following_url":"https://api.github.com/users/zalando-incubator/following{/other_user}","gists_url":"https://api.github.com/users/zalando-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-incubator/subscriptions","organizations_url":"https://api.github.com/users/zalando-incubator/orgs","repos_url":"https://api.github.com/users/zalando-incubator/repos","events_url":"https://api.github.com/users/zalando-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":64761185,"name":"atlas-ios","full_name":"zalando-incubator/atlas-ios","owner":{"login":"zalando-incubator","id":18533786,"avatar_url":"https://avatars.githubusercontent.com/u/18533786?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando-incubator","html_url":"https://github.com/zalando-incubator","followers_url":"https://api.github.com/users/zalando-incubator/followers","following_url":"https://api.github.com/users/zalando-incubator/following{/other_user}","gists_url":"https://api.github.com/users/zalando-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-incubator/subscriptions","organizations_url":"https://api.github.com/users/zalando-incubator/orgs","repos_url":"https://api.github.com/users/zalando-incubator/repos","events_url":"https://api.github.com/users/zalando-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando-incubator/atlas-ios","description":"Atlas iOS SDK for Zalando Checkout and Catalog APIs.","fork":false,"url":"https://api.github.com/repos/zalando-incubator/atlas-ios","forks_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/forks","keys_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/teams","hooks_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/hooks","issue_events_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/events{/number}","events_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/events","assignees_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/assignees{/user}","branches_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/branches{/branch}","tags_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/tags","blobs_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/languages","stargazers_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/stargazers","contributors_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/contributors","subscribers_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/subscribers","subscription_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/subscription","commits_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/contents/{+path}","compare_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/merges","archive_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/downloads","issues_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues{/number}","pulls_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/labels{/name}","releases_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/releases{/id}","deployments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/deployments","created_at":"2016-08-02T13:55:33Z","updated_at":"2016-10-25T09:07:48Z","pushed_at":"2016-11-15T10:44:04Z","git_url":"git://github.com/zalando-incubator/atlas-ios.git","ssh_url":"git@github.com:zalando-incubator/atlas-ios.git","clone_url":"https://github.com/zalando-incubator/atlas-ios.git","svn_url":"https://github.com/zalando-incubator/atlas-ios","homepage":"","size":193585,"stargazers_count":15,"watchers_count":15,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":56,"forks":1,"open_issues":56,"watchers":15,"default_branch":"master"}},"base":{"label":"zalando-incubator:master","ref":"master","sha":"9bec3657625d8a8441495863e407a9f23dcdc68f","user":{"login":"zalando-incubator","id":18533786,"avatar_url":"https://avatars.githubusercontent.com/u/18533786?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando-incubator","html_url":"https://github.com/zalando-incubator","followers_url":"https://api.github.com/users/zalando-incubator/followers","following_url":"https://api.github.com/users/zalando-incubator/following{/other_user}","gists_url":"https://api.github.com/users/zalando-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-incubator/subscriptions","organizations_url":"https://api.github.com/users/zalando-incubator/orgs","repos_url":"https://api.github.com/users/zalando-incubator/repos","events_url":"https://api.github.com/users/zalando-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":64761185,"name":"atlas-ios","full_name":"zalando-incubator/atlas-ios","owner":{"login":"zalando-incubator","id":18533786,"avatar_url":"https://avatars.githubusercontent.com/u/18533786?v=3","gravatar_id":"","url":"https://api.github.com/users/zalando-incubator","html_url":"https://github.com/zalando-incubator","followers_url":"https://api.github.com/users/zalando-incubator/followers","following_url":"https://api.github.com/users/zalando-incubator/following{/other_user}","gists_url":"https://api.github.com/users/zalando-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/zalando-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalando-incubator/subscriptions","organizations_url":"https://api.github.com/users/zalando-incubator/orgs","repos_url":"https://api.github.com/users/zalando-incubator/repos","events_url":"https://api.github.com/users/zalando-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/zalando-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zalando-incubator/atlas-ios","description":"Atlas iOS SDK for Zalando Checkout and Catalog APIs.","fork":false,"url":"https://api.github.com/repos/zalando-incubator/atlas-ios","forks_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/forks","keys_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/teams","hooks_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/hooks","issue_events_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/events{/number}","events_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/events","assignees_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/assignees{/user}","branches_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/branches{/branch}","tags_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/tags","blobs_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/languages","stargazers_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/stargazers","contributors_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/contributors","subscribers_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/subscribers","subscription_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/subscription","commits_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/contents/{+path}","compare_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/merges","archive_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/downloads","issues_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues{/number}","pulls_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/labels{/name}","releases_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/releases{/id}","deployments_url":"https://api.github.com/repos/zalando-incubator/atlas-ios/deployments","created_at":"2016-08-02T13:55:33Z","updated_at":"2016-10-25T09:07:48Z","pushed_at":"2016-11-15T10:44:04Z","git_url":"git://github.com/zalando-incubator/atlas-ios.git","ssh_url":"git@github.com:zalando-incubator/atlas-ios.git","clone_url":"https://github.com/zalando-incubator/atlas-ios.git","svn_url":"https://github.com/zalando-incubator/atlas-ios","homepage":"","size":193585,"stargazers_count":15,"watchers_count":15,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":56,"forks":1,"open_issues":56,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553"},"html":{"href":"https://github.com/zalando-incubator/atlas-ios/pull/553"},"issue":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/553"},"comments":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/issues/553/comments"},"review_comments":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553/comments"},"review_comment":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/pulls/553/commits"},"statuses":{"href":"https://api.github.com/repos/zalando-incubator/atlas-ios/statuses/ad751b19fa10d1785357ea7fb77a6c7b4aaeb631"}}}}
{"actor":{"display_login":"bonkey"}}