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
1b708913
Commit
1b708913
authored
Dec 10, 2015
by
Rune Madsen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75 from Shopify/runmad.improve-nsurlcomponents
NSURLComponents improvements
parents
a697e62d
326451f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
BUYClientTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClientTest.m
+8
-0
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+0
-0
NSURLComponents+BUYAdditions.m
...y SDK/Mobile Buy SDK/Utils/NSURLComponents+BUYAdditions.m
+2
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClientTest.m
View file @
1b708913
...
...
@@ -227,6 +227,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderCollectionDefault
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortCollectionDefault
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -238,6 +239,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderBestSelling
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortBestSelling
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -249,6 +251,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderCreatedAscending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortCreatedAscending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -260,6 +263,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderCreatedDescending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortCreatedDescending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -271,6 +275,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderPriceAscending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortPriceAscending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -282,6 +287,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderPriceDescending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortPriceDescending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -293,6 +299,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderTitleAscending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortTitleAscending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
@@ -304,6 +311,7 @@
-
(
void
)
testProductsInCollectionWithSortOrderTitleDescending
{
NSURLSessionDataTask
*
task
=
[
self
.
client
getProductsPage
:
1
inCollection
:
@1
sortOrder
:
BUYCollectionSortTitleDescending
completion
:
nil
];
XCTAssertEqualObjects
(
task
.
originalRequest
.
HTTPMethod
,
@"GET"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
scheme
,
@"https"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
host
,
@"test_shop"
);
XCTAssertEqualObjects
(
task
.
originalRequest
.
URL
.
path
,
@"/api/channels/api_key/product_publications.json"
);
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
1b708913
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Utils/NSURLComponents+BUYAdditions.m
View file @
1b708913
...
...
@@ -33,7 +33,8 @@
if
(
dictionary
)
{
NSMutableArray
*
queryItems
=
[
NSMutableArray
array
];
for
(
NSString
*
key
in
[
dictionary
allKeys
])
{
[
queryItems
addObject
:[[
NSURLQueryItem
alloc
]
initWithName
:
key
value
:
dictionary
[
key
]]];
NSString
*
value
=
[
dictionary
[
key
]
length
]
?
dictionary
[
key
]
:
nil
;
[
queryItems
addObject
:[[
NSURLQueryItem
alloc
]
initWithName
:
key
value
:
value
]];
}
self
.
queryItems
=
[
queryItems
copy
];
}
...
...
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