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
Ignores use_transactional_fixtures
setting
#56
Comments
To reproduce in a new rails project:
Now, interestingly, if we change our module to a class, then class Banana; end Maybe |
Morning @jaredbeck, looking at this now! |
@jaredbeck, I really dislike the outer describe test style as it relies on matching the class name to a constant in your Rails app. Done via code like this. In this case,
When you say that, you mean this right? require 'test_helper'
class BananaTest < ActiveSupport::TestCase
it 'calls setup_fixtures' do
assert true
end
end If so, this is the style I recommend since it remains within Rails conventions. I high suggest that you maintain that layer and explicitly subclass and use the Minitest DSL within. I would be open to fixing the outer describe too, based on some answer to the above questions too. |
Interesting. Rspec 3 is also moving away from this "test-type inference", as described in this line from the rspec 3.0 release notes.
It's a tradeoff. Removing this feature makes the test framework simpler, but requires developers to write more configuration in their test suite. Regarding the current implementation in MTSR 5.1.1,
In my reproduction above, module Banana; end It is not an ActiveRecord model, so I guess that explains why it's not working.
OK. Let's update the readme to discourage people from using top-level describes. I'll make a PR. |
To be fair, these test classes are typically generated for you by Rails. All you have to do is just type your spec DSL within, but yea, I get the point too :)
AWESOME! Try to include some better examples and rational too. Maybe even context link to RSpec like you did. Really looking forward to it! |
I've gotta get back to work, so I just wrote a simple warning. Feel free to change it / expand on it. |
MTSR 5.1.1 fails to run
ActiveRecord::TestFixtures#setup_fixtures
, causing theuse_transactional_fixtures
setting to be ignored.Without
describe
,setup_fixtures
is called:With describe,
setup_fixtures
is not called:I'd like to use
describe
.Reproducible in MTSR 5.0.4 and 5.1.1.
The text was updated successfully, but these errors were encountered: