aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
-rw-r--r--tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java
index a1992bd..46c3fd1 100644
--- a/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java
+++ b/tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java
@@ -3,7 +3,6 @@ package cgeo.geocaching.connector.oc;
import cgeo.CGeoTestCase;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.Settings;
-import cgeo.geocaching.connector.oc.OCXMLClient;
import cgeo.geocaching.enumerations.CacheType;
import java.util.Collection;
@@ -80,4 +79,25 @@ public class OCXMLTest extends CGeoTestCase {
Settings.setExcludeMine(oldExcludeMine);
}
}
+
+ public static void testFetchTwiceDuplicatesDescription() {
+ final String geoCode = "OCEFBA";
+ final String description = "<p><span>Bei dem Cache kannst du einen kleinen Schatz bergen. Bitte lege aber einen ander Schatz in das Döschen. Achtung vor Automuggels.</span></p>";
+
+ deleteCacheFromDB(geoCode);
+ Geocache cache = OCXMLClient.getCache(geoCode);
+ assertNotNull(cache);
+ try {
+ assertEquals(geoCode, cache.getGeocode());
+ assertEquals(description, cache.getDescription());
+ cache.store(null);
+
+ // reload, make sure description is not duplicated
+ cache = OCXMLClient.getCache(geoCode);
+ assertNotNull(cache);
+ assertEquals(description, cache.getDescription());
+ } finally {
+ deleteCacheFromDB(geoCode);
+ }
+ }
}