From 07a994593da3c3eb5cae55ea54c55fcc8b67869d Mon Sep 17 00:00:00 2001 From: Philipp Fischbeck Date: Wed, 9 Sep 2015 17:56:13 +0200 Subject: [PATCH] Add test for incorrect problem count --- test/controllers/admin/dashboard_controller_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/controllers/admin/dashboard_controller_test.rb b/test/controllers/admin/dashboard_controller_test.rb index 99ea7bb..f6be4fb 100644 --- a/test/controllers/admin/dashboard_controller_test.rb +++ b/test/controllers/admin/dashboard_controller_test.rb @@ -18,4 +18,10 @@ class Admin::DashboardControllerTest < ActionController::TestCase assert_equal 15, Problem.count end + test "should fail incorrect problem count" do + post :update_problem_count, problem_count: 2 + assert_redirected_to controller: 'admin/dashboard', action: 'index' + assert_equal 3, Problem.count + end + end