Commit 68c0a4cd authored by Robert Speicher's avatar Robert Speicher

Add API specs for cherry-pick and revert dry-run

parent 620e1eca
......@@ -1462,6 +1462,16 @@ RSpec.describe API::Commits do
expect(json_response['author_name']).to eq(commit.author_name)
expect(json_response['committer_name']).to eq(user.name)
end
it 'supports dry-run without applying changes' do
head = project.commit(branch)
post api(route, current_user), params: { branch: branch, dry_run: true }
expect(response).to have_gitlab_http_status(:no_content)
expect(response.body).to be_empty
expect(project.commit(branch)).to eq(head)
end
end
context 'when repository is disabled' do
......@@ -1623,6 +1633,16 @@ RSpec.describe API::Commits do
expect(json_response['committer_name']).to eq(user.name)
expect(json_response['parent_ids']).to contain_exactly(commit_id)
end
it 'supports dry-run without applying changes' do
head = project.commit(branch)
post api(route, current_user), params: { branch: branch, dry_run: true }
expect(response).to have_gitlab_http_status(:no_content)
expect(response.body).to be_empty
expect(project.commit(branch)).to eq(head)
end
end
context 'when repository is disabled' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment