Forum: Ruby on Rails One of my attributes is nil, but it shouldn't be

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.
Pat M. (Guest)
on 2005-12-14 13:47
(Received via mailing list)
This is driving me crazy.  When I create a new object in console, the
attribute is not nil.  When I create a new object in my unit test, the
attribute is nil.  What gives?



baggio:~/work/mesafire pergesu$ ./script/console
Loading development environment.
>> e = Event.new
=> #<Event:0x234a514 @attributes={"name"=>nil, "timexstring"=>"",
"description"=>nil}, @new_record=true>
>> e.timexstring.nil?
=> false



  def test_append_timex
    e = Event.new
    assert !e.timexstring.nil?
  end

  1) Failure:
test_append_timex(EventTest) [test/unit/event_test.rb:39]:
<false> is not true.
This topic is locked and can not be replied to.