File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ def reset
292292 @parent_controller = '::ActionController::Base'
293293 @forgery_protection_settings = { with : :exception }
294294 RailsAdmin ::Config ::Actions . reset
295+ RailsAdmin ::AbstractModel . reset
295296 end
296297
297298 # Reset a provided model's configuration.
Original file line number Diff line number Diff line change @@ -328,6 +328,25 @@ class RecursivelyEmbedsMany
328328 end
329329 end
330330
331+ describe '.reset' do
332+ before do
333+ RailsAdmin . config do |config |
334+ config . included_models = [ 'Player' , 'Team' ]
335+ end
336+ RailsAdmin ::AbstractModel . all
337+ RailsAdmin ::Config . reset
338+ RailsAdmin . config do |config |
339+ config . excluded_models = [ 'Player' ]
340+ end
341+ end
342+ subject { RailsAdmin ::AbstractModel . all . map { |am | am . model . name } }
343+
344+ it 'refreshes the result of RailsAdmin::AbstractModel.all' do
345+ expect ( subject ) . not_to include 'Player'
346+ expect ( subject ) . to include 'Team'
347+ end
348+ end
349+
331350 describe "field types code reloading" do
332351 before { Rails . application . config . cache_classes = false }
333352 after { Rails . application . config . cache_classes = true }
Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ def password_digest(password)
100100
101101 DatabaseCleaner . start
102102 RailsAdmin ::Config . reset
103- RailsAdmin ::AbstractModel . reset
104103 end
105104
106105 config . after ( :each ) do
You can’t perform that action at this time.
0 commit comments