Revision 2751a260
Added by Dominic Cleal over 7 years ago
test/models/shared/taxonomies_base_test.rb | ||
---|---|---|
|
||
setup do
|
||
User.current = users :admin
|
||
taxonomy_class.current = nil # Any context
|
||
end
|
||
|
||
test 'name can be the same if parent is different' do
|
||
... | ... | |
taxonomy = taxonomies(:"#{taxonomy_name}1")
|
||
assert_empty taxonomy.ignore_types
|
||
taxonomy.ignore_types << 'Environment'
|
||
taxonomy_class.current = taxonomy
|
||
assert taxonomy_class.ignore?('Environment')
|
||
in_taxonomy(taxonomy) do
|
||
assert taxonomy_class.ignore?('Environment')
|
||
end
|
||
end
|
||
|
||
test "'no current Taxonomy' is understood as 'any taxonomy'" do
|
Also available in: Unified diff
refs #17526 - reset taxonomy.current after each test
The shared "ignores the taxable_type if current taxonomy ignores it"
test failed to reset the taxonomy in teardown, instead using the setup
routine. This causes failures in different test cases when the test was
last to run.