noosfero | 2 new commits pushed to repository
Rodrigo Souto
gitlab at gitlab.com
Thu Feb 19 17:09:46 BRST 2015
Rodrigo Souto pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>
Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/0ed26129803b86b265b8a59f2132d400b8d5dc64">0ed26129</a> by Rodrigo Souto
chat: remove obsolete test
- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/c717cb2c67b0cc86dca6c51a7e5bb0a51d08bd21">c717cb2c</a> by Rodrigo Souto
chat: use ActionView::TestCase and include ApplicationHelper on ChatHelper test
- - - - -
Changes:
=====================================
test/unit/application_helper_test.rb
=====================================
--- a/test/unit/application_helper_test.rb
+++ b/test/unit/application_helper_test.rb
@@ -636,21 +636,6 @@ class ApplicationHelperTest < ActionView::TestCase
assert_equal '/designs/themes/new-theme/favicon.ico', theme_favicon
end
- should 'include item in usermenu for environment enabled features' do
- env = fast_create(Environment)
- env.enable('xmpp_chat', false)
- stubs(:environment).returns(env)
-
- @controller = ApplicationController.new
- path = Rails.root.join('app', 'views')
- @controller.stubs(:view_paths).returns([path])
-
- file = path.join('shared','usermenu', 'xmpp_chat.html.erb')
- expects(:render).with(:file => file, :use_full_path => false).returns('Open chat')
-
- assert_equal 'Open chat', render_environment_features(:usermenu)
- end
-
should 'not inlude administration link if user is not an environment administrator' do
user = mock()
stubs(:environment).returns(Environment.default)
=====================================
test/unit/chat_helper_test.rb
=====================================
--- a/test/unit/chat_helper_test.rb
+++ b/test/unit/chat_helper_test.rb
@@ -1,12 +1,14 @@
require_relative "../test_helper"
-class ChatHelperTest < ActiveSupport::TestCase
+class ChatHelperTest < ActionView::TestCase
+ include ApplicationHelper
include ChatHelper
should 'provide menu to change chat presence status' do
env = Environment.default
stubs(:environment).returns(env)
+ stubs(:profile).returns(nil)
stubs(:user).returns(create_user('testing').person)
links = user_status_menu('fake-class', 'offline')
assert_match /Online/, links
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150219/41b206c8/attachment.html>
More information about the Noosfero-dev
mailing list