Sha256: 8f98034deb391d6395688b35240b92db0708463c69d60c11c8085ed4724611e3

Contents?: true

Size: 1.32 KB

Versions: 7

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe Capybara::Mechanize::Driver, 'remote' do
  before do
    Capybara.app_host = REMOTE_TEST_URL
  end

  after do
    Capybara.app_host = nil
  end

  let(:driver) { Capybara::Mechanize::Driver.new(ExtendedTestApp) }

  context "in remote mode" do
    it "should pass arguments through to a get request" do
      driver.visit("#{REMOTE_TEST_URL}/form/get", {:form => "success"})
      driver.html.should include('success')
    end

    it "should pass arguments through to a post request" do
      driver.post("#{REMOTE_TEST_URL}/form", {:form => "success"})
      driver.html.should include('success')
    end

    describe "redirect" do
      it "should handle redirects with http-params" do
        driver.visit "#{REMOTE_TEST_URL}/redirect_with_http_param"
        driver.html.should include('correct redirect')
      end
    end

    context "for a post request" do
      it 'transforms nested map in post data' do
        driver.post("#{REMOTE_TEST_URL}/form", {:form => {:key => 'value'}})
        driver.html.should include(':key=>"value"')
      end
    end

    context 'process remote request' do
      it 'transforms nested map in post data' do
        driver.submit(:post, "#{REMOTE_TEST_URL}/form", {:form => {:key => 'value'}})
        driver.html.should include(':key=>"value"')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
capybara-mechanize-1.1.0 spec/driver/remote_mechanize_driver_spec.rb
capybara-mechanize-1.0.2 spec/driver/remote_mechanize_driver_spec.rb
capybara-mechanize-1.0.1 spec/driver/remote_mechanize_driver_spec.rb
capybara-mechanize-1.0.0 spec/driver/remote_mechanize_driver_spec.rb
capybara-mechanize-0.4.0.rc1 spec/driver/remote_mechanize_driver_spec.rb
ryansch-capybara-mechanize-1.0.1 spec/driver/remote_mechanize_driver_spec.rb
ryansch-capybara-mechanize-1.0.0 spec/driver/remote_mechanize_driver_spec.rb