|
|
|
@ -26,21 +26,23 @@ |
|
|
|
|
# See doc/COPYRIGHT.rdoc for more details. |
|
|
|
|
#++ |
|
|
|
|
|
|
|
|
|
require File.expand_path('../../spec_helper', __FILE__) |
|
|
|
|
require File.expand_path('../../spec_helper', __FILE__) |
|
|
|
|
|
|
|
|
|
describe Timeline do |
|
|
|
|
describe 'helper methods for creation' do |
|
|
|
|
describe 'available_responsibles' do |
|
|
|
|
it 'is sorted according to general setting' do |
|
|
|
|
ab = FactoryGirl.create(:user, :firstname => 'a', :lastname => 'b') |
|
|
|
|
describe Timeline do |
|
|
|
|
describe 'helper methods for creation' do |
|
|
|
|
describe 'available_responsibles' do |
|
|
|
|
it 'is sorted according to general setting' do |
|
|
|
|
ab = FactoryGirl.create(:user, :firstname => 'a', :lastname => 'b') |
|
|
|
|
ba = FactoryGirl.create(:user, :firstname => 'b', :lastname => 'a') |
|
|
|
|
t = Timeline.new |
|
|
|
|
|
|
|
|
|
Setting.user_format = :firstname_lastname |
|
|
|
|
t.available_responsibles.should == [ab, ba] |
|
|
|
|
with_settings :user_format => :firstname_lastname do |
|
|
|
|
t.available_responsibles.should == [ab, ba] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
Setting.user_format = :lastname_firstname |
|
|
|
|
t.available_responsibles.should == [ba, ab] |
|
|
|
|
with_settings :user_format => :lastname_firstname do |
|
|
|
|
t.available_responsibles.should == [ba, ab] |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|