Created
August 2, 2013 13:38
-
-
Save lukaszx0/6139950 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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