Commit bbcf505a376d58204a010ee0457b67ca00337985

Authored by Antonio Terceiro
1 parent c140dcd8

Fixing tests

test/functional/profile_controller_test.rb
@@ -156,7 +156,7 @@ class ProfileControllerTest < Test::Unit::TestCase @@ -156,7 +156,7 @@ class ProfileControllerTest < Test::Unit::TestCase
156 community = Community.create!(:name => 'my test community') 156 community = Community.create!(:name => 'my test community')
157 community.add_admin(@profile) 157 community.add_admin(@profile)
158 get :index, :profile => community.identifier 158 get :index, :profile => community.identifier
159 - assert_tag :tag => 'a', :attributes => { :href => /\/myprofile\/%\{login\}/ }, :content => 'Control panel' 159 + assert_tag :tag => 'a', :attributes => { :href => /\/myprofile\/\{login\}/ }, :content => 'Control panel'
160 end 160 end
161 161
162 should 'show create community in own profile' do 162 should 'show create community in own profile' do
test/integration/manage_documents_test.rb
@@ -8,7 +8,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest @@ -8,7 +8,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest
8 create_user('myuser') 8 create_user('myuser')
9 9
10 login('myuser', 'myuser') 10 login('myuser', 'myuser')
11 - assert_tag :tag => 'a', :attributes => { :href => '/myprofile/%{login}' } 11 + assert_tag :tag => 'a', :attributes => { :href => '/myprofile/{login}' }
12 12
13 get '/myprofile/myuser' 13 get '/myprofile/myuser'
14 assert_response :success 14 assert_response :success
@@ -38,7 +38,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest @@ -38,7 +38,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest
38 article.save! 38 article.save!
39 39
40 login('myuser', 'myuser') 40 login('myuser', 'myuser')
41 - assert_tag :tag => 'a', :attributes => { :href => '/myprofile/%{login}' } 41 + assert_tag :tag => 'a', :attributes => { :href => '/myprofile/{login}' }
42 42
43 get '/myprofile/myuser' 43 get '/myprofile/myuser'
44 assert_response :success 44 assert_response :success
@@ -72,7 +72,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest @@ -72,7 +72,7 @@ class ManageDocumentsTest < ActionController::IntegrationTest
72 72
73 login('myuser', 'myuser') 73 login('myuser', 'myuser')
74 74
75 - assert_tag :tag => 'a', :attributes => { :href => '/myprofile/%{login}' } 75 + assert_tag :tag => 'a', :attributes => { :href => '/myprofile/{login}' }
76 get '/myprofile/myuser' 76 get '/myprofile/myuser'
77 assert_response :success 77 assert_response :success
78 78
test/unit/events_helper_test.rb
@@ -5,10 +5,11 @@ class EventsHelperTest < Test::Unit::TestCase @@ -5,10 +5,11 @@ class EventsHelperTest < Test::Unit::TestCase
5 include EventsHelper 5 include EventsHelper
6 6
7 should 'list events' do 7 should 'list events' do
  8 + stubs(:user)
8 expects(:show_date).returns('') 9 expects(:show_date).returns('')
9 expects(:_).with('Events for %s').returns('') 10 expects(:_).with('Events for %s').returns('')
10 - event1 = mock; event1.expects(:public?).returns(true); event1.expects(:name).returns('Event 1'); event1.expects(:url).returns({})  
11 - event2 = mock; event2.expects(:public?).returns(true); event2.expects(:name).returns('Event 2'); event2.expects(:url).returns({}) 11 + event1 = mock; event1.expects(:display_to?).with(anything).returns(true); event1.expects(:name).returns('Event 1'); event1.expects(:url).returns({})
  12 + event2 = mock; event2.expects(:display_to?).with(anything).returns(true); event2.expects(:name).returns('Event 2'); event2.expects(:url).returns({})
12 result = list_events('', [event1, event2]) 13 result = list_events('', [event1, event2])
13 assert_match /Event 1/, result 14 assert_match /Event 1/, result
14 assert_match /Event 2/, result 15 assert_match /Event 2/, result