Created
July 13, 2015 17:42
-
-
Save arthurnn/479e70db1fd75a34eb0b 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 'action_controller/railtie' | |
class HelloController < ActionController::Metal | |
def index | |
self.response_body = "Hello World!" | |
end | |
end | |
class TestApp < Rails::Application | |
config.root = File.dirname(__FILE__) | |
config.session_store :cookie_store, key: 'cookie_store_key' | |
secrets.secret_token = 'secret_token' | |
secrets.secret_key_base = 'secret_key_base' | |
Rails.logger = config.logger = Logger.new($stdout) | |
routes.draw do | |
get 'index', to: 'hello#index' | |
end | |
end | |
require 'minitest/autorun' | |
require 'rack/test' | |
class BugTest < ActionController::TestCase | |
def setup | |
@routes = Rails.application.routes | |
@controller = HelloController.new | |
end | |
def test_returns_success | |
get :index | |
assert_equal "Hello World!", @response.body | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment