Add a new userSubscriptions URL
This commit is contained in:
parent
ed57117c86
commit
b69f53eb4e
|
@ -10,8 +10,10 @@ import Foundation
|
|||
|
||||
public extension URL {
|
||||
|
||||
static func appStoreUrl(forAppId appId: Int) -> URL {
|
||||
static let userSubscriptions = URL(string: "https://apps.apple.com/account/subscriptions")
|
||||
|
||||
static func appStoreUrl(forAppId appId: Int) -> URL? {
|
||||
|
||||
URL(string: "https://itunes.apple.com/app/id\(appId)")!
|
||||
URL(string: "https://itunes.apple.com/app/id\(appId)")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,15 @@ class Url_GlobalTests: QuickSpec {
|
|||
|
||||
it("is valid") {
|
||||
let url = URL.appStoreUrl(forAppId: 123)
|
||||
expect(url.absoluteString).to(equal("https://itunes.apple.com/app/id\(123)"))
|
||||
expect(url?.absoluteString).to(equal("https://itunes.apple.com/app/id\(123)"))
|
||||
}
|
||||
}
|
||||
|
||||
describe("user subscriptions url") {
|
||||
|
||||
it("is valid") {
|
||||
let url = URL.userSubscriptions
|
||||
expect(url?.absoluteString).to(equal("https://apps.apple.com/account/subscriptions"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue