Fix tests for changes to user model
authorTom Hughes <tom@compton.nu>
Thu, 6 May 2010 21:11:55 +0000 (22:11 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 6 May 2010 21:11:55 +0000 (22:11 +0100)
test/fixtures/users.yml
test/unit/user_test.rb

index 1849fd4d99aae8ddeb603e51f1d58786aa1e4be1..eb3c6ef6d590547fd78b029dd0be720a805a3749 100644 (file)
@@ -2,7 +2,7 @@
 normal_user:
   id: 1
   email: test@openstreetmap.org
 normal_user:
   id: 1
   email: test@openstreetmap.org
-  active: true
+  status: active
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2007-01-01 00:00:00"
   display_name: test
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2007-01-01 00:00:00"
   display_name: test
@@ -15,7 +15,7 @@ normal_user:
 public_user:
   id: 2
   email: test@example.com
 public_user:
   id: 2
   email: test@example.com
-  active: true
+  status: active
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: test2
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: test2
@@ -28,7 +28,7 @@ public_user:
 inactive_user:
   id: 3
   email: inactive@openstreetmap.org
 inactive_user:
   id: 3
   email: inactive@openstreetmap.org
-  active: false
+  status: pending
   pass_crypt: <%= Digest::MD5::hexdigest('test2') %>
   creation_time: "2008-07-01 02:23:45"
   display_name: Inactive User
   pass_crypt: <%= Digest::MD5::hexdigest('test2') %>
   creation_time: "2008-07-01 02:23:45"
   display_name: Inactive User
@@ -41,7 +41,7 @@ inactive_user:
 second_public_user:
   id: 4
   email: public@OpenStreetMap.org
 second_public_user:
   id: 4
   email: public@OpenStreetMap.org
-  active: true
+  status: active
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: pulibc_test2
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: pulibc_test2
@@ -54,7 +54,7 @@ second_public_user:
 moderator_user:
   id: 5
   email: moderator@example.com
 moderator_user:
   id: 5
   email: moderator@example.com
-  active: true
+  status: active
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: moderator
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: moderator
@@ -63,7 +63,7 @@ moderator_user:
 administrator_user:
   id: 6
   email: administrator@example.com
 administrator_user:
   id: 6
   email: administrator@example.com
-  active: true
+  status: active
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: administrator
   pass_crypt: <%= Digest::MD5.hexdigest('test') %>
   creation_time: "2008-05-01 01:23:45"
   display_name: administrator
index f1994f4ddbfc3ebcc7bbb04d6267ab811ae5fd6d..ac2bd5e7145997613879b21d3cf1dbc5439c761c 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 require File.dirname(__FILE__) + '/../test_helper'
 
 class UserTest < ActiveSupport::TestCase
 require File.dirname(__FILE__) + '/../test_helper'
 
 class UserTest < ActiveSupport::TestCase
@@ -18,7 +19,7 @@ class UserTest < ActiveSupport::TestCase
   
   def test_unique_email
     new_user = User.new(:email => users(:normal_user).email,
   
   def test_unique_email
     new_user = User.new(:email => users(:normal_user).email,
-      :active => 1
+      :status => "active"
       :pass_crypt => Digest::MD5.hexdigest('test'),
       :display_name => "new user",
       :data_public => 1,
       :pass_crypt => Digest::MD5.hexdigest('test'),
       :display_name => "new user",
       :data_public => 1,
@@ -29,7 +30,7 @@ class UserTest < ActiveSupport::TestCase
   
   def test_unique_display_name
     new_user = User.new(:email => "tester@openstreetmap.org",
   
   def test_unique_display_name
     new_user = User.new(:email => "tester@openstreetmap.org",
-      :active => 0,
+      :status => "pending",
       :pass_crypt => Digest::MD5.hexdigest('test'),
       :display_name => users(:normal_user).display_name, 
       :data_public => 1,
       :pass_crypt => Digest::MD5.hexdigest('test'),
       :display_name => users(:normal_user).display_name, 
       :data_public => 1,