Sha256: 9cc234d5a50fe51d69791a20a35ab71d63192642bf35b6613805703254f95354

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

describe Capybara::Session do
  context 'with rack test driver' do
    before do
      @session = TestSessions::RackTest
    end

    describe '#driver' do
      it "should be a rack test driver" do
        @session.driver.should be_an_instance_of(Capybara::Driver::RackTest)
      end
    end

    describe '#mode' do
      it "should remember the mode" do
        @session.mode.should == :rack_test
      end
    end

    describe '#click_link' do
      it "should use data-method if available" do
        @session.visit "/with_html"
        @session.click_link "A link with data-method"
        @session.body.should == 'The requested object was deleted'
      end
    end

    describe "#attach_file" do
      context "with multipart form" do
        it "should submit an empty form-data section if no file is submitted" do
          @session.visit("/form")
          @session.click_button("Upload Empty")
          @session.body.should include('Successfully ignored empty file field.')
        end
      end
    end

    it_should_behave_like "session"
    it_should_behave_like "session without javascript support"
    it_should_behave_like "session with headers support"
    it_should_behave_like "session with status code support"
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
capybara-0.4.1.2 spec/session/rack_test_session_spec.rb
capybara-rails-2-2-0.4.1.1 spec/session/rack_test_session_spec.rb
rcarvalho-capybara-0.4.1.2 spec/session/rack_test_session_spec.rb
rcarvalho-capybara-0.4.1.1 spec/session/rack_test_session_spec.rb
capybara-0.4.1.1 spec/session/rack_test_session_spec.rb
capybara-0.4.1.rc spec/session/rack_test_session_spec.rb