summaryrefslogtreecommitdiff
path: root/spec/models/snippet_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/snippet_spec.rb')
-rw-r--r--spec/models/snippet_spec.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index 06e9899c0bd..19d3895177f 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -722,6 +722,7 @@ RSpec.describe Snippet do
describe '#list_files' do
let_it_be(:snippet) { create(:snippet, :repository) }
+
let(:ref) { 'test-ref' }
subject { snippet.list_files(ref) }
@@ -827,14 +828,10 @@ RSpec.describe Snippet do
end
context 'when default branch in settings is different from "master"' do
- let(:default_branch) { 'main' }
+ let(:default_branch) { 'custom-branch' }
it 'changes the HEAD reference to the default branch' do
- expect(File.read(head_path).squish).to eq 'ref: refs/heads/master'
-
- subject
-
- expect(File.read(head_path).squish).to eq "ref: refs/heads/#{default_branch}"
+ expect { subject }.to change { File.read(head_path).squish }.to("ref: refs/heads/#{default_branch}")
end
end
end