diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-08 15:10:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-08 15:10:00 +0000 |
commit | 0ebbf19f2d2b87e1f2aca1c59efde1aa6a766cf6 (patch) | |
tree | b45534e86659ab6fa97c240563651b2e03dfce4d /spec/serializers | |
parent | ccc2dc45a3e8fab3dfeda097be601b16c5beff13 (diff) | |
download | gitlab-ce-0ebbf19f2d2b87e1f2aca1c59efde1aa6a766cf6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/fork_namespace_entity_spec.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/serializers/fork_namespace_entity_spec.rb b/spec/serializers/fork_namespace_entity_spec.rb index 240969ec7e9..32223b0d41a 100644 --- a/spec/serializers/fork_namespace_entity_spec.rb +++ b/spec/serializers/fork_namespace_entity_spec.rb @@ -60,15 +60,25 @@ RSpec.describe ForkNamespaceEntity do expect(json[:permission]).to eql 'Developer' end - it 'sets can_create_project to true when user can create projects in namespace' do - allow(user).to receive(:can?).with(:create_projects, namespace).and_return(true) - + it 'exposes can_create_project' do expect(json[:can_create_project]).to be true end - it 'sets can_create_project to false when user is not allowed create projects in namespace' do - allow(user).to receive(:can?).with(:create_projects, namespace).and_return(false) + context 'when fork_project_form feature flag is disabled' do + before do + stub_feature_flags(fork_project_form: false) + end + + it 'sets can_create_project to true when user can create projects in namespace' do + allow(user).to receive(:can?).with(:create_projects, namespace).and_return(true) - expect(json[:can_create_project]).to be false + expect(json[:can_create_project]).to be true + end + + it 'sets can_create_project to false when user is not allowed create projects in namespace' do + allow(user).to receive(:can?).with(:create_projects, namespace).and_return(false) + + expect(json[:can_create_project]).to be false + end end end |