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

43 lines
910 B
Ruby
Raw Normal View History

require "isolation/abstract_unit"
module ApplicationTests
2012-01-05 20:30:17 -05:00
class RackupTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
def rackup
require "rack"
2011-11-11 05:04:47 -05:00
app, _ = Rack::Builder.parse_file("#{app_path}/config.ru")
app
end
def setup
build_app
end
def teardown
teardown_app
end
2016-07-12 02:51:36 -04:00
test "Rails app is present" do
assert File.exist?(app_path("config"))
end
test "config.ru can be racked up" do
Dir.chdir app_path do
@app = rackup
assert_welcome get("/")
end
end
test "Rails.application is available after config.ru has been racked up" do
rackup
assert_kind_of Rails::Application, Rails.application
end
test "the config object is available on the application object" do
rackup
assert_equal "UTC", Rails.application.config.time_zone
end
end
end