diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-03-02 12:13:56 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-03-02 12:13:56 +0100 |
| commit | 40765f11f49f15dd9a0a040b631228b45c7211a5 (patch) | |
| tree | db22f59bda51b27e18222c02ab288819d8add13d /tests/src/cgeo/geocaching/connector | |
| parent | c05fb9699b70ec7d9800bf1e7264235dcf621294 (diff) | |
| download | cgeo-40765f11f49f15dd9a0a040b631228b45c7211a5.zip cgeo-40765f11f49f15dd9a0a040b631228b45c7211a5.tar.gz cgeo-40765f11f49f15dd9a0a040b631228b45c7211a5.tar.bz2 | |
fix #2534: Updating a OC.de cache doubles the cache description
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
| -rw-r--r-- | tests/src/cgeo/geocaching/connector/oc/OCXMLTest.java | 22 |
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); + } + } } |
