summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorhhoopes <heidih@gmail.com>2016-08-31 10:18:26 -0600
committerSean McGivern <sean@gitlab.com>2016-11-25 15:23:49 +0000
commita761c59a6bfc4d66649910d01e4c8412bb0b40ec (patch)
treec2c06dbbc20d140bda5ed2cd6abfa0e2f36805d0 /spec
parentf928dba99b0550cefa7534d7fd5bd1ea16609274 (diff)
downloadgitlab-ce-a761c59a6bfc4d66649910d01e4c8412bb0b40ec.tar.gz
Add keyword arguments to truncated_diff method
* Added keyword arguments to truncated_diff_lines method to allow for using highlighting or not (html templates vs. text) * Tweaked templates for consistency and format appropriateness
Diffstat (limited to 'spec')
-rw-r--r--spec/mailers/notify_spec.rb8
-rw-r--r--spec/models/discussion_spec.rb4
2 files changed, 3 insertions, 9 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index a80eb114c17..824b516f856 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -697,7 +697,7 @@ describe Notify do
let(:note) { create(model, project: project, author: note_author) }
it "includes diffs with character-level highlighting" do
- is_expected.to have_body_text /\<span class='idiff left right'>vars = {<\/span>/
+ is_expected.to have_body_text /<span class=\"p\">}<\/span><\/span>/
end
it 'contains a link to the diff file' do
@@ -743,9 +743,6 @@ describe Notify do
subject { Notify.note_commit_email(recipient.id, note.id) }
it_behaves_like 'a note email on a diff', :diff_note_on_commit
- # it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
- # let(:model) { commit }
- # end
it_behaves_like 'it should show Gmail Actions View Commit link'
it_behaves_like 'a user cannot unsubscribe through footer link'
end
@@ -757,9 +754,6 @@ describe Notify do
subject { Notify.note_merge_request_email(recipient.id, note.id) }
it_behaves_like 'a note email on a diff', :diff_note_on_merge_request
- # it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
- # let(:model) { merge_request }
- # end
it_behaves_like 'it should show Gmail Actions View Merge request link'
it_behaves_like 'an unsubscribeable thread'
end
diff --git a/spec/models/discussion_spec.rb b/spec/models/discussion_spec.rb
index d4b1f480c56..187d0bc0150 100644
--- a/spec/models/discussion_spec.rb
+++ b/spec/models/discussion_spec.rb
@@ -595,7 +595,7 @@ describe Discussion, model: true do
let(:truncated_lines) { subject.truncated_diff_lines }
context "when diff is greater than allowed number of truncated diff lines " do
- let(:initial_line_count) { subject.diff_file.diff_lines.count }
+ let(:initial_line_count) { subject.diff_lines.count }
let(:truncated_line_count) { truncated_lines.count }
it "returns fewer lines" do
@@ -606,7 +606,7 @@ describe Discussion, model: true do
end
context "when some diff lines are meta" do
- let(:initial_meta_lines?) { subject.diff_file.diff_lines.any?(&:meta?) }
+ let(:initial_meta_lines?) { subject.diff_lines.any?(&:meta?) }
let(:truncated_meta_lines?) { truncated_lines.any?(&:meta?) }
it "returns no meta lines" do