summaryrefslogtreecommitdiff
path: root/test/controllers
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-02-18 18:16:28 -0500
committerAndrewMurrell <amurrel@purdue.edu>2014-02-18 18:16:28 -0500
commit94a5654371812905c154f29cef393d42f13c5eaa (patch)
tree6bd168b6837f8ae9e4725bc1cdbdfc52cb1f9c5c /test/controllers
parent5f5a3ca46b0c59f698a49de463d72492cfe60f37 (diff)
Added the generate shell command. Please do not commit the generated files.
Diffstat (limited to 'test/controllers')
-rw-r--r--test/controllers/matches_controller_test.rb49
-rw-r--r--test/controllers/servers_controller_test.rb49
-rw-r--r--test/controllers/teams_controller_test.rb49
-rw-r--r--test/controllers/tournaments_controller_test.rb49
-rw-r--r--test/controllers/users_controller_test.rb49
5 files changed, 245 insertions, 0 deletions
diff --git a/test/controllers/matches_controller_test.rb b/test/controllers/matches_controller_test.rb
new file mode 100644
index 0000000..353ff4b
--- /dev/null
+++ b/test/controllers/matches_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class MatchesControllerTest < ActionController::TestCase
+ setup do
+ @match = matches(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:matches)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create match" do
+ assert_difference('Match.count') do
+ post :create, match: { }
+ end
+
+ assert_redirected_to match_path(assigns(:match))
+ end
+
+ test "should show match" do
+ get :show, id: @match
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @match
+ assert_response :success
+ end
+
+ test "should update match" do
+ patch :update, id: @match, match: { }
+ assert_redirected_to match_path(assigns(:match))
+ end
+
+ test "should destroy match" do
+ assert_difference('Match.count', -1) do
+ delete :destroy, id: @match
+ end
+
+ assert_redirected_to matches_path
+ end
+end
diff --git a/test/controllers/servers_controller_test.rb b/test/controllers/servers_controller_test.rb
new file mode 100644
index 0000000..5891bb0
--- /dev/null
+++ b/test/controllers/servers_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class ServersControllerTest < ActionController::TestCase
+ setup do
+ @server = servers(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:servers)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create server" do
+ assert_difference('Server.count') do
+ post :create, server: { }
+ end
+
+ assert_redirected_to server_path(assigns(:server))
+ end
+
+ test "should show server" do
+ get :show, id: @server
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @server
+ assert_response :success
+ end
+
+ test "should update server" do
+ patch :update, id: @server, server: { }
+ assert_redirected_to server_path(assigns(:server))
+ end
+
+ test "should destroy server" do
+ assert_difference('Server.count', -1) do
+ delete :destroy, id: @server
+ end
+
+ assert_redirected_to servers_path
+ end
+end
diff --git a/test/controllers/teams_controller_test.rb b/test/controllers/teams_controller_test.rb
new file mode 100644
index 0000000..8bf60be
--- /dev/null
+++ b/test/controllers/teams_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class TeamsControllerTest < ActionController::TestCase
+ setup do
+ @team = teams(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:teams)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create team" do
+ assert_difference('Team.count') do
+ post :create, team: { }
+ end
+
+ assert_redirected_to team_path(assigns(:team))
+ end
+
+ test "should show team" do
+ get :show, id: @team
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @team
+ assert_response :success
+ end
+
+ test "should update team" do
+ patch :update, id: @team, team: { }
+ assert_redirected_to team_path(assigns(:team))
+ end
+
+ test "should destroy team" do
+ assert_difference('Team.count', -1) do
+ delete :destroy, id: @team
+ end
+
+ assert_redirected_to teams_path
+ end
+end
diff --git a/test/controllers/tournaments_controller_test.rb b/test/controllers/tournaments_controller_test.rb
new file mode 100644
index 0000000..9363bdf
--- /dev/null
+++ b/test/controllers/tournaments_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class TournamentsControllerTest < ActionController::TestCase
+ setup do
+ @tournament = tournaments(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:tournaments)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create tournament" do
+ assert_difference('Tournament.count') do
+ post :create, tournament: { }
+ end
+
+ assert_redirected_to tournament_path(assigns(:tournament))
+ end
+
+ test "should show tournament" do
+ get :show, id: @tournament
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @tournament
+ assert_response :success
+ end
+
+ test "should update tournament" do
+ patch :update, id: @tournament, tournament: { }
+ assert_redirected_to tournament_path(assigns(:tournament))
+ end
+
+ test "should destroy tournament" do
+ assert_difference('Tournament.count', -1) do
+ delete :destroy, id: @tournament
+ end
+
+ assert_redirected_to tournaments_path
+ end
+end
diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb
new file mode 100644
index 0000000..846e74c
--- /dev/null
+++ b/test/controllers/users_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ setup do
+ @user = users(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:users)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create user" do
+ assert_difference('User.count') do
+ post :create, user: { }
+ end
+
+ assert_redirected_to user_path(assigns(:user))
+ end
+
+ test "should show user" do
+ get :show, id: @user
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @user
+ assert_response :success
+ end
+
+ test "should update user" do
+ patch :update, id: @user, user: { }
+ assert_redirected_to user_path(assigns(:user))
+ end
+
+ test "should destroy user" do
+ assert_difference('User.count', -1) do
+ delete :destroy, id: @user
+ end
+
+ assert_redirected_to users_path
+ end
+end