added user test, basic user methods

This commit is contained in:
Albert Yi
2010-02-06 16:48:40 -05:00
parent 130810e21f
commit 3bfae1f0db
67 changed files with 1350 additions and 282 deletions

View File

@@ -0,0 +1,8 @@
require 'test_helper'
class DeletedPostTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@@ -0,0 +1,8 @@
require 'test_helper'
class PendingPostTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

8
test/unit/post_test.rb Normal file
View File

@@ -0,0 +1,8 @@
require 'test_helper'
class PostTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@@ -0,0 +1,8 @@
require 'test_helper'
class PostVersionTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

8
test/unit/tag_test.rb Normal file
View File

@@ -0,0 +1,8 @@
require 'test_helper'
class TagTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

17
test/unit/user_test.rb Normal file
View File

@@ -0,0 +1,17 @@
require File.dirname(__FILE__) + '/../test_helper'
class UserTest < ActiveSupport::TestCase
context "A user" do
setup do
MEMCACHE.flush_all
end
should "be authenticate" do
@user = Factory.create(:user)
assert(User.authenticate(@user.name, "password"), "Authentication should have succeeded")
assert(!User.authenticate(@user.name, "password2"), "Authentication should not have succeeded")
assert(User.authenticate_hash(@user.name, @user.password_hash), "Authentication should have succeeded")
assert(!User.authenticate_hash(@user.name, "xxxx"), "Authentication should not have succeeded")
end
end
end