Show More
Commit Description:
added message hiding for admin in msg console...
Commit Description:
added message hiding for admin in msg console
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@371 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
test/functional/main_controller_test.rb
| 32 lines
| 808 B
| text/x-ruby
| RubyLexer
|
|
r0 | require File.dirname(__FILE__) + '/../test_helper' | ||
require 'main_controller' | ||||
# Re-raise errors caught by the controller. | ||||
class MainController; def rescue_action(e) raise e end; end | ||||
class MainControllerTest < Test::Unit::TestCase | ||||
|
r58 | |||
fixtures :problems | ||||
fixtures :users | ||||
|
r0 | def setup | ||
@controller = MainController.new | ||||
@request = ActionController::TestRequest.new | ||||
@response = ActionController::TestResponse.new | ||||
end | ||||
# Replace this with your real tests. | ||||
|
r58 | def test_should_redirect_new_user_to_login | ||
get :list | ||||
assert_redirected_to :action => 'login' | ||||
|
r0 | end | ||
|
r58 | |||
def test_should_list_available_problems_if_logged_in | ||||
john = users(:john) | ||||
get :list, {}, {:user_id => john.id} | ||||
assert_template 'main/list' | ||||
assert_select "table tr:nth-child(2)", :text => /\(add\)/ | ||||
end | ||||
|
r0 | end | ||