Sha256: bd054ff23ab2b10067989234b2f2debfc8082ef6b31036ac1b3a9eea06589a23

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

# Copyright (C) 2016  Kouhei Sutou <yokoyama@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

ENV["RAILS_ENV"] = "test"

require "rails/all"

# For Rack::Builder#to_app
module TestUnitRails
  class Application < ::Rails::Application
    ::Rails.logger = config.logger = ActiveSupport::Logger.new($stdout)
  end
end

require "test/unit/rails/test_help"
require "selenium-webdriver"

Rails.application.secrets[:secret_key_base] = 'xxx'
Rails.application.routes.draw do
  resources :items
end

class ItemsController < ActionController::Base
  def index
    render plain: "Hello"
  end
end

require "fileutils"

db_dir = "tmp"
FileUtils.rm_rf(db_dir)
FileUtils.mkdir_p(db_dir)
ActiveRecord::Base.establish_connection("adapter" => "sqlite3",
                                        "database" => "#{db_dir}/test.sqlite3")

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
test-unit-rails-7.0.2 test/test_helper.rb
test-unit-rails-7.0.1 test/test_helper.rb
test-unit-rails-7.0.0 test/test_helper.rb
test-unit-rails-6.1.0 test/test_helper.rb
test-unit-rails-6.0.0 test/test_helper.rb
test-unit-rails-5.2.2 test/test_helper.rb
test-unit-rails-5.2.1 test/test_helper.rb