Sha256: cfc05f087392ceeca2572575aff176a6787418b6bbe75b644b23fa6d3b883072

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'
require 'capybara/rspec'

Capybara.app = TestApp

RSpec.configuration.before(:each, :example_group => {:file_path => __FILE__}) do
  @in_filtered_hook = true
end

feature "Capybara's feature DSL" do
  background do
    @in_background = true
  end

  scenario "includes Capybara" do
    visit('/')
    page.should have_content('Hello world!')
  end

  scenario "preserves description" do
    example.metadata[:full_description].should == "Capybara's feature DSL preserves description"
  end

  scenario "allows driver switching", :driver => :selenium do
    Capybara.current_driver.should == :selenium
  end

  scenario "runs background" do
    @in_background.should be_true
  end

  scenario "runs hooks filtered by file path" do
    @in_filtered_hook.should be_true
  end

  scenario "doesn't pollute the Object namespace" do
    Object.new.respond_to?(:feature, true).should be_false
  end
end

feature "Capybara's feature DSL with driver", :driver => :culerity do
  scenario "switches driver" do
    Capybara.current_driver.should == :culerity
  end
end

Version data entries

19 entries across 19 versions & 4 rubygems

Version Path
nimboids-capybara-1.1.2 spec/rspec/features_spec.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/rspec/features_spec.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/rspec/features_spec.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/rspec/features_spec.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/rspec/features_spec.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/capybara-1.1.2/spec/rspec/features_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/rspec/features_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/rspec/features_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/rspec/features_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/rspec/features_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/capybara-1.1.2/spec/rspec/features_spec.rb
capybara-1.1.2 spec/rspec/features_spec.rb
capybara-1.1.1 spec/rspec/features_spec.rb
capybara-1.1.0 spec/rspec/features_spec.rb
capybara-1.1.0.rc1 spec/rspec/features_spec.rb
capybara-1.0.1 spec/rspec/features_spec.rb
capybara-1.0.0 spec/rspec/features_spec.rb
capybara-1.0.0.rc1 spec/rspec/features_spec.rb
capybara-1.0.0.beta1 spec/rspec/features_spec.rb