1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use rails integration tests by default in 'plugin new' generator

This commit is contained in:
Piotr Sarnacki 2010-11-02 14:05:11 +01:00
parent 4d108cb33d
commit 57fae9b2c7
7 changed files with 8 additions and 21 deletions

View file

@ -27,9 +27,6 @@ gem "memcache-client", ">= 1.8.5"
# AM
gem "text-format", "~> 1.0.0"
# for 'plugin new --full' generator
gem "capybara"
platforms :mri_18 do
gem "system_timer"
gem "ruby-debug", ">= 0.10.3"

View file

@ -39,7 +39,6 @@ module Rails
template "test/%name%_test.rb"
if full?
template "test/integration/navigation_test.rb"
template "test/support/integration_case.rb"
end
end

View file

@ -3,7 +3,6 @@ source "http://rubygems.org"
<%= rails_gemfile_entry -%>
<% if full? -%>
gem "capybara", ">= 0.3.9"
gem "sqlite3-ruby", :require => "sqlite3"
<% end -%>

View file

@ -1,7 +1,11 @@
require 'test_helper'
class NagivationTest < ActiveSupport::IntegrationCase
test "truth" do
assert_kind_of Dummy::Application, Rails.application
class NavigationTest < ActionDispatch::IntegrationTest
fixtures :all
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View file

@ -1,5 +0,0 @@
# Define a bare test case to use with Capybara
class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
include Capybara
include Rails.application.routes.url_helpers
end

View file

@ -7,11 +7,6 @@ require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
<% if full? -%>
# Configure capybara for integration testing
require "capybara/rails"
Capybara.default_driver = :rack_test
Capybara.default_selector = :css
# Run any available migration from application
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
# and from engine

View file

@ -46,11 +46,9 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
def test_generating_test_files_in_full_mode
run_generator [destination_root, "--full"]
assert_directory "test/support/"
assert_directory "test/integration/"
assert_file "test/integration/navigation_test.rb", /assert_kind_of Dummy::Application, Rails.application/
assert_file "test/support/integration_case.rb", /class ActiveSupport::IntegrationCase/
assert_file "test/integration/navigation_test.rb", /ActionDispatch::IntegrationTest/
end
def test_ensure_that_plugin_options_are_not_passed_to_app_generator