Commit f892761b01fddee576222589e91bea04627f35f1
1 parent
981b0c92
Exists in
master
and in
22 other branches
rails3: fix chat_controller tests
Showing
3 changed files
with
5 additions
and
5 deletions
Show diff stats
app/controllers/public/chat_controller.rb
... | ... | @@ -19,7 +19,7 @@ class ChatController < PublicController |
19 | 19 | def avatar |
20 | 20 | profile = environment.profiles.find_by_identifier(params[:id]) |
21 | 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 | 23 | render :text => data, :layout => false, :content_type => mimetype |
24 | 24 | expires_in 24.hours |
25 | 25 | end | ... | ... |
app/views/layouts/chat.html.erb
... | ... | @@ -6,8 +6,8 @@ |
6 | 6 | <meta name="description" content="<%= @environment.name %>" /> |
7 | 7 | <link rel="shortcut icon" href="<%= image_path(theme_favicon) %>" type="image/x-icon" /> |
8 | 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 | 11 | <%= stylesheet_link_tag icon_theme_stylesheet_path %> |
12 | 12 | <%= stylesheet_link_tag theme_stylesheet_path %> |
13 | 13 | <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> | ... | ... |
test/functional/chat_controller_test.rb
... | ... | @@ -27,7 +27,7 @@ class ChatControllerTest < ActionController::TestCase |
27 | 27 | get :avatar, :id => 'testuser' |
28 | 28 | |
29 | 29 | assert_equal 'image/png', @response.content_type |
30 | - assert_match /PNG/, @response.body | |
30 | + assert @response.body.index('PNG') | |
31 | 31 | end |
32 | 32 | |
33 | 33 | should 'get avatar from community' do |
... | ... | @@ -37,7 +37,7 @@ class ChatControllerTest < ActionController::TestCase |
37 | 37 | get :avatar, :id => community.identifier |
38 | 38 | |
39 | 39 | assert_equal 'image/png', @response.content_type |
40 | - assert_match /PNG/, @response.body | |
40 | + assert @response.body.index('PNG') | |
41 | 41 | end |
42 | 42 | |
43 | 43 | should 'auto connect if last presence status is blank' do | ... | ... |