diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/graphql/mutations/commits/create_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/graphql/mutations/commits/create_spec.rb')
-rw-r--r-- | spec/graphql/mutations/commits/create_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/graphql/mutations/commits/create_spec.rb b/spec/graphql/mutations/commits/create_spec.rb index 82a5e3a62f5..152b5d87da0 100644 --- a/spec/graphql/mutations/commits/create_spec.rb +++ b/spec/graphql/mutations/commits/create_spec.rb @@ -24,11 +24,12 @@ RSpec.describe Mutations::Commits::Create do let(:branch) { 'master' } let(:start_branch) { nil } let(:message) { 'Commit message' } + let(:file_path) { "#{SecureRandom.uuid}.md" } let(:actions) do [ { action: 'create', - file_path: 'NEW_FILE.md', + file_path: file_path, content: 'Hello' } ] @@ -68,12 +69,17 @@ RSpec.describe Mutations::Commits::Create do end context 'when service successfully creates a new commit' do + it "returns the ETag path for the commit's pipeline" do + commit_pipeline_path = subject[:commit_pipeline_path] + expect(commit_pipeline_path).to match(%r(pipelines/sha/\w+)) + end + it 'returns a new commit' do expect(mutated_commit).to have_attributes(message: message, project: project) expect(subject[:errors]).to be_empty expect_to_contain_deltas([ - a_hash_including(a_mode: '0', b_mode: '100644', new_file: true, new_path: 'NEW_FILE.md') + a_hash_including(a_mode: '0', b_mode: '100644', new_file: true, new_path: file_path) ]) end end |