aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-04-07 11:21:15 +0200
committerSamuel Tardieu <sam@rfc1149.net>2013-04-07 11:21:15 +0200
commit759fa58ab3c1af98780b1fbc20bbfd9c86d1f43b (patch)
treef43ff4119f9f693e83c33cdcda6e8f4bb29f9c57 /tests
parentc791e236c88c98590635719ca84f8067db0eec77 (diff)
parente45d858dc9fdde5ef06fc8a3e6a65dc83fe2238a (diff)
downloadcgeo-759fa58ab3c1af98780b1fbc20bbfd9c86d1f43b.zip
cgeo-759fa58ab3c1af98780b1fbc20bbfd9c86d1f43b.tar.gz
cgeo-759fa58ab3c1af98780b1fbc20bbfd9c86d1f43b.tar.bz2
Merge remote-tracking branch 'upstream/release' into release
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java18
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 b12823a..2e4855f 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, "&copy")).toString().trim();
}
public static void testRemoveMarkup() {