On Tuesday, April 4, 2017 at 6:19:02 PM UTC-4, Jeremy Evans wrote:
>
> On Tuesday, April 4, 2017 at 2:55:34 PM UTC-7, David Lazar wrote:
>>
>> 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'
>>
>>
> This appears to be an issue with fixture_dependencies and not with Sequel, 
> so this isn't really the appropriate forum.  However, if I had to guess, 
> did you require fixture_dependencies before requiring sequel?  If so, you 
> may want to require sequel first, or specifically require 
> fixture_dependencies/sequel.
>
> Thanks,
> Jeremy  
>


Oh.. sorry... had no idea fixture dependencies was totally separate... with 
the line require 'fixture_dependencies/test_unit/sequel' I figured I should 
be good to go... but apparently not... strange that it still works on other 
apps... guess something updated and borked in the latest... 

 

-- 
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