Commit f892761b01fddee576222589e91bea04627f35f1

Authored by Victor Costa
1 parent 981b0c92

rails3: fix chat_controller tests

app/controllers/public/chat_controller.rb
@@ -19,7 +19,7 @@ class ChatController < PublicController @@ -19,7 +19,7 @@ class ChatController < PublicController
19 def avatar 19 def avatar
20 profile = environment.profiles.find_by_identifier(params[:id]) 20 profile = environment.profiles.find_by_identifier(params[:id])
21 filename, mimetype = profile_icon(profile, :minor, true) 21 filename, mimetype = profile_icon(profile, :minor, true)
22 - data = File.read(Rails.root.join('public', filename)) 22 + data = File.read(File.join(Rails.root, 'public', filename))
23 render :text => data, :layout => false, :content_type => mimetype 23 render :text => data, :layout => false, :content_type => mimetype
24 expires_in 24.hours 24 expires_in 24.hours
25 end 25 end
app/views/layouts/chat.html.erb
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 <meta name="description" content="<%= @environment.name %>" /> 6 <meta name="description" content="<%= @environment.name %>" />
7 <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" /> 7 <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" />
8 <%= noosfero_javascript %> 8 <%= noosfero_javascript %>
9 - <%= javascript_include_tag 'prototype', 'jquery.scrollabletab', 'strophejs-1.0.1/strophe', 'jquery.emoticon', '/designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', :cache => 'cache-chat' %>  
10 - <%= stylesheet_link_tag noosfero_stylesheets, :cache => 'cache' %> 9 + <%= javascript_include_tag 'prototype', 'jquery.scrollabletab', 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', :cache => 'cache-chat' %>
  10 + <%= noosfero_stylesheets %>
11 <%= stylesheet_link_tag icon_theme_stylesheet_path %> 11 <%= stylesheet_link_tag icon_theme_stylesheet_path %>
12 <%= stylesheet_link_tag theme_stylesheet_path %> 12 <%= stylesheet_link_tag theme_stylesheet_path %>
13 <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> 13 <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %>
test/functional/chat_controller_test.rb
@@ -27,7 +27,7 @@ class ChatControllerTest &lt; ActionController::TestCase @@ -27,7 +27,7 @@ class ChatControllerTest &lt; ActionController::TestCase
27 get :avatar, :id => 'testuser' 27 get :avatar, :id => 'testuser'
28 28
29 assert_equal 'image/png', @response.content_type 29 assert_equal 'image/png', @response.content_type
30 - assert_match /PNG/, @response.body 30 + assert @response.body.index('PNG')
31 end 31 end
32 32
33 should 'get avatar from community' do 33 should 'get avatar from community' do
@@ -37,7 +37,7 @@ class ChatControllerTest &lt; ActionController::TestCase @@ -37,7 +37,7 @@ class ChatControllerTest &lt; ActionController::TestCase
37 get :avatar, :id => community.identifier 37 get :avatar, :id => community.identifier
38 38
39 assert_equal 'image/png', @response.content_type 39 assert_equal 'image/png', @response.content_type
40 - assert_match /PNG/, @response.body 40 + assert @response.body.index('PNG')
41 end 41 end
42 42
43 should 'auto connect if last presence status is blank' do 43 should 'auto connect if last presence status is blank' do