mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Added specs for back redirects
This commit is contained in:
parent
2839de3769
commit
00c6e7df55
4 changed files with 15 additions and 4 deletions
|
@ -371,6 +371,7 @@ The following people have dedicated their time and effort to Capybara:
|
|||
* Graham Ashton
|
||||
* Joseph Wilk
|
||||
* Matt Wynne
|
||||
* Piotr Sarnacki
|
||||
|
||||
== License:
|
||||
|
||||
|
|
|
@ -75,6 +75,11 @@ shared_examples_for "click_link" do
|
|||
@session.body.should include('You landed')
|
||||
end
|
||||
|
||||
it "should follow redirects" do
|
||||
@session.click_link('BackToMyself')
|
||||
@session.body.should include('This is a test')
|
||||
end
|
||||
|
||||
it "should do nothing on anchor links" do
|
||||
@session.fill_in("test_field", :with => 'blah')
|
||||
@session.click_link('Anchor')
|
||||
|
|
|
@ -38,14 +38,18 @@ class TestApp < Sinatra::Base
|
|||
nil
|
||||
end
|
||||
|
||||
get '/:view' do |view|
|
||||
erb view.to_sym
|
||||
end
|
||||
|
||||
post '/redirect' do
|
||||
redirect '/redirect_again'
|
||||
end
|
||||
|
||||
get '/redirect_back' do
|
||||
redirect back
|
||||
end
|
||||
|
||||
get '/:view' do |view|
|
||||
erb view.to_sym
|
||||
end
|
||||
|
||||
post '/form' do
|
||||
'<pre id="results">' + params[:form].to_yaml + '</pre>'
|
||||
end
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
<p>
|
||||
<input type="text" id="test_field" value="monkey"/>
|
||||
<a href="/redirect_back">BackToMyself</a>
|
||||
<a title="twas a fine link" href="/redirect">A link came first</a>
|
||||
<a title="a fine link" href="/with_simple_html">A link</a>
|
||||
<a>No Href</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue