Skip to content

Commit

Permalink
RSpec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheworiordan committed Nov 16, 2011
1 parent 97effe0 commit 4a0c893
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Gemfile.lock
Expand Up @@ -31,25 +31,25 @@ GEM
multi_json (~> 1.0)
arel (2.2.1)
builder (3.0.0)
capybara (1.1.1)
capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
capybara-screenshot (0.1.0)
capybara-screenshot (0.1.2)
capybara (>= 1.0)
cucumber (>= 1.0)
capybara-webkit (0.7.2)
capybara (>= 1.0.0, < 1.2)
childprocess (0.2.2)
ffi (~> 1.0.6)
columnize (0.3.4)
cucumber (1.1.1)
cucumber (1.1.2)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.6.0)
gherkin (~> 2.6.2)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.2.0)
Expand All @@ -58,8 +58,8 @@ GEM
nokogiri (>= 1.5.0)
diff-lcs (1.1.3)
erubis (2.7.0)
ffi (1.0.9)
gherkin (2.6.2)
ffi (1.0.11)
gherkin (2.6.5)
json (>= 1.4.6)
hike (1.2.1)
i18n (0.6.0)
Expand Down Expand Up @@ -122,9 +122,9 @@ GEM
ruby-debug-base (0.10.4)
linecache (>= 0.3)
rubyzip (0.9.4)
selenium-webdriver (2.10.0)
selenium-webdriver (2.12.2)
childprocess (>= 0.2.1)
ffi (= 1.0.9)
ffi (~> 1.0.9)
json_pure
rubyzip
sprockets (2.0.3)
Expand Down
23 changes: 22 additions & 1 deletion spec/integration/basic_spec.rb
@@ -1,9 +1,30 @@
require 'spec_helper'

describe "a spec not using Capybara" do
it "should pass" do
true.should == true
end
it "should fail and not invoke Capybara" do
true.should == false
end
end

describe "home page", :type => :request do
it "simply returns the original HTML when viewed with Rack" do
visit '/rack'
page.should have_content('Rack')
click_link('Does not exist')
end
end

it "generates HTML showing that Javascript under Selenium works", :driver => :selenium do
visit '/selenium'
page.should have_content('Selenium supports Javascript')
click_link('Does not exist')
end

it "generates HTML showing that Javascript under Capybara-webkit works", :js => true do
visit '/webkit'
page.should have_content('Webkit supports Javascript')
click_link('Does not exist')
end
end
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Expand Up @@ -5,6 +5,7 @@
require 'rspec/autorun'

require 'capybara/rspec'
Capybara.javascript_driver = :webkit

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand Down

0 comments on commit 4a0c893

Please sign in to comment.