Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a0c893
commit 606f1a2
Showing
6 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'rake/testtask' | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs.push "lib" | ||
t.test_files = FileList['test/**/*_test.rb'] | ||
t.verbose = true | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'test_helper' | ||
|
||
describe 'Mini test without Capybara' do | ||
it "should pass" do | ||
true.should == true | ||
end | ||
it "should fail and not invoke Capybara" do | ||
true.should == false | ||
end | ||
end | ||
|
||
describe 'Mini test with Capybara' do | ||
it "simply returns the original HTML when viewed with Rack" do | ||
puts "Running test 1" | ||
visit '/rack' | ||
page.has_content?('Rack').must_be true | ||
click_link('Does not exist') | ||
end | ||
|
||
it "generates HTML showing that Javascript under Selenium works" do | ||
puts "Running test 2" | ||
Capybara.current_driver = :selenium | ||
visit '/selenium' | ||
page.has_content?('Selenium supports Javascript').must_be true | ||
click_link('Does not exist') | ||
Capybara.use_default_driver | ||
end | ||
|
||
it "generates HTML showing that Javascript under Capybara-webkit works" do | ||
puts "Running test 3" | ||
Capybara.current_driver = :webkit | ||
visit '/webkit' | ||
page.has_content?('Webkit supports Javascript').must_be true | ||
click_link('Does not exist') | ||
Capybara.use_default_driver | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
ENV["RAILS_ENV"] = "test" | ||
require File.expand_path('../../config/environment', __FILE__) | ||
require 'rails/test_help' | ||
|
||
class ActiveSupport::TestCase | ||
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. | ||
# | ||
# Note: You'll currently still have to declare fixtures explicitly in integration tests | ||
# -- they do not yet inherit this setting | ||
fixtures :all | ||
require 'minitest/autorun' | ||
require 'capybara/rails' | ||
|
||
# Add more helper methods to be used by all tests here... | ||
# If description name ends with 'integration', use this RequestSpec class. | ||
# It has all the integration test goodies. | ||
class RequestSpec < MiniTest::Spec | ||
include Rails.application.routes.url_helpers | ||
include Capybara::DSL | ||
end | ||
MiniTest::Spec.register_spec_type /integration$/i, RequestSpec | ||
|