Skip to content

Commit 0d09390

Browse files
committed
Added e2e tests for #rewrite and #clear_rewrites
1 parent 946a966 commit 0d09390

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/e2e/selenium_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,29 @@
128128
end
129129
end
130130

131+
describe 'rewrite rules' do
132+
133+
let(:uri) { URI.parse url_for('1.html') }
134+
135+
before do
136+
proxy.rewrite(%r{1\.html}, '2.html')
137+
end
138+
139+
it 'fetches the rewritten url' do
140+
driver.get uri
141+
142+
wait.until { driver.title == '2' }
143+
end
144+
145+
it 'can be cleared' do
146+
proxy.clear_rewrites
147+
driver.get uri
148+
149+
wait.until { driver.title == '1' }
150+
end
151+
152+
end
153+
131154
it 'should set timeouts' do
132155
proxy.timeouts(read: 0.001)
133156
driver.get url_for('slow')

0 commit comments

Comments
 (0)