diff --git a/tests/integration/data/title with spaces.html b/tests/integration/data/title with spaces.html
new file mode 100644
index 000000000..d5e2ab9da
--- /dev/null
+++ b/tests/integration/data/title with spaces.html
@@ -0,0 +1,10 @@
+
+
+
+
+ Test title
+
+
+ foo
+
+
diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py
index 2ff052937..414f882d7 100644
--- a/tests/integration/features/conftest.py
+++ b/tests/integration/features/conftest.py
@@ -275,10 +275,12 @@ def expect_message(quteproc, httpbin, category, message):
@bdd.then(bdd.parsers.re(r'(?Pregex )?"(?P[^"]+)" should '
r'be logged'))
-def should_be_logged(quteproc, is_regex, pattern):
+def should_be_logged(quteproc, httpbin, is_regex, pattern):
"""Expect the given pattern on regex in the log."""
if is_regex:
pattern = re.compile(pattern)
+ else:
+ pattern = pattern.replace('(port)', str(httpbin.port))
line = quteproc.wait_for(message=pattern)
line.expected = True
diff --git a/tests/integration/features/spawn.feature b/tests/integration/features/spawn.feature
index 03506c18b..861091f91 100644
--- a/tests/integration/features/spawn.feature
+++ b/tests/integration/features/spawn.feature
@@ -16,9 +16,20 @@ Feature: :spawn
When I run :spawn echo {url}
Then "Executing echo with args ['about:blank'], userscript=False" should be logged
+ Scenario: Running :spawn with url variable in fully encoded format
+ When I open data/title with spaces.html
+ And I run :spawn echo {url}
+ Then "Executing echo with args ['http://localhost:(port)/data/title%20with%20spaces.html'], userscript=False" should be logged
+
+ Scenario: Running :spawn with url variable in pretty decoded format
+ When I open data/title with spaces.html
+ And I run :spawn echo {url:pretty}
+ Then "Executing echo with args ['http://localhost:(port)/data/title with spaces.html'], userscript=False" should be logged
+
@posix
Scenario: Running :spawn with userscript
- When I execute the userscript open_current_url
+ When I open about:blank
+ And I execute the userscript open_current_url
And I wait until about:blank is loaded
Then the following tabs should be open:
- about:blank