LEFT | RIGHT |
(no file at all) | |
1 (function() | 1 (function() |
2 { | 2 { |
3 module("Subscription classes", {setup: prepareFilterComponents, teardown: rest
oreFilterComponents}); | 3 module("Subscription classes", {setup: prepareFilterComponents, teardown: rest
oreFilterComponents}); |
4 | 4 |
5 function compareSubscription(url, expected, postInit) | 5 function compareSubscription(url, expected, postInit) |
6 { | 6 { |
7 expected.push("[Subscription]") | 7 expected.push("[Subscription]") |
8 let subscription = Subscription.fromURL(url); | 8 let subscription = Subscription.fromURL(url); |
9 if (postInit) | 9 if (postInit) |
10 postInit(subscription) | 10 postInit(subscription) |
(...skipping 21 matching lines...) Expand all Loading... |
32 }); | 32 }); |
33 | 33 |
34 test("Subscriptions with state", function() | 34 test("Subscriptions with state", function() |
35 { | 35 { |
36 compareSubscription("~fl~", ["url=~fl~", "title=" + Utils.getString("newGrou
p_title")]); | 36 compareSubscription("~fl~", ["url=~fl~", "title=" + Utils.getString("newGrou
p_title")]); |
37 compareSubscription("http://test/default", ["url=http://test/default", "titl
e=http://test/default"]); | 37 compareSubscription("http://test/default", ["url=http://test/default", "titl
e=http://test/default"]); |
38 compareSubscription("http://test/default_titled", ["url=http://test/default_
titled", "title=test"], function(subscription) | 38 compareSubscription("http://test/default_titled", ["url=http://test/default_
titled", "title=test"], function(subscription) |
39 { | 39 { |
40 subscription.title = "test"; | 40 subscription.title = "test"; |
41 }); | 41 }); |
42 compareSubscription("http://test/non_default", ["url=http://test/non_default
", "title=test", "nextURL=http://test2/", | 42 compareSubscription("http://test/non_default", ["url=http://test/non_default
", "title=test", |
43 "disabled=true", "lastSucces
s=8", "lastDownload=12", "lastCheck=16", "softExpiration=18", "expires=20", "dow
nloadStatus=foo", "lastModified=bar", | 43 "disabled=true", "lastSucces
s=8", "lastDownload=12", "lastCheck=16", "softExpiration=18", "expires=20", "dow
nloadStatus=foo", |
44 "errors=3", "requiredVersion
=0.6", "alternativeLocations=http://foo/;q=0.5,http://bar/;q=2"], function(subsc
ription) | 44 "errors=3", "version=24", "r
equiredVersion=0.6"], function(subscription) |
45 { | 45 { |
46 subscription.title = "test"; | 46 subscription.title = "test"; |
47 subscription.nextURL = "http://test2/"; | |
48 subscription.disabled = true; | 47 subscription.disabled = true; |
49 subscription.lastSuccess = 8; | 48 subscription.lastSuccess = 8; |
50 subscription.lastDownload = 12; | 49 subscription.lastDownload = 12; |
51 subscription.lastCheck = 16; | 50 subscription.lastCheck = 16; |
52 subscription.softExpiration = 18; | 51 subscription.softExpiration = 18; |
53 subscription.expires = 20; | 52 subscription.expires = 20; |
54 subscription.downloadStatus = "foo"; | 53 subscription.downloadStatus = "foo"; |
55 subscription.lastModified = "bar"; | |
56 subscription.errors = 3; | 54 subscription.errors = 3; |
| 55 subscription.version = 24 |
57 subscription.requiredVersion = "0.6"; | 56 subscription.requiredVersion = "0.6"; |
58 subscription.alternativeLocations = "http://foo/;q=0.5,http://bar/;q=2"; | |
59 }); | 57 }); |
60 compareSubscription("~wl~", ["url=~wl~", "disabled=true", "title=Test group"
], function(subscription) | 58 compareSubscription("~wl~", ["url=~wl~", "disabled=true", "title=Test group"
], function(subscription) |
61 { | 59 { |
62 subscription.title = "Test group"; | 60 subscription.title = "Test group"; |
63 subscription.disabled = true; | 61 subscription.disabled = true; |
64 }); | 62 }); |
65 }); | 63 }); |
66 })(); | 64 })(); |
LEFT | RIGHT |