summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/diff.js.coffee1
-rw-r--r--spec/features/expand_collapse_diffs_spec.rb6
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/diff.js.coffee b/app/assets/javascripts/diff.js.coffee
index 83516f97552..c132cc8c542 100644
--- a/app/assets/javascripts/diff.js.coffee
+++ b/app/assets/javascripts/diff.js.coffee
@@ -1,6 +1,7 @@
class @Diff
UNFOLD_COUNT = 20
constructor: ->
+ $('.files .diff-file').singleFileDiff()
@filesCommentButton = $('.files .diff-file').filesCommentButton()
$(document).off('click', '.js-unfold')
diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb
index 7cff196c8d9..78bc888f2a6 100644
--- a/spec/features/expand_collapse_diffs_spec.rb
+++ b/spec/features/expand_collapse_diffs_spec.rb
@@ -106,7 +106,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
let(:comment_text) { 'A comment' }
before do
- large_diff.find('.line_holder', match: :prefer_exact).hover
+ large_diff.find('.diff-line-num', match: :prefer_exact).hover
large_diff.find('.add-diff-note').click
large_diff.find('.note-textarea').send_keys comment_text
large_diff.find_button('Comment').click
@@ -161,7 +161,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
end
it 'does not make a new HTTP request' do
- expect(evaluate_script('ajaxUris')).to be_empty
+ expect(evaluate_script('ajaxUris')).not_to include(a_string_matching('small_diff.md'))
end
end
end
@@ -199,7 +199,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
end
it 'does not make a new HTTP request' do
- expect(evaluate_script('ajaxUris')).to be_empty
+ expect(evaluate_script('ajaxUris')).not_to include(a_string_matching('small_diff.md'))
end
end
end