Feature #43259 » 0002-Find-wiki-toolbar-buttons-defined-in-modules-include.patch
| lib/redmine/wiki_toolbar.rb | ||
|---|---|---|
|
# does not use the toolbar
|
||
|
def self.buttons(format)
|
||
|
helper = Redmine::WikiFormatting.helper_for(format)
|
||
|
helper::WIKI_TOOLBAR_BUTTONS if helper.const_defined?(:WIKI_TOOLBAR_BUTTONS, false)
|
||
|
helper.const_get(:WIKI_TOOLBAR_BUTTONS) if helper.const_defined?(:WIKI_TOOLBAR_BUTTONS)
|
||
|
end
|
||
|
# Returns the names of the buttons that open a dropdown menu
|
||
| test/helpers/wiki_toolbar_helper_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_buttons_of_a_helper_including_a_core_helper
|
||
|
helper = Module.new {include Redmine::WikiFormatting::CommonMark::Helper}
|
||
|
Redmine::WikiFormatting.stubs(:helper_for).with('foo').returns(helper)
|
||
|
assert_equal Redmine::WikiFormatting::CommonMark::Helper::WIKI_TOOLBAR_BUTTONS, Redmine::WikiToolbar.buttons('foo')
|
||
|
end
|
||
|
def test_buttons_should_be_translated
|
||
|
with_settings :text_formatting => 'common_mark' do
|
||
|
set_language_if_valid 'fr'
|
||