summaryrefslogtreecommitdiff
path: root/spec/features/merge_requests
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-09-07 09:58:15 +0200
committerFelipe Artur <felipefac@gmail.com>2017-12-05 12:54:10 -0200
commitfe673b492769dc888268a1b2ac25342faa18a817 (patch)
tree11c2e4b9126feb999b21c54bdd8343b59bab2172 /spec/features/merge_requests
parent003a816afa885d56aa1eb4aadbad2b13b1baa25b (diff)
downloadgitlab-ce-fe673b492769dc888268a1b2ac25342faa18a817.tar.gz
Ensure pippeline corresponds with the sha of an MR
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r--spec/features/merge_requests/pipelines_spec.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/features/merge_requests/pipelines_spec.rb b/spec/features/merge_requests/pipelines_spec.rb
index a3fcc27cab0..307c860eac4 100644
--- a/spec/features/merge_requests/pipelines_spec.rb
+++ b/spec/features/merge_requests/pipelines_spec.rb
@@ -20,10 +20,14 @@ feature 'Pipelines for Merge Requests', :js do
end
before do
- visit project_merge_request_path(project, merge_request)
+ merge_request.update_attribute(:head_pipeline_id, pipeline.id)
end
scenario 'user visits merge request pipelines tab' do
+ visit project_merge_request_path(project, merge_request)
+
+ expect(page.find('.ci-widget')).to have_content('pending')
+
page.within('.merge-request-tabs') do
click_link('Pipelines')
end
@@ -31,6 +35,15 @@ feature 'Pipelines for Merge Requests', :js do
expect(page).to have_selector('.stage-cell')
end
+
+ scenario 'pipeline sha does not equal last commit sha' do
+ pipeline.update_attribute(:sha, '19e2e9b4ef76b422ce1154af39a91323ccc57434')
+ visit project_merge_request_path(project, merge_request)
+ wait_for_requests
+
+ expect(page.find('.ci-widget')).to have_content(
+ 'Could not connect to the CI server. Please check your settings and try again')
+ end
end
context 'without pipelines' do