summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-01 10:26:33 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-01 11:57:22 +0200
commit02cddaea6f51c05b7c86b2dc541350e63301b2e4 (patch)
tree4cec1261eecd8da054086d6f4731a0d40e3f95d4 /spec
parent24c0f0d67198c98998514ff657562a599859d2c7 (diff)
downloadgitlab-ce-02cddaea6f51c05b7c86b2dc541350e63301b2e4.tar.gz
Add feature specs for pipeline in MR from fork
Diffstat (limited to 'spec')
-rw-r--r--spec/features/merge_requests/created_from_fork_spec.rb46
1 files changed, 38 insertions, 8 deletions
diff --git a/spec/features/merge_requests/created_from_fork_spec.rb b/spec/features/merge_requests/created_from_fork_spec.rb
index c1fdec3a550..edc0bdec3db 100644
--- a/spec/features/merge_requests/created_from_fork_spec.rb
+++ b/spec/features/merge_requests/created_from_fork_spec.rb
@@ -9,20 +9,50 @@ feature 'Merge request created from fork' do
create(:forked_project_link, forked_to_project: fork_project,
forked_from_project: project)
- create(:merge_request, source_project: fork_project,
- target_project: project,
- description: 'Test merge request')
+ create(:merge_request_with_diffs, source_project: fork_project,
+ target_project: project,
+ description: 'Test merge request')
end
- before do
- project.team << [user, :master]
-
+ background do
+ fork_project.team << [user, :master]
login_as user
- visit namespace_project_merge_request_path(project.namespace,
- project, merge_request)
end
scenario 'user can access merge request' do
+ visit_merge_request(merge_request)
+
expect(page).to have_content 'Test merge request'
end
+
+ context 'pipeline present in source project' do
+ include WaitForAjax
+
+ given(:pipeline) do
+ create(:ci_commit_with_two_jobs, project: fork_project,
+ sha: merge_request.last_commit.id,
+ ref: merge_request.source_branch)
+ end
+
+ background { pipeline.create_builds(user) }
+
+ scenario 'user visits a pipelines page', js: true do
+ visit_merge_request(merge_request)
+ page.within('.merge-request-tabs') { click_link 'Builds' }
+ wait_for_ajax
+
+ page.within('table.builds') do
+ expect(page).to have_content 'rspec'
+ expect(page).to have_content 'spinach'
+ end
+
+ expect(find_link('Cancel running')[:href])
+ .to include fork_project.path_with_namespace
+ end
+ end
+
+ def visit_merge_request(mr)
+ visit namespace_project_merge_request_path(project.namespace,
+ project, mr)
+ end
end