]> source.dussan.org Git - redmine.git/commitdiff
Merged r3905 from trunk.
authorEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 04:29:57 +0000 (04:29 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Thu, 19 Aug 2010 04:29:57 +0000 (04:29 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3955 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/account_controller_test.rb
test/test_helper.rb

index 61ad97430d1e356bc63e10230ac33a406060ada9..2a8c9c66bf8da992f7ec6fd5354278208545e610 100644 (file)
@@ -195,11 +195,7 @@ class AccountControllerTest < ActionController::TestCase
       should_assign_to :user
       should_redirect_to('my page') { {:controller => 'my', :action => 'account'} }
 
-      should "create a new user" do
-        user = User.last(:conditions => {:login => 'register'})
-        assert user
-        assert_kind_of User, user
-      end
+      should_create_a_new_user { User.last(:conditions => {:login => 'register'}) }
 
       should 'set the user status to active' do
         user = User.last(:conditions => {:login => 'register'})
index c934e1bc2d01e2d1bf35f5db58cbc2dfdccc1452..15a1f15702d91df4c6fa3868b96510709e1a5174 100644 (file)
@@ -162,4 +162,13 @@ class ActiveSupport::TestCase
       end
     end
   end
+
+  def self.should_create_a_new_user(&block)
+    should "create a new user" do
+      user = instance_eval &block
+      assert user
+      assert_kind_of User, user
+      assert !user.new_record?
+    end
+  end
 end