From 66827d06406806471b055ec888e6fca01b1594ac Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sun, 3 Mar 2013 13:55:11 -0600 Subject: [PATCH] add test coverage for when we don't have any users It wasn't being covered in the functional test for this controller. --- test/functional/users_controller_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index b42bcb00..bacb95e8 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -87,6 +87,13 @@ class UsersControllerTest < ActionController::TestCase # Signup and creation of new users # ============================================ + def test_with_no_users + User.expects(:no_users_yet?).returns(true) + get :new + assert_match assigns['heading'], /get started/ + assert_not_nil assigns[:user] + end + def test_create_adds_a_new_nonadmin_user login_as :admin_user post :create, :user => {:login => 'newbie', :password => 'newbiepass', :password_confirmation => 'newbiepass'}