Commit 6d1cd0e2 authored by Matthew Dodds's avatar Matthew Dodds

Add a spec to verify comparison context inclusion in path when a version is...

Add a spec to verify comparison context inclusion in path when a version is chosen to compare against
parent 0c0b6f43
require 'spec_helper' require 'spec_helper'
feature 'Merge Request versions', js: true, feature: true do feature 'Merge Request versions', js: true, feature: true do
let(:merge_request) { create(:merge_request, importing: true) }
let(:project) { merge_request.source_project }
before do before do
login_as :admin login_as :admin
merge_request = create(:merge_request, importing: true)
merge_request.merge_request_diffs.create(head_commit_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9') merge_request.merge_request_diffs.create(head_commit_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9')
merge_request.merge_request_diffs.create(head_commit_sha: '5937ac0a7beb003549fc5fd26fc247adbce4a52e') merge_request.merge_request_diffs.create(head_commit_sha: '5937ac0a7beb003549fc5fd26fc247adbce4a52e')
project = merge_request.source_project
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
end end
...@@ -47,6 +48,16 @@ feature 'Merge Request versions', js: true, feature: true do ...@@ -47,6 +48,16 @@ feature 'Merge Request versions', js: true, feature: true do
end end
end end
it 'has a path with comparison context' do
expect(page).to have_current_path diffs_namespace_project_merge_request_path(
project.namespace,
project,
merge_request.iid,
diff_id: 2,
start_sha: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9'
)
end
it 'should have correct value in the compare dropdown' do it 'should have correct value in the compare dropdown' do
page.within '.mr-version-compare-dropdown' do page.within '.mr-version-compare-dropdown' do
expect(page).to have_content 'version 1' expect(page).to have_content 'version 1'
......
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