diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 18:09:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 18:09:37 +0300 |
commit | a210c43e0aca0311cc1d3d381763b25979ec72dc (patch) | |
tree | 0325d173da7a6e7bd6c2cdf450d0aa1c4e142d0f /spec/models/snippet_repository_spec.rb | |
parent | c9687bdf58e9d4a9c3942f587bd4841f42e3b5de (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/snippet_repository_spec.rb')
-rw-r--r-- | spec/models/snippet_repository_spec.rb | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/spec/models/snippet_repository_spec.rb b/spec/models/snippet_repository_spec.rb index 088d37725aa..6861e03282a 100644 --- a/spec/models/snippet_repository_spec.rb +++ b/spec/models/snippet_repository_spec.rb @@ -26,44 +26,6 @@ describe SnippetRepository do end end - describe '#create_file' do - let(:snippet) { create(:personal_snippet, :empty_repo, author: user) } - - it 'creates the file' do - snippet_repository.create_file(user, 'foo', 'bar', commit_opts) - blob = first_blob(snippet) - - aggregate_failures do - expect(blob).not_to be_nil - expect(blob.path).to eq 'foo' - expect(blob.data).to eq 'bar' - end - end - - it 'fills the file path if empty' do - snippet_repository.create_file(user, nil, 'bar', commit_opts) - blob = first_blob(snippet) - - aggregate_failures do - expect(blob).not_to be_nil - expect(blob.path).to eq 'snippetfile1.txt' - expect(blob.data).to eq 'bar' - end - end - - context 'when the file exists' do - let(:snippet) { create(:personal_snippet, :repository, author: user) } - - it 'captures the git exception and raises a SnippetRepository::CommitError' do - existing_blob = first_blob(snippet) - - expect do - snippet_repository.create_file(user, existing_blob.path, existing_blob.data, commit_opts) - end.to raise_error described_class::CommitError - end - end - end - describe '#multi_files_action' do let(:new_file) { { file_path: 'new_file_test', content: 'bar' } } let(:move_file) { { previous_path: 'CHANGELOG', file_path: 'CHANGELOG_new', content: 'bar' } } |