I have the following code:

require 'test_helper'
require 'fixture_dependencies/test_unit/sequel'

class ProductTransferJobTest < ActiveJob::TestCase

  test "Inventory" do
    FixtureDependencies.load(:store)
    ProductTransferJob.perform_now('foo')
    assert true
  end
end



With a simple set of fixture data... 

store:
  id: 1
  domain: 'foo.com'
  api_token: '66dae12d0709026a95f912c3707bc654'



And this test helper... 

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical 
order.

  # Add more helper methods to be used by all tests here...
  FixtureDependencies.verbose = 3

  def run(*args, &block)
    FixtureDependencies.fixture_path = 'test/fixtures'
    Sequel::Model.db.transaction(rollback: :always, auto_savepoint: true) { 
super }
  end

end



And instead of setting up the store, it bombs now on the fixture 
dependencies.. I am not sure why this is.. same pattern in a different App 
sets up the store and tears it down just fine... so I am stumped.. 

loading store.yml
using store__store
load stack:[]

Error:
ProductTransferJobTest#test_Inventory:
NoMethodError: undefined method `model_find_by_pk_S' for 
FixtureDependencies:Class
    test/jobs/product_transfer_job_test.rb:7:in `block in 
<class:ProductTransferJobTest>'
    test/test_helper.rb:14:in `block in run'
    test/test_helper.rb:14:in `run'

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to