summaryrefslogtreecommitdiff
path: root/test/controllers/brackets_controller_test.rb
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-10 17:41:24 -0400
committertkimia <tkimia@purdue.edu>2014-04-10 17:41:24 -0400
commitb09b504fad01988004745363332375697135800a (patch)
tree09cd9a5d9273efe4374ea59471e2e194a4195711 /test/controllers/brackets_controller_test.rb
parenteafa409389ce53ee2ab8eb99e81a3d0f4cc49c74 (diff)
ran generate.sh
Diffstat (limited to 'test/controllers/brackets_controller_test.rb')
-rw-r--r--test/controllers/brackets_controller_test.rb49
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