expect(page).tohave_content('The commit has been successfully cherry-picked into master.')
end
end
wait_for_requests
context'when cherry-picking a merge commit'do
specifydo
cherry_pick_commit
expect(page).tohave_content("The commit has been successfully cherry-picked into cherry-pick-#{master_pickable_commit.short_id}. You can now submit a merge request to get this change into the original branch.")
expect(page).tohave_content("From cherry-pick-#{master_pickable_commit.short_id} into master")
expect(page).tohave_content('The commit has been successfully cherry-picked into master.')
end
end
end
context"I cherry-pick a commit from a different branch",:jsdo
expect(page).tohave_content("The commit has been successfully cherry-picked into cherry-pick-#{master_pickable_commit.short_id}. You can now submit a merge request to get this change into the original branch.")
expect(page).tohave_content("From cherry-pick-#{master_pickable_commit.short_id} into master")
end
end
page.within('#modal-cherry-pick-commit')do
uncheck'create_merge_request'
click_button'Cherry-pick'
context'when I cherry-picking a commit from a different branch'do
expect(page).tohave_content('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
expect(page).tohave_content("From revert-#{Commit.truncate_sha(sample_commit.id)} into master")
expect(page).tohave_content('Sorry, we cannot revert this commit automatically.')
it'does not show the revert link'do
open_dropdown
expect(page).not_tohave_link('Revert')
end
end
end
context'with creating a new merge request'do
it'reverts a commit'do
revert_commit(create_merge_request: true)
defrevert_commit(create_merge_request: false)
open_modal
expect(page).tohave_content('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
expect(page).tohave_content("From revert-#{Commit.truncate_sha(sample_commit.id)} into master")