Created
July 11, 2012 21:27
-
-
Save gongo/3093675 to your computer and use it in GitHub Desktop.
RSpec 2.11 からの新しいシンタックスがそのまま Capybara でも使えるかテスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'capybara/rspec' | |
Capybara.current_driver = :selenium | |
Capybara.app_host = 'http://www.google.com' | |
Capybara.run_server = false | |
include Capybara::DSL | |
describe "Capybara/RSpec matchers" do | |
it "can use with rspec 2.11" do | |
visit '/' | |
page.should have_css('#gs_htif0') | |
expect(page).to have_css('#gs_htif0') # rspec 2.11 new syntax | |
end | |
end | |
# gongo$ cat Gemfile | |
# source 'https://rubygems.org' | |
# | |
# gem 'rspec' | |
# gem 'capybara' | |
# | |
# gongo$ bundle install --path vendor/bundle | |
# gongo$ bundle exec rspec capybara_rspec_matcher_test.rb | |
# . | |
# | |
# Finished in 5.34 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment