diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-09-06 21:31:45 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-09-06 22:07:21 +0300 |
commit | 1feeea9c6af5d683f18c021df16e4eedfa9306e0 (patch) | |
tree | 4869cd4d3b9e839a4eba612c9da5205b73dafbe6 /spec | |
parent | a887194abd2ea0c0cbcd24f0ff7630800d3eec12 (diff) |
Refer to “Share with group lock” consistently
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/groups/share_lock_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/projects/members/share_with_group_spec.rb | 18 | ||||
-rw-r--r-- | spec/helpers/groups_helper_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/namespace_spec.rb | 42 | ||||
-rw-r--r-- | spec/services/groups/update_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/groups/edit.html.haml_spec.rb | 34 |
6 files changed, 61 insertions, 61 deletions
diff --git a/spec/features/groups/share_lock_spec.rb b/spec/features/groups/share_lock_spec.rb index cf1079bb6d6..8842d1391aa 100644 --- a/spec/features/groups/share_lock_spec.rb +++ b/spec/features/groups/share_lock_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Group share lock' do +feature 'Group share with group lock' do given(:root_owner) { create(:user) } given(:root_group) { create(:group) } @@ -12,8 +12,8 @@ feature 'Group share lock' do context 'with a subgroup', :nested_groups do given!(:subgroup) { create(:group, parent: root_group) } - context 'when enabling the parent group share lock' do - scenario 'the subgroup share lock becomes enabled' do + context 'when enabling the parent group share with group lock' do + scenario 'the subgroup share with group lock becomes enabled' do visit edit_group_path(root_group) check 'group_share_with_group_lock' @@ -23,15 +23,15 @@ feature 'Group share lock' do end end - context 'when disabling the parent group share lock (which was already enabled)' do + context 'when disabling the parent group share with group lock (which was already enabled)' do background do visit edit_group_path(root_group) check 'group_share_with_group_lock' click_on 'Save group' end - context 'and the subgroup share lock is enabled' do - scenario 'the subgroup share lock does not change' do + context 'and the subgroup share with group lock is enabled' do + scenario 'the subgroup share with group lock does not change' do visit edit_group_path(root_group) uncheck 'group_share_with_group_lock' @@ -41,14 +41,14 @@ feature 'Group share lock' do end end - context 'but the subgroup share lock is disabled' do + context 'but the subgroup share with group lock is disabled' do background do visit edit_group_path(subgroup) uncheck 'group_share_with_group_lock' click_on 'Save group' end - scenario 'the subgroup share lock does not change' do + scenario 'the subgroup share with group lock does not change' do visit edit_group_path(root_group) uncheck 'group_share_with_group_lock' diff --git a/spec/features/projects/members/share_with_group_spec.rb b/spec/features/projects/members/share_with_group_spec.rb index 9a9cedf1a0e..3b368f8e25d 100644 --- a/spec/features/projects/members/share_with_group_spec.rb +++ b/spec/features/projects/members/share_with_group_spec.rb @@ -6,7 +6,7 @@ feature 'Project > Members > Share with Group', :js do let(:master) { create(:user) } - describe 'Share Lock' do + describe 'Share with group lock' do shared_examples 'the project can be shared with groups' do scenario 'the "Share with group" tab exists' do visit project_settings_members_path(project) @@ -31,7 +31,7 @@ feature 'Project > Members > Share with Group', :js do sign_in(master) end - context 'when the group has "Share lock" disabled' do + context 'when the group has "Share with group lock" disabled' do it_behaves_like 'the project can be shared with groups' scenario 'the project can be shared with another group' do @@ -49,7 +49,7 @@ feature 'Project > Members > Share with Group', :js do end end - context 'when the group has "Share lock" enabled' do + context 'when the group has "Share with group lock" enabled' do before do project.namespace.update_column(:share_with_group_lock, true) end @@ -69,12 +69,12 @@ feature 'Project > Members > Share with Group', :js do sign_in(master) end - context 'when the root_group has "Share lock" disabled' do - context 'when the subgroup has "Share lock" disabled' do + context 'when the root_group has "Share with group lock" disabled' do + context 'when the subgroup has "Share with group lock" disabled' do it_behaves_like 'the project can be shared with groups' end - context 'when the subgroup has "Share lock" enabled' do + context 'when the subgroup has "Share with group lock" enabled' do before do subgroup.update_column(:share_with_group_lock, true) end @@ -83,16 +83,16 @@ feature 'Project > Members > Share with Group', :js do end end - context 'when the root_group has "Share lock" enabled' do + context 'when the root_group has "Share with group lock" enabled' do before do root_group.update_column(:share_with_group_lock, true) end - context 'when the subgroup has "Share lock" disabled (parent overridden)' do + context 'when the subgroup has "Share with group lock" disabled (parent overridden)' do it_behaves_like 'the project can be shared with groups' end - context 'when the subgroup has "Share lock" enabled' do + context 'when the subgroup has "Share with group lock" enabled' do before do subgroup.update_column(:share_with_group_lock, true) end diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb index 7c5d954763c..36031ac1a28 100644 --- a/spec/helpers/groups_helper_spec.rb +++ b/spec/helpers/groups_helper_spec.rb @@ -108,7 +108,7 @@ describe GroupsHelper do { default_help: "This setting will be applied to all subgroups unless overridden by a group owner", ancestor_locked_but_you_can_override: /This setting is applied on <a .+>.+<\/a>\. You can override the setting or .+/, - ancestor_locked_so_ask_the_owner: /This setting is applied on .+\. To share projects in this group with another group, ask the owner to override the setting or remove the share lock from .+/, + ancestor_locked_so_ask_the_owner: /This setting is applied on .+\. To share projects in this group with another group, ask the owner to override the setting or remove the share with group lock from .+/, ancestor_locked_and_has_been_overridden: /This setting is applied on .+ and has been overridden on this subgroup/ } end @@ -127,7 +127,7 @@ describe GroupsHelper do end subject { helper.share_with_group_lock_help_text(sub_subgroup) } - where(:root_share_locked, :subgroup_share_locked, :sub_subgroup_share_locked, :current_user, :help_text, :linked_ancestor) do + where(:root_share_with_group_locked, :subgroup_share_with_group_locked, :sub_subgroup_share_with_group_locked, :current_user, :help_text, :linked_ancestor) do [ [false , false , false , :root_owner , :default_help , nil], [false , false , false , :sub_owner , :default_help , nil], @@ -162,9 +162,9 @@ describe GroupsHelper do subgroup.add_owner(sub_owner) sub_subgroup.add_owner(sub_sub_owner) - root_group.update_column(:share_with_group_lock, true) if root_share_locked - subgroup.update_column(:share_with_group_lock, true) if subgroup_share_locked - sub_subgroup.update_column(:share_with_group_lock, true) if sub_subgroup_share_locked + root_group.update_column(:share_with_group_lock, true) if root_share_with_group_locked + subgroup.update_column(:share_with_group_lock, true) if subgroup_share_with_group_locked + sub_subgroup.update_column(:share_with_group_lock, true) if sub_subgroup_share_with_group_locked allow(helper).to receive(:current_user).and_return(users[current_user]) allow(helper).to receive(:can?) diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index 6e583dc3e93..a0831cf8f38 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -411,51 +411,51 @@ describe Namespace do context 'when creating a subgroup' do let(:subgroup) { create(:group, parent: root_group )} - context 'under a parent with share lock enabled' do + context 'under a parent with "Share with group lock" enabled' do let(:root_group) { create(:group, share_with_group_lock: true) } - it 'enables share lock on the subgroup' do + it 'enables "Share with group lock" on the subgroup' do expect(subgroup.share_with_group_lock).to be_truthy end end - context 'under a parent with share lock disabled' do + context 'under a parent with "Share with group lock" disabled' do let(:root_group) { create(:group) } - it 'does not enable share lock on the subgroup' do + it 'does not enable "Share with group lock" on the subgroup' do expect(subgroup.share_with_group_lock).to be_falsey end end end - context 'when enabling the parent group share lock' do + context 'when enabling the parent group "Share with group lock"' do let(:root_group) { create(:group) } let!(:subgroup) { create(:group, parent: root_group )} - it 'the subgroup share lock becomes enabled' do + it 'the subgroup "Share with group lock" becomes enabled' do root_group.update!(share_with_group_lock: true) expect(subgroup.reload.share_with_group_lock).to be_truthy end end - context 'when disabling the parent group share lock (which was already enabled)' do + context 'when disabling the parent group "Share with group lock" (which was already enabled)' do let(:root_group) { create(:group, share_with_group_lock: true) } - context 'and the subgroup share lock is enabled' do + context 'and the subgroup "Share with group lock" is enabled' do let(:subgroup) { create(:group, parent: root_group, share_with_group_lock: true )} - it 'the subgroup share lock does not change' do + it 'the subgroup "Share with group lock" does not change' do root_group.update!(share_with_group_lock: false) expect(subgroup.reload.share_with_group_lock).to be_truthy end end - context 'but the subgroup share lock is disabled' do + context 'but the subgroup "Share with group lock" is disabled' do let(:subgroup) { create(:group, parent: root_group )} - it 'the subgroup share lock does not change' do + it 'the subgroup "Share with group lock" does not change' do root_group.update!(share_with_group_lock: false) expect(subgroup.reload.share_with_group_lock?).to be_falsey @@ -465,13 +465,13 @@ describe Namespace do # Note: Group transfers are not yet implemented context 'when a group is transferred into a root group' do - context 'when the root group share lock is enabled' do + context 'when the root group "Share with group lock" is enabled' do let(:root_group) { create(:group, share_with_group_lock: true) } - context 'when the subgroup share lock is enabled' do + context 'when the subgroup "Share with group lock" is enabled' do let(:subgroup) { create(:group, share_with_group_lock: true )} - it 'the subgroup share lock does not change' do + it 'the subgroup "Share with group lock" does not change' do subgroup.parent = root_group subgroup.save! @@ -479,10 +479,10 @@ describe Namespace do end end - context 'when the subgroup share lock is disabled' do + context 'when the subgroup "Share with group lock" is disabled' do let(:subgroup) { create(:group)} - it 'the subgroup share lock becomes enabled' do + it 'the subgroup "Share with group lock" becomes enabled' do subgroup.parent = root_group subgroup.save! @@ -491,13 +491,13 @@ describe Namespace do end end - context 'when the root group share lock is disabled' do + context 'when the root group "Share with group lock" is disabled' do let(:root_group) { create(:group) } - context 'when the subgroup share lock is enabled' do + context 'when the subgroup "Share with group lock" is enabled' do let(:subgroup) { create(:group, share_with_group_lock: true )} - it 'the subgroup share lock does not change' do + it 'the subgroup "Share with group lock" does not change' do subgroup.parent = root_group subgroup.save! @@ -505,10 +505,10 @@ describe Namespace do end end - context 'when the subgroup share lock is disabled' do + context 'when the subgroup "Share with group lock" is disabled' do let(:subgroup) { create(:group)} - it 'the subgroup share lock does not change' do + it 'the subgroup "Share with group lock" does not change' do subgroup.parent = root_group subgroup.save! diff --git a/spec/services/groups/update_service_spec.rb b/spec/services/groups/update_service_spec.rb index 80e9c0c81dc..1737fd0a9fc 100644 --- a/spec/services/groups/update_service_spec.rb +++ b/spec/services/groups/update_service_spec.rb @@ -128,7 +128,7 @@ describe Groups::UpdateService do result = described_class.new(subgroup, subgroup_owner, share_with_group_lock: false).execute expect(result).to be_falsey - expect(subgroup.errors.full_messages.first).to match(/cannot be disabled when the parent group Share lock is enabled, except by the owner of the parent group/) + expect(subgroup.errors.full_messages.first).to match(/cannot be disabled when the parent group "Share with group lock" is enabled, except by the owner of the parent group/) expect(subgroup.reload.share_with_group_lock).to be_truthy end end diff --git a/spec/views/groups/edit.html.haml_spec.rb b/spec/views/groups/edit.html.haml_spec.rb index 86bb28a43c1..38cfb84f0d5 100644 --- a/spec/views/groups/edit.html.haml_spec.rb +++ b/spec/views/groups/edit.html.haml_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'groups/edit.html.haml' do include Devise::Test::ControllerHelpers - describe 'Share lock option' do + describe '"Share with group lock" setting' do let(:root_owner) { create(:user) } let(:root_group) { create(:group) } @@ -11,7 +11,7 @@ describe 'groups/edit.html.haml' do root_group.add_owner(root_owner) end - shared_examples_for 'share lock option' do |checkbox_options| + shared_examples_for '"Share with group lock" setting' do |checkbox_options| it 'should have the correct label, help text, and checkbox options' do assign(:group, test_group) allow(view).to receive(:can?).with(test_user, :admin_group, test_group).and_return(true) @@ -32,7 +32,7 @@ describe 'groups/edit.html.haml' do let(:test_group) { root_group } let(:test_user) { root_owner } - it_behaves_like 'share lock option', { disabled: false, checked: false } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: false } end context 'for a subgroup', :nested_groups do @@ -40,22 +40,22 @@ describe 'groups/edit.html.haml' do let(:sub_owner) { create(:user) } let(:test_group) { subgroup } - context 'when the root_group has "Share lock" disabled' do - context 'when the subgroup has "Share lock" disabled' do + context 'when the root_group has "Share with group lock" disabled' do + context 'when the subgroup has "Share with group lock" disabled' do context 'as the root_owner' do let(:test_user) { root_owner } - it_behaves_like 'share lock option', { disabled: false, checked: false } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: false } end context 'as the sub_owner' do let(:test_user) { sub_owner } - it_behaves_like 'share lock option', { disabled: false, checked: false } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: false } end end - context 'when the subgroup has "Share lock" enabled' do + context 'when the subgroup has "Share with group lock" enabled' do before do subgroup.update_column(:share_with_group_lock, true) end @@ -63,37 +63,37 @@ describe 'groups/edit.html.haml' do context 'as the root_owner' do let(:test_user) { root_owner } - it_behaves_like 'share lock option', { disabled: false, checked: true } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: true } end context 'as the sub_owner' do let(:test_user) { sub_owner } - it_behaves_like 'share lock option', { disabled: false, checked: true } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: true } end end end - context 'when the root_group has "Share lock" enabled' do + context 'when the root_group has "Share with group lock" enabled' do before do root_group.update_column(:share_with_group_lock, true) end - context 'when the subgroup has "Share lock" disabled (parent overridden)' do + context 'when the subgroup has "Share with group lock" disabled (parent overridden)' do context 'as the root_owner' do let(:test_user) { root_owner } - it_behaves_like 'share lock option', { disabled: false, checked: false } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: false } end context 'as the sub_owner' do let(:test_user) { sub_owner } - it_behaves_like 'share lock option', { disabled: false, checked: false } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: false } end end - context 'when the subgroup has "Share lock" enabled (same as parent)' do + context 'when the subgroup has "Share with group lock" enabled (same as parent)' do before do subgroup.update_column(:share_with_group_lock, true) end @@ -101,13 +101,13 @@ describe 'groups/edit.html.haml' do context 'as the root_owner' do let(:test_user) { root_owner } - it_behaves_like 'share lock option', { disabled: false, checked: true } + it_behaves_like '"Share with group lock" setting', { disabled: false, checked: true } end context 'as the sub_owner' do let(:test_user) { sub_owner } - it_behaves_like 'share lock option', { disabled: true, checked: true } + it_behaves_like '"Share with group lock" setting', { disabled: true, checked: true } end end end |