Forum: Ruby on Rails Unit Testing with authlogic

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Elias O. (Guest)
on 2009-06-04 11:12
(Received via mailing list)
Hi guys,

I am new to the testing world and was trying to test my user model. My
user model has the acts_as_authentic line on it, so a number of things
are added to it.

I added the:

require "authlogic/test_case"

to the test_helper.rb and did this on my user_test.rb. Its just a
simple test to see if check if authlogic is checking that certains e-
mails could be invalid. But my test fails. Can anyone point me up in
the right direction on how to make this test?

require 'test_helper'
class UserTest < ActiveSupport::TestCase
  setup :activate_authlogic

  test "invalid email" do
    user = User.new(:email => 'something')
    assert user.errors.invalid?(:email)
  end

end
This topic is locked and can not be replied to.