I’ve been having a strange issue with some fixtures being loaded that
I don’t think should be. Anyway, I took the entire fixtures directive
out to see what the problem might be. It turns out that the fixtures
are being loaded even if there’s no fixtures directive. Here’s the
entire test file.
require File.dirname(FILE) + ‘/…/test_helper’
class TicketTest < Test::Unit::TestCase
def test_create
t = Ticket.find(1)
assert_kind_of Ticket, t
puts t.inspect
end
end
I would think that I should get some error, because the tickets table
is never populated, thus there should be no record with id=1. However
this runs just fine, and shows the object that’s specified in my
tickets.yml fixtures file.
I thought fixtures don’t get loaded unless you specify them with the
fixtures directive. Obviously I’m wrong about that…but it’s the
behavior I’d like to have, so how can I get that? Rails 0.14.3, Ruby
1.8.2, the test_helper.rb is the default with
use_transactional_fixtures=true and use_instantiated_fixtures=false.
Pat