From ca7ec7f48ff8ee2e6636139be9b7883ad523b552 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 22 Jul 2009 17:46:29 -0300 Subject: [PATCH] ActionItem835: removing inverted login for join popup --- app/helpers/application_helper.rb | 2 +- app/models/environment.rb | 2 +- test/unit/application_helper_test.rb | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 51d08c5..b5ad107 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -826,7 +826,7 @@ module ApplicationHelper end def ask_to_join? - return if environment.enabled?(:disable_join_community_popup) + return if !environment.enabled?(:join_community_popup) return unless profile && profile.kind_of?(Community) if (session[:no_asking] && session[:no_asking].include?(profile.id)) return false diff --git a/app/models/environment.rb b/app/models/environment.rb index 0230ae8..5c895c3 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -111,7 +111,7 @@ class Environment < ActiveRecord::Base 'disable_select_city_for_contact' => _('Disable state/city select for contact form'), 'disable_contact_person' => _('Disable contact for people'), 'disable_contact_community' => _('Disable contact for groups/communities'), - 'disable_join_community_popup' => _('Disable the popup that ask to join a group/community'), + 'join_community_popup' => _('Ask users to join a group/community with a popup'), 'enterprise_activation' => _('Enable activation of enterprises'), 'warn_obsolete_browser' => _('Enable warning of obsolete browser'), diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 3f5c3c2..48e596b 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -351,7 +351,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join unless profile defined' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) stubs(:profile).returns(nil) @@ -360,7 +360,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join unless profile is community' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) p = create_user('test_user').person @@ -370,7 +370,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'ask_to_join if its not logged and in a community' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') @@ -381,7 +381,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'ask_to_join if user say so' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') @@ -396,7 +396,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join if user say no' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') stubs(:profile).returns(c) @@ -410,7 +410,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join if environment say no even if its not logged and in a community' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(true) + e.stubs(:enabled?).with(:join_community_popup).returns(false) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') stubs(:profile).returns(c) @@ -420,7 +420,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join if environment say no even if user say so' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(true) + e.stubs(:enabled?).with(:join_community_popup).returns(false) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') stubs(:profile).returns(c) @@ -434,7 +434,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join if its recorded in the session' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') @@ -447,7 +447,7 @@ class ApplicationHelperTest < Test::Unit::TestCase should 'not ask_to_join if its recorded in the session even for authenticated users' do e = Environment.default - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false) + e.stubs(:enabled?).with(:join_community_popup).returns(true) stubs(:environment).returns(e) c = Community.create(:name => 'test_comm', :identifier => 'test_comm') -- libgit2 0.21.2