mercredi 6 mai 2015

Fixture Class Not found error on simple rails testing

I am trying to set up the rails testing framework but am facing some issues. My setup is as follows

test/models/clinic_test.rb

require 'test_helper'

class ClinicTest < ActiveSupport::TestCase
  test "sample" do
    clinic = clinics(:myclinic)
    assert(clinic.name == 'Krishan')
  end
end

test/fixtures/clinics.yml

myclinic:
  name: Krishan

But when I run the clinic_test rake process I get the following error:

ActiveRecord::FixtureClassNotFound: No class attached to find
   test/models/clinic_test.rb:5:in `block in <class:ClinicTest>'

I see that the database is actually populated with the sample data from the clinics.yml file.

Where is the problem? Is this some configuration issue?

Aucun commentaire:

Enregistrer un commentaire