summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-01-16 15:26:17 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-01-16 15:26:17 +0000
commitfaa53a8a7c0eca37d9aa93d6abf3eaaf11303d44 (patch)
tree8a5aa44924189fe4a9b7631fc6ac32c5afc3f581 /spec/features
parent1028b111dccada6963c6596f8330b202842dd1f5 (diff)
parentc1dd08e17bd1010e48b8f12e663a7c859b698b7b (diff)
downloadgitlab-ce-faa53a8a7c0eca37d9aa93d6abf3eaaf11303d44.tar.gz
Merge branch 'fix/diff-title' into 'master'
Fix issue with diff comments path See merge request !7819
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/expand_collapse_diffs_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb
index 3934c936f20..8b3e2fa93a2 100644
--- a/spec/features/expand_collapse_diffs_spec.rb
+++ b/spec/features/expand_collapse_diffs_spec.rb
@@ -4,10 +4,10 @@ feature 'Expand and collapse diffs', js: true, feature: true do
include WaitForAjax
let(:branch) { 'expand-collapse-diffs' }
+ let(:project) { create(:project) }
before do
login_as :admin
- project = create(:project)
# Ensure that undiffable.md is in .gitattributes
project.repository.copy_gitattributes(branch)
@@ -31,6 +31,33 @@ feature 'Expand and collapse diffs', js: true, feature: true do
define_method(file.split('.').first) { file_container(file) }
end
+ it 'should show the diff content with a highlighted line when linking to line' do
+ expect(large_diff).not_to have_selector('.code')
+ expect(large_diff).to have_selector('.nothing-here-block')
+
+ visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: "#{large_diff[:id]}_0_1")
+ execute_script('window.location.reload()')
+
+ wait_for_ajax
+
+ expect(large_diff).to have_selector('.code')
+ expect(large_diff).not_to have_selector('.nothing-here-block')
+ expect(large_diff).to have_selector('.hll')
+ end
+
+ it 'should show the diff content when linking to file' do
+ expect(large_diff).not_to have_selector('.code')
+ expect(large_diff).to have_selector('.nothing-here-block')
+
+ visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: large_diff[:id])
+ execute_script('window.location.reload()')
+
+ wait_for_ajax
+
+ expect(large_diff).to have_selector('.code')
+ expect(large_diff).not_to have_selector('.nothing-here-block')
+ end
+
context 'visiting a commit with collapsed diffs' do
it 'shows small diffs immediately' do
expect(small_diff).to have_selector('.code')