Commit e5065105a961e51ad508a22dd849501e4649be2e
1 parent
aaf12df2
Exists in
master
and in
29 other branches
r248@sede: terceiro | 2007-07-29 19:12:56 -0300
ActionItem0: testing the fact that I can override design on controller subclasses git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@252 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
14 additions
and
0 deletions
Show diff stats
vendor/plugins/design/test/design_test.rb
... | ... | @@ -50,4 +50,10 @@ class DesignTest < Test::Unit::TestCase |
50 | 50 | assert_equal File.join(RAILS_ROOT, 'public'), Design.public_filesystem_root |
51 | 51 | end |
52 | 52 | |
53 | + def test_subclass_controller_can_override_superclass_design_holder | |
54 | + assert_equal 'sample_object', ProxyDesignHolderTestController.send(:design_plugin_config)[:holder] | |
55 | + assert_equal 'another_object', InheritanceDesignTestController.send(:design_plugin_config)[:holder] | |
56 | + | |
57 | + end | |
58 | + | |
53 | 59 | end | ... | ... |
vendor/plugins/design/test/test_helper.rb
... | ... | @@ -56,6 +56,14 @@ class ProxyDesignHolderTestController < ActionController::Base |
56 | 56 | end |
57 | 57 | end |
58 | 58 | |
59 | +class AnotherTestDesignHolder | |
60 | + attr_accessor :template, :theme, :icon_theme, :boxes | |
61 | +end | |
62 | + | |
63 | +class InheritanceDesignTestController < ProxyDesignHolderTestController | |
64 | + design :holder => 'another_object' | |
65 | +end | |
66 | + | |
59 | 67 | class DesignEditorTestController < ActionController::Base |
60 | 68 | design_editor :holder => 'sample_object' |
61 | 69 | def initialize | ... | ... |