diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-04-07 11:12:16 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-04-07 11:12:16 +0200 |
| commit | 6064ea90e1c1dc5158d023ddb3126de3f41b6422 (patch) | |
| tree | c1a26ed25416fe73be290558f79b0d6bb10eaf26 /tests | |
| parent | f91888da86dd5e0bc847cb61de9117f037307c8d (diff) | |
| parent | e45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a (diff) | |
| download | cgeo-6064ea90e1c1dc5158d023ddb3126de3f41b6422.zip cgeo-6064ea90e1c1dc5158d023ddb3126de3f41b6422.tar.gz cgeo-6064ea90e1c1dc5158d023ddb3126de3f41b6422.tar.bz2 | |
Merge remote-tracking branch 'origin/release'
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java index 3563991..4709565 100644 --- a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java +++ b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java @@ -5,6 +5,10 @@ import cgeo.geocaching.Geocache; import cgeo.geocaching.Settings; import cgeo.geocaching.enumerations.CacheType; +import org.apache.commons.lang3.StringUtils; + +import android.text.Html; + import java.util.Collection; public class OCXMLTest extends CGeoTestCase { @@ -89,25 +93,21 @@ public class OCXMLTest extends CGeoTestCase { assertNotNull(cache); try { assertEquals(geoCode, cache.getGeocode()); - assertEquals(description, cache.getDescription()); + // ignore copyright as the date part will change all the time + assertEquals(description, removeCopyrightAndTags(cache.getDescription())); cache.store(null); // reload, make sure description is not duplicated cache = OCXMLClient.getCache(geoCode); assertNotNull(cache); - assertEquals(description, cache.getDescription()); + assertEquals(description, removeCopyrightAndTags(cache.getDescription())); } finally { deleteCacheFromDB(geoCode); } } - public static void testRemoveMarkupCache() { - final String geoCode = "OCEFBA"; - final String description = "Bei dem Cache kannst du einen kleinen Schatz bergen. Bitte lege aber einen ander Schatz in das Döschen. Achtung vor Automuggels."; - - Geocache cache = OCXMLClient.getCache(geoCode); - assertNotNull(cache); - assertEquals(description, cache.getDescription()); + private static String removeCopyrightAndTags(String input) { + return Html.fromHtml(StringUtils.substringBefore(input, "©")).toString().trim(); } public static void testRemoveMarkup() { |
