Commit 6a7965a4aed7762138221c5c7eccf45ecc4f5d83
1 parent
99c12ca9
Exists in
master
and in
29 other branches
Remove inverted logic in environment features
(ActionItem1482)
Showing
4 changed files
with
5 additions
and
4 deletions
Show diff stats
app/models/environment.rb
... | ... | @@ -89,7 +89,7 @@ class Environment < ActiveRecord::Base |
89 | 89 | 'disable_select_city_for_contact' => _('Disable state/city select for contact form'), |
90 | 90 | 'disable_contact_person' => _('Disable contact for people'), |
91 | 91 | 'disable_contact_community' => _('Disable contact for groups/communities'), |
92 | - 'disable_enterprise_registration' => _('Disable the enterprise registration'), | |
92 | + 'enterprise_registration' => _('Enterprise registration'), | |
93 | 93 | 'join_community_popup' => _('Ask users to join a group/community with a popup'), |
94 | 94 | |
95 | 95 | 'enterprise_activation' => _('Enable activation of enterprises'), | ... | ... |
app/views/memberships/index.rhtml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | |
5 | 5 | <% button_bar do %> |
6 | 6 | <%= button(:add, __('Create a new community'), :controller => 'memberships', :action => 'new_community') %> |
7 | - <%= button :add, __('Register a new enterprise'), :controller => 'enterprise_registration' if !environment.enabled?('disable_enterprise_registration') %> | |
7 | + <%= button :add, __('Register a new enterprise'), :controller => 'enterprise_registration' if environment.enabled?('enterprise_registration') %> | |
8 | 8 | <%= button :back, _('Go back'), :controller => 'profile_editor' %> |
9 | 9 | <% end %> |
10 | 10 | ... | ... |
app/views/profile/enterprises.rhtml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | <% button_bar do %> |
13 | 13 | <%= button :back, _('Go back'), { :controller => 'profile' }, |
14 | 14 | :help => _('Back to the page where you come from.') %> |
15 | - <%= button :add, __('Register a new Enterprise'), :controller => 'enterprise_registration' if logged_in? && !environment.enabled?('disable_enterprise_registration') %> | |
15 | + <%= button :add, __('Register a new Enterprise'), :controller => 'enterprise_registration' if logged_in? && environment.enabled?('enterprise_registration') %> | |
16 | 16 | <% end %> |
17 | 17 | |
18 | 18 | </div><!-- fim class="common-profile-list-block" --> | ... | ... |
features/register_enterprise.feature
... | ... | @@ -10,9 +10,10 @@ Feature: register enterprise |
10 | 10 | |
11 | 11 | And I am logged in as "joaosilva" |
12 | 12 | And I am on Joao Silva's control panel |
13 | + And feature "enterprise_registration" is enabled on environment | |
13 | 14 | |
14 | 15 | Scenario: enterprise registration is disabled by admin |
15 | - Given feature "disable_enterprise_registration" is enabled on environment | |
16 | + Given feature "enterprise_registration" is disabled on environment | |
16 | 17 | When I follow "Manage my groups" |
17 | 18 | Then I should not see "Register a new enterprise" |
18 | 19 | ... | ... |