Sha256: 7839a9ca3f6bb7df91e2d11cf18d8c2d0c0d144d625dd12a8ed41944d1c5ca7a
Contents?: true
Size: 1.33 KB
Versions: 7
Compression:
Stored size: 1.33 KB
Contents
require "minitest/autorun" require "rails" require "rails/generators" require "sqlite3" require "active_record" require "action_controller" require "action_controller/railtie" require "action_mailer" require "minitest-rails" require "rails/test_help" require "minitest/rails" require "fakefs/safe" class FakeFS::File def self.binread file File.open(file, "rb") { |f| f.read } end end class GeneratorTest < Minitest::Test def setup Rails::Generators.no_color! FakeFS.activate! FakeFS::FileSystem.clone "lib/generators" end def teardown FakeFS::FileSystem.clear FakeFS.deactivate! end end require "rails/test_help" module TestApp class Application < ::Rails::Application config.secret_key_base = "abc123" end end TestApp::Application.initialize! class ApplicationController < ActionController::Base; end class ModelsController < ApplicationController def index; render :text => "<html><head><title>Models</title></head><body><h1>All Models</h1></body></html>"; end def new; redirect_to "/models"; end end module Admin class WidgetsController < ApplicationController; end end TestApp::Application.routes.draw do # root :to => "models#index" resources :models namespace :admin do resources :widgets end end ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
Version data entries
7 entries across 7 versions & 1 rubygems