summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-11 03:09:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-11 03:09:13 +0000
commitea99abb145ed193c2ac5d19efbff3b8990a54c9c (patch)
treec4f3870175c3334d0842eb429b5395a7845c2528 /spec
parenta9104a50136e485c8dda7af37106332f9010a1e8 (diff)
downloadgitlab-ce-ea99abb145ed193c2ac5d19efbff3b8990a54c9c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/groups/boards_controller_spec.rb10
-rw-r--r--spec/frontend/boards/issue_card_spec.js22
-rw-r--r--spec/policies/group_policy_spec.rb4
-rw-r--r--spec/support/shared_contexts/policies/group_policy_shared_context.rb2
4 files changed, 31 insertions, 7 deletions
diff --git a/spec/controllers/groups/boards_controller_spec.rb b/spec/controllers/groups/boards_controller_spec.rb
index 79edfd69429..acfa8bc9354 100644
--- a/spec/controllers/groups/boards_controller_spec.rb
+++ b/spec/controllers/groups/boards_controller_spec.rb
@@ -27,7 +27,8 @@ describe Groups::BoardsController do
context 'with unauthorized user' do
before do
allow(Ability).to receive(:allowed?).with(user, :read_cross_project, :global).and_return(true)
- allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(false)
+ allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(true)
+ allow(Ability).to receive(:allowed?).with(user, :read_board, group).and_return(false)
end
it 'returns a not found 404 response' do
@@ -70,7 +71,8 @@ describe Groups::BoardsController do
context 'with unauthorized user' do
before do
allow(Ability).to receive(:allowed?).with(user, :read_cross_project, :global).and_return(true)
- allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(false)
+ allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(true)
+ allow(Ability).to receive(:allowed?).with(user, :read_board, group).and_return(false)
end
it 'returns a not found 404 response' do
@@ -105,7 +107,8 @@ describe Groups::BoardsController do
context 'with unauthorized user' do
before do
allow(Ability).to receive(:allowed?).with(user, :read_cross_project, :global).and_return(true)
- allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(false)
+ allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(true)
+ allow(Ability).to receive(:allowed?).with(user, :read_board, group).and_return(false)
end
it 'returns a not found 404 response' do
@@ -142,6 +145,7 @@ describe Groups::BoardsController do
context 'with unauthorized user' do
before do
allow(Ability).to receive(:allowed?).with(user, :read_cross_project, :global).and_return(true)
+ allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(true)
allow(Ability).to receive(:allowed?).with(user, :read_group, group).and_return(false)
end
diff --git a/spec/frontend/boards/issue_card_spec.js b/spec/frontend/boards/issue_card_spec.js
index 526cdb81ac6..1fd2b417aba 100644
--- a/spec/frontend/boards/issue_card_spec.js
+++ b/spec/frontend/boards/issue_card_spec.js
@@ -66,7 +66,11 @@ describe('Issue card component', () => {
});
it('does not render confidential icon', () => {
- expect(wrapper.find('.fa-eye-flash').exists()).toBe(false);
+ expect(wrapper.find('.confidential-icon').exists()).toBe(false);
+ });
+
+ it('does not render blocked icon', () => {
+ expect(wrapper.find('.issue-blocked-icon').exists()).toBe(false);
});
it('renders confidential icon', done => {
@@ -324,4 +328,20 @@ describe('Issue card component', () => {
.catch(done.fail);
});
});
+
+ describe('blocked', () => {
+ beforeEach(done => {
+ wrapper.setProps({
+ issue: {
+ ...wrapper.props('issue'),
+ blocked: true,
+ },
+ });
+ wrapper.vm.$nextTick(done);
+ });
+
+ it('renders blocked icon if issue is blocked', () => {
+ expect(wrapper.find('.issue-blocked-icon').exists()).toBe(true);
+ });
+ });
});
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb
index ae9d125f970..5a9ca9f7b7e 100644
--- a/spec/policies/group_policy_spec.rb
+++ b/spec/policies/group_policy_spec.rb
@@ -438,7 +438,7 @@ describe GroupPolicy do
end
end
- context "create_projects" do
+ context 'create_projects' do
context 'when group has no project creation level set' do
before_all do
group.update(project_creation_level: nil)
@@ -560,7 +560,7 @@ describe GroupPolicy do
end
end
- context "create_subgroup" do
+ context 'create_subgroup' do
context 'when group has subgroup creation level set to owner' do
before_all do
group.update(subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS)
diff --git a/spec/support/shared_contexts/policies/group_policy_shared_context.rb b/spec/support/shared_contexts/policies/group_policy_shared_context.rb
index c503197a773..63ebbcb93f9 100644
--- a/spec/support/shared_contexts/policies/group_policy_shared_context.rb
+++ b/spec/support/shared_contexts/policies/group_policy_shared_context.rb
@@ -16,7 +16,7 @@ RSpec.shared_context 'GroupPolicy context' do
read_group_merge_requests
]
end
- let(:read_group_permissions) { %i[read_label read_list read_milestone] }
+ let(:read_group_permissions) { %i[read_label read_list read_milestone read_board] }
let(:reporter_permissions) { %i[admin_label read_container_image] }
let(:developer_permissions) { [:admin_milestone] }
let(:maintainer_permissions) do