Skip to content

Instantly share code, notes, and snippets.

@lukaszx0
Created August 2, 2013 13:38
Show Gist options
  • Save lukaszx0/6139950 to your computer and use it in GitHub Desktop.
Save lukaszx0/6139950 to your computer and use it in GitHub Desktop.
class TestController < ActionController::Base
protect_from_forgery
def render_string_hello_world
render "Hello world!"
end
def render_text_hello_world
render :text => "hello world"
end
end
class RenderTest < ActionController::TestCase
tests TestController
def test_render_string
get :hello_world
assert_response 200
assert_response :success
assert_equal "Hello world!", @response.body
end
def test_render_option_text
get :render_text_hello_world
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