Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
405f96fd
Commit
405f96fd
authored
Jul 26, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for get collection by handle.
parent
6520928d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
BUYClient+StorefrontTests.m
... Buy SDK/Mobile Buy SDK Tests/BUYClient+StorefrontTests.m
+20
-0
BUYClient+Storefront.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Storefront.m
+1
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClient+StorefrontTests.m
View file @
405f96fd
...
...
@@ -253,6 +253,26 @@
}];
}
-
(
void
)
testCollectionHandle
{
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testGetCollection_0"
useMocks
:[
self
shouldUseMocks
]];
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
[
self
.
client
getCollectionByHandle
:
@"frontpage"
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
XCTAssertNotNil
(
collection
);
XCTAssertEqualObjects
(
@"Frontpage"
,
collection
.
title
);
XCTAssertEqualObjects
(
@109931075
,
collection
.
identifier
);
XCTAssertNil
(
error
);
[
expectation
fulfill
];
}];
[
self
waitForExpectationsWithTimeout
:
10
handler
:
^
(
NSError
*
error
)
{
XCTAssertNil
(
error
);
}];
}
-
(
void
)
testProductsInCollection
{
if
(
self
.
collection
==
nil
)
{
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient+Storefront.m
View file @
405f96fd
...
...
@@ -150,7 +150,7 @@ static NSString * const BUYCollectionsKey = @"collection_listings";
return
[
self
getRequestForURL
:
url
completionHandler
:
^
(
NSDictionary
*
json
,
NSHTTPURLResponse
*
response
,
NSError
*
error
)
{
BUYCollection
*
collection
=
nil
;
if
(
json
&&
!
error
)
{
collection
=
[
self
.
modelManager
buy_objectWithEntityName
:[
BUYCollection
entityName
]
JSONDictionary
:
json
];
collection
=
[
self
.
modelManager
buy_objectWithEntityName
:[
BUYCollection
entityName
]
JSONDictionary
:
json
[
BUYCollectionsKey
][
0
]
];
}
block
(
collection
,
error
);
}];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment