Converted RateUsersHelperPatch test to Test::Unit.
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
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_rate_history)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
37
test/unit/lib/rate_users_helper_patch_test.rb
Normal file
37
test/unit/lib/rate_users_helper_patch_test.rb
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
require File.dirname(__FILE__) + '/../../test_helper'
|
||||||
|
|
||||||
|
class UsersHelperWrapper
|
||||||
|
include UsersHelper
|
||||||
|
end
|
||||||
|
|
||||||
|
class RateUsersHelperPatchTest < ActiveSupport::TestCase
|
||||||
|
should 'should return 3 tabs' do
|
||||||
|
helper = UsersHelperWrapper.new
|
||||||
|
assert_equal 3, helper.user_settings_tabs.length
|
||||||
|
end
|
||||||
|
|
||||||
|
should 'should include a rate tab at the end' do
|
||||||
|
helper = UsersHelperWrapper.new
|
||||||
|
rate_tab = helper.user_settings_tabs[-1]
|
||||||
|
assert_not_nil rate_tab
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'rate tab' do
|
||||||
|
setup do
|
||||||
|
helper = UsersHelperWrapper.new
|
||||||
|
@rate_tab = helper.user_settings_tabs[-1]
|
||||||
|
end
|
||||||
|
|
||||||
|
should 'should have the name of "rates"' do
|
||||||
|
assert_equal 'rates', @rate_tab[:name]
|
||||||
|
end
|
||||||
|
|
||||||
|
should 'should use the rates partial' do
|
||||||
|
assert_equal 'users/rates', @rate_tab[:partial]
|
||||||
|
end
|
||||||
|
|
||||||
|
should 'should use the i18n rates label' do
|
||||||
|
assert_equal :rate_label_rate_history, @rate_tab[:label]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user