Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In mountable plugin fixtures from test/dummy/test/fixtures don't load #25493

Closed
yuriihabrusiev opened this issue Jun 23, 2016 · 1 comment
Closed

Comments

@yuriihabrusiev
Copy link

Steps to reproduce

  1. Generate new mountable plugin with rails plugin new cool_plugin --mountable
  2. Go to test/dummy and generate few scaffolds
  3. Return to plugin root and run bin/rails t

Expected behavior

Tests should pass

Actual behavior

Tests don't pass because in test helper we have

if ActiveSupport::TestCase.respond_to?(:fixture_path=)
  ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
  ...
end

Potential solution

Change

ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)

to

ActiveSupport::TestCase.fixture_path = File.expand_path("../dummy/test/fixtures", __FILE__)

in railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb

System configuration

Rails version: 5.0.0.rc2

Ruby version: 2.3.0

@maclover7
Copy link
Contributor

Would you be willing to submit a PR to change this? We can continue the discussion there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants