summaryrefslogtreecommitdiff
path: root/test/controllers/games_controller_test.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-02-27 16:59:04 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-02-27 16:59:04 -0500
commit3a7b14f4a51c0fdb8b71720f361a0a8ccf080325 (patch)
treeb677c4e56d96dfc872ae58d0d0e45d8243750441 /test/controllers/games_controller_test.rb
parent8e3e88f52c1f2d73acdcb7fdf60326b5f7717068 (diff)
add game types
Diffstat (limited to 'test/controllers/games_controller_test.rb')
-rw-r--r--test/controllers/games_controller_test.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/controllers/games_controller_test.rb b/test/controllers/games_controller_test.rb
new file mode 100644
index 0000000..420758e
--- /dev/null
+++ b/test/controllers/games_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class GamesControllerTest < ActionController::TestCase
+ setup do
+ @game = games(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:games)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create game" do
+ assert_difference('Game.count') do
+ post :create, game: { name: @game.name }
+ end
+
+ assert_redirected_to game_path(assigns(:game))
+ end
+
+ test "should show game" do
+ get :show, id: @game
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @game
+ assert_response :success
+ end
+
+ test "should update game" do
+ patch :update, id: @game, game: { name: @game.name }
+ assert_redirected_to game_path(assigns(:game))
+ end
+
+ test "should destroy game" do
+ assert_difference('Game.count', -1) do
+ delete :destroy, id: @game
+ end
+
+ assert_redirected_to games_path
+ end
+end