diff options
author | tkimia <tkimia@purdue.edu> | 2014-04-10 17:41:24 -0400 |
---|---|---|
committer | tkimia <tkimia@purdue.edu> | 2014-04-10 17:41:24 -0400 |
commit | b09b504fad01988004745363332375697135800a (patch) | |
tree | 09cd9a5d9273efe4374ea59471e2e194a4195711 /test/controllers/brackets_controller_test.rb | |
parent | eafa409389ce53ee2ab8eb99e81a3d0f4cc49c74 (diff) |
ran generate.sh
Diffstat (limited to 'test/controllers/brackets_controller_test.rb')
-rw-r--r-- | test/controllers/brackets_controller_test.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/controllers/brackets_controller_test.rb b/test/controllers/brackets_controller_test.rb new file mode 100644 index 0000000..3f45a64 --- /dev/null +++ b/test/controllers/brackets_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class BracketsControllerTest < ActionController::TestCase + setup do + @bracket = brackets(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:brackets) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create bracket" do + assert_difference('Bracket.count') do + post :create, bracket: { name: @bracket.name, tournament_id: @bracket.tournament_id, user_id: @bracket.user_id } + end + + assert_redirected_to bracket_path(assigns(:bracket)) + end + + test "should show bracket" do + get :show, id: @bracket + assert_response :success + end + + test "should get edit" do + get :edit, id: @bracket + assert_response :success + end + + test "should update bracket" do + patch :update, id: @bracket, bracket: { name: @bracket.name, tournament_id: @bracket.tournament_id, user_id: @bracket.user_id } + assert_redirected_to bracket_path(assigns(:bracket)) + end + + test "should destroy bracket" do + assert_difference('Bracket.count', -1) do + delete :destroy, id: @bracket + end + + assert_redirected_to brackets_path + end +end |