Merged r3905 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3955 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c731d11209
commit
ae3d542664
@ -195,11 +195,7 @@ class AccountControllerTest < ActionController::TestCase
|
|||||||
should_assign_to :user
|
should_assign_to :user
|
||||||
should_redirect_to('my page') { {:controller => 'my', :action => 'account'} }
|
should_redirect_to('my page') { {:controller => 'my', :action => 'account'} }
|
||||||
|
|
||||||
should "create a new user" do
|
should_create_a_new_user { User.last(:conditions => {:login => 'register'}) }
|
||||||
user = User.last(:conditions => {:login => 'register'})
|
|
||||||
assert user
|
|
||||||
assert_kind_of User, user
|
|
||||||
end
|
|
||||||
|
|
||||||
should 'set the user status to active' do
|
should 'set the user status to active' do
|
||||||
user = User.last(:conditions => {:login => 'register'})
|
user = User.last(:conditions => {:login => 'register'})
|
||||||
|
@ -162,4 +162,13 @@ class ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
end
|
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
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user