Patched UsersHelper#user_settings_tabs to add a new Rates tab

* Wrapped UsersHelper#user_settings_tabs with an alias_method_chain
* Added the new Rate element to the return of user_settings_tabs
* Added RSpecs to confirm the change works without breaking
* Added a partial view for users/rates which will be used by Redmine
  when it renders the user edit panel

  #1913
This commit is contained in:
Eric Davis committed 2009-01-16 14:42:33 -08:00
1 parent 48d394704a
commit e1278bcb69
5 files changed
+66 -1

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
require File.dirname(__FILE__) + '/../spec_helper'
class UsersHelperWrapper
include UsersHelper
end
describe UsersHelper, 'user_settings' do
it 'should return 3 tabs' do
helper = UsersHelperWrapper.new
helper.user_settings_tabs.should have(3).things
end
it 'should include a rate tab at the end' do
helper = UsersHelperWrapper.new
rate_tab = helper.user_settings_tabs[-1]
rate_tab.should_not be_nil
end
describe 'rate tab' do
before(:each) do
helper = UsersHelperWrapper.new
@rate_tab = helper.user_settings_tabs[-1]
end
it 'should have the name of "rates"' do
@rate_tab[:name].should eql('rates')
end
it 'should use the rates partial' do
@rate_tab[:partial].should eql('users/rates')
end
it 'should use the i18n rates label' do
@rate_tab[:label].should eql(:rate_label_rates)
end
end
end