diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-03 22:20:02 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-03-03 22:20:02 -0500 |
commit | 423d0e5a440d8d66407522bc842ef273196173bc (patch) | |
tree | ec2dfc14881734c4585622962235b225c653da04 /test/controllers/servers_controller_test.rb | |
parent | f825d7e30ff6393b66a5abcc05a33f72d7d6712b (diff) |
run ./generate.sh
Diffstat (limited to 'test/controllers/servers_controller_test.rb')
-rw-r--r-- | test/controllers/servers_controller_test.rb | 49 |
1 files changed, 49 insertions, 0 deletions
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 |