##// END OF EJS Templates
Merged r3905 from trunk....
Eric Davis -
r3841:ae3d54266414
parent child
Show More
@@ -195,11 +195,7 class AccountControllerTest < ActionController::TestCase
195 should_assign_to :user
195 should_assign_to :user
196 should_redirect_to('my page') { {:controller => 'my', :action => 'account'} }
196 should_redirect_to('my page') { {:controller => 'my', :action => 'account'} }
197
197
198 should "create a new user" do
198 should_create_a_new_user { User.last(:conditions => {:login => 'register'}) }
199 user = User.last(:conditions => {:login => 'register'})
200 assert user
201 assert_kind_of User, user
202 end
203
199
204 should 'set the user status to active' do
200 should 'set the user status to active' do
205 user = User.last(:conditions => {:login => 'register'})
201 user = User.last(:conditions => {:login => 'register'})
@@ -162,4 +162,13 class ActiveSupport::TestCase
162 end
162 end
163 end
163 end
164 end
164 end
165
166 def self.should_create_a_new_user(&block)
167 should "create a new user" do
168 user = instance_eval &block
169 assert user
170 assert_kind_of User, user
171 assert !user.new_record?
172 end
173 end
165 end
174 end
General Comments 0
You need to be logged in to leave comments. Login now