summaryrefslogtreecommitdiff
path: root/src/instrumentationTest/de/test/antennapod
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-03-19 13:24:28 +0100
committerdaniel oeh <daniel.oeh@gmail.com>2014-03-19 13:24:28 +0100
commitb454ab09740dc8557a670c9c1d4bc8cd19ea129c (patch)
tree412b61fb6a1787269d634be91c4c5573fd977bef /src/instrumentationTest/de/test/antennapod
parent361e56385ba8fe445b2400cd5bf83958945b9293 (diff)
downloadAntennaPod-b454ab09740dc8557a670c9c1d4bc8cd19ea129c.zip
Don't encode already encoded URLs. fixes #376
Diffstat (limited to 'src/instrumentationTest/de/test/antennapod')
-rw-r--r--src/instrumentationTest/de/test/antennapod/util/URIUtilTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/instrumentationTest/de/test/antennapod/util/URIUtilTest.java b/src/instrumentationTest/de/test/antennapod/util/URIUtilTest.java
new file mode 100644
index 000000000..a7cba4c03
--- /dev/null
+++ b/src/instrumentationTest/de/test/antennapod/util/URIUtilTest.java
@@ -0,0 +1,21 @@
+package instrumentationTest.de.test.antennapod.util;
+
+import android.test.AndroidTestCase;
+import de.danoeh.antennapod.util.URIUtil;
+
+/**
+ * Test class for URIUtil
+ */
+public class URIUtilTest extends AndroidTestCase {
+
+ public void testGetURIFromRequestUrlShouldNotEncode() {
+ final String testUrl = "http://example.com/this%20is%20encoded";
+ assertEquals(testUrl, URIUtil.getURIFromRequestUrl(testUrl).toString());
+ }
+
+ public void testGetURIFromRequestUrlShouldEncode() {
+ final String testUrl = "http://example.com/this is not encoded";
+ final String expected = "http://example.com/this%20is%20not%20encoded";
+ assertEquals(expected, URIUtil.getURIFromRequestUrl(testUrl).toString());
+ }
+}