@@ -195,11 +195,7 class AccountControllerTest < ActionController::TestCase | |||
|
195 | 195 | should_assign_to :user |
|
196 | 196 | should_redirect_to('my page') { {:controller => 'my', :action => 'account'} } |
|
197 | 197 | |
|
198 | should "create a new user" do | |
|
199 | user = User.last(:conditions => {:login => 'register'}) | |
|
200 | assert user | |
|
201 | assert_kind_of User, user | |
|
202 | end | |
|
198 | should_create_a_new_user { User.last(:conditions => {:login => 'register'}) } | |
|
203 | 199 | |
|
204 | 200 | should 'set the user status to active' do |
|
205 | 201 | user = User.last(:conditions => {:login => 'register'}) |
@@ -162,4 +162,13 class ActiveSupport::TestCase | |||
|
162 | 162 | end |
|
163 | 163 | end |
|
164 | 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 | 174 | end |
General Comments 0
You need to be logged in to leave comments.
Login now