Commit ca7ec7f48ff8ee2e6636139be9b7883ad523b552

Authored by Antonio Terceiro
1 parent 8d1bd66e

ActionItem835: removing inverted login for join popup

app/helpers/application_helper.rb
... ... @@ -826,7 +826,7 @@ module ApplicationHelper
826 826 end
827 827  
828 828 def ask_to_join?
829   - return if environment.enabled?(:disable_join_community_popup)
  829 + return if !environment.enabled?(:join_community_popup)
830 830 return unless profile && profile.kind_of?(Community)
831 831 if (session[:no_asking] && session[:no_asking].include?(profile.id))
832 832 return false
... ...
app/models/environment.rb
... ... @@ -111,7 +111,7 @@ class Environment < ActiveRecord::Base
111 111 'disable_select_city_for_contact' => _('Disable state/city select for contact form'),
112 112 'disable_contact_person' => _('Disable contact for people'),
113 113 'disable_contact_community' => _('Disable contact for groups/communities'),
114   - 'disable_join_community_popup' => _('Disable the popup that ask to join a group/community'),
  114 + 'join_community_popup' => _('Ask users to join a group/community with a popup'),
115 115  
116 116 'enterprise_activation' => _('Enable activation of enterprises'),
117 117 'warn_obsolete_browser' => _('Enable warning of obsolete browser'),
... ...
test/unit/application_helper_test.rb
... ... @@ -351,7 +351,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
351 351  
352 352 should 'not ask_to_join unless profile defined' do
353 353 e = Environment.default
354   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  354 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
355 355 stubs(:environment).returns(e)
356 356  
357 357 stubs(:profile).returns(nil)
... ... @@ -360,7 +360,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
360 360  
361 361 should 'not ask_to_join unless profile is community' do
362 362 e = Environment.default
363   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  363 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
364 364 stubs(:environment).returns(e)
365 365  
366 366 p = create_user('test_user').person
... ... @@ -370,7 +370,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
370 370  
371 371 should 'ask_to_join if its not logged and in a community' do
372 372 e = Environment.default
373   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  373 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
374 374 stubs(:environment).returns(e)
375 375  
376 376 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
... ... @@ -381,7 +381,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
381 381  
382 382 should 'ask_to_join if user say so' do
383 383 e = Environment.default
384   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  384 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
385 385 stubs(:environment).returns(e)
386 386  
387 387 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
... ... @@ -396,7 +396,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
396 396  
397 397 should 'not ask_to_join if user say no' do
398 398 e = Environment.default
399   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  399 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
400 400 stubs(:environment).returns(e)
401 401 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
402 402 stubs(:profile).returns(c)
... ... @@ -410,7 +410,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
410 410  
411 411 should 'not ask_to_join if environment say no even if its not logged and in a community' do
412 412 e = Environment.default
413   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(true)
  413 + e.stubs(:enabled?).with(:join_community_popup).returns(false)
414 414 stubs(:environment).returns(e)
415 415 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
416 416 stubs(:profile).returns(c)
... ... @@ -420,7 +420,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
420 420  
421 421 should 'not ask_to_join if environment say no even if user say so' do
422 422 e = Environment.default
423   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(true)
  423 + e.stubs(:enabled?).with(:join_community_popup).returns(false)
424 424 stubs(:environment).returns(e)
425 425 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
426 426 stubs(:profile).returns(c)
... ... @@ -434,7 +434,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
434 434  
435 435 should 'not ask_to_join if its recorded in the session' do
436 436 e = Environment.default
437   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  437 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
438 438 stubs(:environment).returns(e)
439 439  
440 440 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
... ... @@ -447,7 +447,7 @@ class ApplicationHelperTest < Test::Unit::TestCase
447 447  
448 448 should 'not ask_to_join if its recorded in the session even for authenticated users' do
449 449 e = Environment.default
450   - e.stubs(:enabled?).with(:disable_join_community_popup).returns(false)
  450 + e.stubs(:enabled?).with(:join_community_popup).returns(true)
451 451 stubs(:environment).returns(e)
452 452  
453 453 c = Community.create(:name => 'test_comm', :identifier => 'test_comm')
... ...