forked from activeadmin/inherited_resources
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes activeadmin#618
- Loading branch information
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'test_helper' | ||
|
||
def force_parent_controller(value) | ||
InheritedResources.send(:remove_const, :Base) | ||
InheritedResources.parent_controller = value | ||
load File.join(__dir__, '..', 'app', 'controllers', 'inherited_resources', 'base.rb') | ||
end | ||
|
||
class ParentControllerTest < ActionController::TestCase | ||
def test_setting_parent_controller | ||
original_parent = InheritedResources::Base.superclass | ||
|
||
assert_equal ApplicationController, original_parent | ||
force_parent_controller('ActionController::Base') | ||
|
||
assert_equal ActionController::Base, InheritedResources::Base.superclass | ||
force_parent_controller(original_parent.to_s) # restore original parent | ||
end | ||
end |