Created
August 31, 2012 13:20
-
-
Save pnegri/3552589 to your computer and use it in GitHub Desktop.
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
require 'test_helper' | |
# describe "Feature: Mockup Index" do | |
# it "must display mockup on index" do | |
# visit mockup_path | |
# page.text.must_include "Mockup" | |
# end | |
# end | |
describe "Feature: Search on Google" do | |
before do | |
Capybara.run_server = false | |
Capybara.current_driver = :selenium | |
Capybara.app_host = 'http://www.google.com/' | |
end | |
it "must return results for futebol" do | |
visit "/" | |
page.text.must_include "Pesquisar" | |
fill_in 'q', :with => 'futebol' | |
# page.text.must_include "futebol ao vivo" | |
assert page.has_content? "futebol ao vivo" | |
# page.must have_content("futebol ao vivo") | |
end | |
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
require 'minitest/autorun' | |
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('../../config/environment', __FILE__) | |
require "rails/test_help" | |
require 'capybara' | |
require 'capybara/rails' | |
require 'database_cleaner' | |
DatabaseCleaner.strategy = :truncation | |
class MiniTest::Spec | |
include ActiveSupport::Testing::Assertions | |
class << self | |
alias context describe | |
end | |
def build_message(*args) | |
args[1].gsub(/\?/, '%s') % args[2..-1] | |
end | |
before :each do | |
DatabaseCleaner.start | |
end | |
end | |
class IntegrationTest < MiniTest::Spec | |
include Rails.application.routes.url_helpers | |
include Capybara::DSL | |
after :each do | |
Capybara.reset_sessions! | |
end | |
register_spec_type(/^Feature:/, self) | |
register_spec_type(/^Feature/, self) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment