diff options
Diffstat (limited to 'test/functional/messages_controller_test.rb')
-rw-r--r-- | test/functional/messages_controller_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 1fe8d086a..b1b3ea942 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -40,6 +40,15 @@ class MessagesControllerTest < Test::Unit::TestCase assert_not_nil assigns(:topic) end + def test_show_with_reply_permission + @request.session[:user_id] = 2 + get :show, :board_id => 1, :id => 1 + assert_response :success + assert_template 'show' + assert_tag :div, :attributes => { :id => 'reply' }, + :descendant => { :tag => 'textarea', :attributes => { :id => 'message_content' } } + end + def test_show_message_not_found get :show, :board_id => 1, :id => 99999 assert_response 404 @@ -108,4 +117,11 @@ class MessagesControllerTest < Test::Unit::TestCase assert_redirected_to 'boards/show' assert_nil Message.find_by_id(1) end + + def test_quote + @request.session[:user_id] = 2 + xhr :get, :quote, :board_id => 1, :id => 3 + assert_response :success + assert_select_rjs :show, 'reply' + end end |