{"action":"created","issue":{"url":"https://api.github.com/repos/blowmage/minitest-rails/issues/167","labels_url":"https://api.github.com/repos/blowmage/minitest-rails/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/blowmage/minitest-rails/issues/167/comments","events_url":"https://api.github.com/repos/blowmage/minitest-rails/issues/167/events","html_url":"https://github.com/blowmage/minitest-rails/issues/167","id":54024827,"number":167,"title":"In Rails engine, NoMethodError <fixtures-name> when trying to access fixtures","user":{"login":"bikramwp","id":1194355,"avatar_url":"https://avatars.githubusercontent.com/u/1194355?v=3","gravatar_id":"","url":"https://api.github.com/users/bikramwp","html_url":"https://github.com/bikramwp","followers_url":"https://api.github.com/users/bikramwp/followers","following_url":"https://api.github.com/users/bikramwp/following{/other_user}","gists_url":"https://api.github.com/users/bikramwp/gists{/gist_id}","starred_url":"https://api.github.com/users/bikramwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bikramwp/subscriptions","organizations_url":"https://api.github.com/users/bikramwp/orgs","repos_url":"https://api.github.com/users/bikramwp/repos","events_url":"https://api.github.com/users/bikramwp/events{/privacy}","received_events_url":"https://api.github.com/users/bikramwp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T06:40:07Z","updated_at":"2015-01-13T17:19:26Z","closed_at":null,"body":"Hi,\r\n  \r\nI am trying to test a Rails engine with minitest-rails but am not able to use fixtures in my\r\ntest cases. (tried on rails 4.1/4.2 and minitest-rails 2.1.1; not using rspec at all)\r\n\r\nWithout minitest-rails, fixtures work:\r\n\r\n```ruby\r\nrequire 'test_helper'\r\nmodule Foo\r\n  class CustomerTest < ActiveSupport::TestCase\r\n    test \"alex is id 5\" do\r\n      assert foo_customers(:alex).id, 5\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nWith minitest-rails, I get error\r\n```ruby\r\nrequire 'test_helper'\r\nmodule Foo\r\n  describe Customer do\r\n    let(:alex) {foo_customers(:alex) } # error here\r\n    test \"alex is id 5\" do\r\n      assert alex.id, 5\r\n    end\r\n  end\r\nend\r\n```\r\nError is:\r\n```\r\nNoMethodError: undefined method `foo_customers' for #<#<Class:0x007f07822daee8>:0x007f07820224a8>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/blowmage/minitest-rails/issues/comments/69781833","html_url":"https://github.com/blowmage/minitest-rails/issues/167#issuecomment-69781833","issue_url":"https://api.github.com/repos/blowmage/minitest-rails/issues/167","id":69781833,"user":{"login":"blowmage","id":730,"avatar_url":"https://avatars.githubusercontent.com/u/730?v=3","gravatar_id":"","url":"https://api.github.com/users/blowmage","html_url":"https://github.com/blowmage","followers_url":"https://api.github.com/users/blowmage/followers","following_url":"https://api.github.com/users/blowmage/following{/other_user}","gists_url":"https://api.github.com/users/blowmage/gists{/gist_id}","starred_url":"https://api.github.com/users/blowmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blowmage/subscriptions","organizations_url":"https://api.github.com/users/blowmage/orgs","repos_url":"https://api.github.com/users/blowmage/repos","events_url":"https://api.github.com/users/blowmage/events{/privacy}","received_events_url":"https://api.github.com/users/blowmage/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T17:19:26Z","updated_at":"2015-01-13T17:19:26Z","body":"Can you copy/paste your `test/test_helper.rb` file? This looks to me that `minitest/rails` isn't getting required properly. It should be required after `rails/test_help`.\r\n\r\nFWIW, you can test that the spec DSL is resolving your constants correctly by adding a test like this one:\r\n\r\n```ruby\r\nmodule Foo\r\n  describe Customer do\r\n    it \"uses the right test class\" do\r\n      self.class.ancestors.must_include ActiveSupport::TestCase\r\n    end\r\n  end\r\nend\r\n```"}}