Guard tests for things that aren't supported in Selenium yet
This commit is contained in:
parent
8772505322
commit
e7a3ac865c
@ -25,9 +25,11 @@ class WebratTest < ActionController::IntegrationTest
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "should check the value of a field" do
|
test "should check the value of a field" do
|
||||||
|
webrat.simulate do
|
||||||
visit "/"
|
visit "/"
|
||||||
assert field_labeled("Prefilled").value, "text"
|
assert field_labeled("Prefilled").value, "text"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test "should not carry params through redirects" do
|
test "should not carry params through redirects" do
|
||||||
visit before_redirect_form_path
|
visit before_redirect_form_path
|
||||||
@ -43,21 +45,27 @@ class WebratTest < ActionController::IntegrationTest
|
|||||||
|
|
||||||
test "should follow internal redirects" do
|
test "should follow internal redirects" do
|
||||||
visit internal_redirect_path
|
visit internal_redirect_path
|
||||||
|
webrat.simulate do
|
||||||
assert !response.redirect?
|
assert !response.redirect?
|
||||||
|
end
|
||||||
assert response.body.include?("OK")
|
assert response.body.include?("OK")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "should not follow external redirects" do
|
test "should not follow external redirects" do
|
||||||
|
webrat.simulate do
|
||||||
visit external_redirect_path
|
visit external_redirect_path
|
||||||
assert response.redirect?
|
assert response.redirect?
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test "should recognize the host header to follow redirects properly" do
|
test "should recognize the host header to follow redirects properly" do
|
||||||
|
webrat.simulate do
|
||||||
header "Host", "foo.bar"
|
header "Host", "foo.bar"
|
||||||
visit host_redirect_path
|
visit host_redirect_path
|
||||||
assert !response.redirect?
|
assert !response.redirect?
|
||||||
assert response.body.include?("OK")
|
assert response.body.include?("OK")
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test "should click link by text" do
|
test "should click link by text" do
|
||||||
visit internal_redirect_path
|
visit internal_redirect_path
|
||||||
|
Loading…
Reference in New Issue
Block a user