Commit df73ce62 by Dima Bart

Add stubs for getAddresses API.

parent f36b566d
...@@ -196,11 +196,11 @@ ...@@ -196,11 +196,11 @@
- (void)testGetAddresses - (void)testGetAddresses
{ {
// [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) { [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
// return [self shouldUseMocks]; return [self shouldUseMocks];
// } withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) { } withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
// return [OHHTTPStubsResponse responseWithKey:@"testCustomerDuplicateEmail"]; return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddresses"];
// }]; }];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
[self.client getAddressesForCustomerID:self.customer.identifier.stringValue callback:^(NSArray<BUYAddress *> * _Nullable addresses, NSError * _Nullable error) { [self.client getAddressesForCustomerID:self.customer.identifier.stringValue callback:^(NSArray<BUYAddress *> * _Nullable addresses, NSError * _Nullable error) {
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) { [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
return [self shouldUseMocks]; return [self shouldUseMocks];
} withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) { } withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddressGet1"]; return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddress1"];
}]; }];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) { [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
return [self shouldUseMocks]; return [self shouldUseMocks];
} withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) { } withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddressGet1"]; return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddress1"];
}]; }];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
[OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) { [OHHTTPStubs stubRequestsPassingTest:^BOOL(NSURLRequest * _Nonnull request) {
return [self shouldUseMocks]; return [self shouldUseMocks];
} withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) { } withStubResponse:^OHHTTPStubsResponse * _Nonnull(NSURLRequest * _Nonnull request) {
return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddressGet2"]; return [OHHTTPStubsResponse responseWithKey:@"testCustomerAddress2"];
}]; }];
XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; XCTestExpectation *expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)];
......
...@@ -125,7 +125,8 @@ ...@@ -125,7 +125,8 @@
"testCustomerInvalidEmailPassword":{"body":"{\"errors\":{\"customer\":{\"password\":[{\"code\":\"too_short\",\"message\":\"is too short (minimum is 5 characters)\",\"options\":{\"count\":5}}],\"password_confirmation\":[{\"code\":\"confirmation\",\"message\":\"doesn't match Password\",\"options\":{\"attribute\":\"Password\"}}],\"email\":[{\"code\":\"invalid\",\"message\":\"is invalid\",\"options\":{}}]}}}"}, "testCustomerInvalidEmailPassword":{"body":"{\"errors\":{\"customer\":{\"password\":[{\"code\":\"too_short\",\"message\":\"is too short (minimum is 5 characters)\",\"options\":{\"count\":5}}],\"password_confirmation\":[{\"code\":\"confirmation\",\"message\":\"doesn't match Password\",\"options\":{\"attribute\":\"Password\"}}],\"email\":[{\"code\":\"invalid\",\"message\":\"is invalid\",\"options\":{}}]}}}"},
"testCustomerLogout":{"body":"{}","code":204,"message":"OK"}, "testCustomerLogout":{"body":"{}","code":204,"message":"OK"},
"testCustomerLogin":{"body":"{\"customer\":{\"id\":2529265094,\"email\":\"asd@asd.com\",\"default_address\":{\"id\":2839567814,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"company\":\"Adidas\",\"address1\":\"Sass\",\"address2\":\"12\",\"city\":\"Qsdasd\",\"province\":null,\"country\":\"Bouvet Island\",\"zip\":\"24124124\",\"phone\":\"123124124\",\"name\":\"Fast Add\",\"province_code\":null,\"country_code\":\"BV\",\"country_name\":\"Bouvet Island\",\"default\":true},\"verified_email\":true,\"accepts_marketing\":false,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"orders_count\":9,\"total_spent\":\"375.00\",\"created_at\":\"2016-02-16T14:42:24-05:00\",\"updated_at\":\"2016-03-10T16:34:04-05:00\",\"state\":\"enabled\",\"last_order_id\":2566266118,\"last_order_name\":\"#1137\",\"addresses\":[{\"id\":2785988486,\"first_name\":\"AA\",\"last_name\":\"A\",\"phone\":\"\",\"company\":\"\",\"address1\":\"Assiniboine Road\",\"address2\":\"\",\"city\":\"Toronto\",\"province\":\"Ontario\",\"province_code\":\"ON\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"M3J1E1\"},{\"id\":2839567814,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"phone\":\"123124124\",\"company\":\"Adidas\",\"address1\":\"Sass\",\"address2\":\"12\",\"city\":\"Qsdasd\",\"province\":null,\"province_code\":null,\"country\":\"Bouvet Island\",\"country_code\":\"BV\",\"zip\":\"24124124\"}],\"multipass_identifier\":null,\"tax_exempt\":false}}","code":200,"message":"OK"}, "testCustomerLogin":{"body":"{\"customer\":{\"id\":2529265094,\"email\":\"asd@asd.com\",\"default_address\":{\"id\":2839567814,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"company\":\"Adidas\",\"address1\":\"Sass\",\"address2\":\"12\",\"city\":\"Qsdasd\",\"province\":null,\"country\":\"Bouvet Island\",\"zip\":\"24124124\",\"phone\":\"123124124\",\"name\":\"Fast Add\",\"province_code\":null,\"country_code\":\"BV\",\"country_name\":\"Bouvet Island\",\"default\":true},\"verified_email\":true,\"accepts_marketing\":false,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"orders_count\":9,\"total_spent\":\"375.00\",\"created_at\":\"2016-02-16T14:42:24-05:00\",\"updated_at\":\"2016-03-10T16:34:04-05:00\",\"state\":\"enabled\",\"last_order_id\":2566266118,\"last_order_name\":\"#1137\",\"addresses\":[{\"id\":2785988486,\"first_name\":\"AA\",\"last_name\":\"A\",\"phone\":\"\",\"company\":\"\",\"address1\":\"Assiniboine Road\",\"address2\":\"\",\"city\":\"Toronto\",\"province\":\"Ontario\",\"province_code\":\"ON\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"M3J1E1\"},{\"id\":2839567814,\"first_name\":\"Fast\",\"last_name\":\"Add\",\"phone\":\"123124124\",\"company\":\"Adidas\",\"address1\":\"Sass\",\"address2\":\"12\",\"city\":\"Qsdasd\",\"province\":null,\"province_code\":null,\"country\":\"Bouvet Island\",\"country_code\":\"BV\",\"zip\":\"24124124\"}],\"multipass_identifier\":null,\"tax_exempt\":false}}","code":200,"message":"OK"},
"testCustomerAddressGet1":{"code":200,"message":"OK","body":"{\"address\":{\"id\":3541821574,\"first_name\":\"MobileBuy\",\"last_name\":\"asfas\",\"phone\":null,\"company\":null,\"address1\":\"3892 Streewell Rd.\",\"address2\":null,\"city\":\"Toronto\",\"province\":\"Ontario\",\"province_code\":\"ON\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"L8S 2W2\"}}"}, "testCustomerAddresses":{"code":200,"message":"OK","body":"{\"addresses\":[{\"id\":3228337350,\"first_name\":\"MobileBuy\",\"last_name\":\"TestBot\",\"phone\":\"1-555-555-5555\",\"company\":\"Shopify Inc.\",\"address1\":\"150 Elgin Street\",\"address2\":\"8th Floor\",\"city\":\"Toledo\",\"province\":null,\"province_code\":null,\"country\":null,\"country_code\":null,\"zip\":\"K1N5T5\"},{\"id\":3228402182,\"first_name\":\"MobileBuy\",\"last_name\":\"TestBot\",\"phone\":\"1-555-555-5555\",\"company\":\"Shopify Inc.\",\"address1\":\"150 Elgin Street\",\"address2\":\"8th Floor\",\"city\":\"Ottawa\",\"province\":null,\"province_code\":null,\"country\":null,\"country_code\":null,\"zip\":\"K1N5T5\"},{\"id\":3228535430,\"first_name\":\"Testy\",\"last_name\":\"McTesterson\",\"phone\":\"1-555-555-5555\",\"company\":\"Shopify Inc.\",\"address1\":\"150 Elgin Street\",\"address2\":\"8th Floor\",\"city\":\"Ottawa\",\"province\":null,\"province_code\":null,\"country\":null,\"country_code\":null,\"zip\":\"K1N5T5\"},{\"id\":3279871622,\"first_name\":\"MobileBuy\",\"last_name\":\"asfas\",\"phone\":null,\"company\":null,\"address1\":\"150 Elgin Street\",\"address2\":\"8th Floor\",\"city\":\"Toledo\",\"province\":\"Ciudad Autónoma de Buenos Aires\",\"province_code\":\"C\",\"country\":\"Argentina\",\"country_code\":\"AR\",\"zip\":\"124124\"}]}"},
"testCustomerAddressGet2":{"code":200,"message":"OK","body":"{\"address\":{\"id\":3541821574,\"first_name\":\"MobileBuy\",\"last_name\":\"asfas\",\"phone\":null,\"company\":null,\"address1\":\"8493 Southwest St.\",\"address2\":null,\"city\":\"Vancouver\",\"province\":\"British Columbia\",\"province_code\":\"BC\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"T3G 4D9\"}}"}, "testCustomerAddress1":{"code":200,"message":"OK","body":"{\"address\":{\"id\":3541821574,\"first_name\":\"MobileBuy\",\"last_name\":\"asfas\",\"phone\":null,\"company\":null,\"address1\":\"3892 Streewell Rd.\",\"address2\":null,\"city\":\"Toronto\",\"province\":\"Ontario\",\"province_code\":\"ON\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"L8S 2W2\"}}"},
"testCustomerAddress2":{"code":200,"message":"OK","body":"{\"address\":{\"id\":3541821574,\"first_name\":\"MobileBuy\",\"last_name\":\"asfas\",\"phone\":null,\"company\":null,\"address1\":\"8493 Southwest St.\",\"address2\":null,\"city\":\"Vancouver\",\"province\":\"British Columbia\",\"province_code\":\"BC\",\"country\":\"Canada\",\"country_code\":\"CA\",\"zip\":\"T3G 4D9\"}}"},
"testCustomerAddressDelete":{"code":204,"message":"OK","body":"{}"} "testCustomerAddressDelete":{"code":204,"message":"OK","body":"{}"}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment