git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3955
e93f8b46-1217-0410-a6f0-
8f06a7374b81
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'})
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