summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/checks/snippet_check_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/checks/snippet_check_spec.rb')
-rw-r--r--spec/lib/gitlab/checks/snippet_check_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/gitlab/checks/snippet_check_spec.rb b/spec/lib/gitlab/checks/snippet_check_spec.rb
index 7cfcde7183f..43c69ab7042 100644
--- a/spec/lib/gitlab/checks/snippet_check_spec.rb
+++ b/spec/lib/gitlab/checks/snippet_check_spec.rb
@@ -25,10 +25,19 @@ describe Gitlab::Checks::SnippetCheck do
context 'trying to create the branch' do
let(:oldrev) { '0000000000000000000000000000000000000000' }
+ let(:ref) { 'refs/heads/feature' }
it 'raises an error' do
expect { subject.exec }.to raise_error(Gitlab::GitAccess::ForbiddenError, 'You can not create or delete branches.')
end
+
+ context "when branch is 'master'" do
+ let(:ref) { 'refs/heads/master' }
+
+ it "allows the operation" do
+ expect { subject.exec }.not_to raise_error
+ end
+ end
end
end
end