Sha256: cfc04af0ee481356a64f54d5e9151960bf836c6e4b46acae815d00b7fe2247f4
Contents?: true
Size: 1.79 KB
Versions: 6
Compression:
Stored size: 1.79 KB
Contents
require 'spec_helper' describe Capybara::Mechanize::Driver do before(:each) do Capybara.app_host = REMOTE_TEST_URL end after(:each) do Capybara.app_host = nil end before do @driver = Capybara::Mechanize::Driver.new end context "in remote mode" do it "should not throw an error when no rack app is given" do running do Capybara::Mechanize::Driver.new end.should_not raise_error(ArgumentError) end it "should pass arguments through to a get request" do @driver.visit("#{REMOTE_TEST_URL}/form/get", {:form => "success"}) @driver.body.should include('success') end it "should pass arguments through to a post request" do @driver.post("#{REMOTE_TEST_URL}/form", {:form => "success"}) @driver.body.should include('success') end context "for a post request" do it "should transform nested map in post data" do @driver.post("#{REMOTE_TEST_URL}/form", {:form => {:key => "value"}}) @driver.body.should include('key: value') end end context "process remote request" do it "should transform nested map in post data" do @driver.submit(:post, "#{REMOTE_TEST_URL}/form", {:form => {:key => "value"}}) @driver.body.should include('key: value') end end describe "redirect" do it "should handle redirects with http-params" do @driver.visit "#{REMOTE_TEST_URL}/redirect_with_http_param" @driver.body.should include('correct redirect') end end it_should_behave_like "driver" it_should_behave_like "driver with header support" it_should_behave_like "driver with status code support" it_should_behave_like "driver with cookies support" it_should_behave_like "driver with infinite redirect detection" end end
Version data entries
6 entries across 6 versions & 2 rubygems