summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-11-23 16:25:31 +0000
committerSean McGivern <sean@gitlab.com>2016-11-28 19:40:48 +0000
commitb8917eb75e94cb13b02534c920ee926c9e97174e (patch)
tree3e4d1a81365099d334b42abc6cf005393bd9a645
parent87a2762b8b001aa8b8d715c964f5ce99d2585ead (diff)
downloadgitlab-ce-b8917eb75e94cb13b02534c920ee926c9e97174e.tar.gz
Fix spec style
-rw-r--r--spec/mailers/notify_spec.rb1
-rw-r--r--spec/models/discussion_spec.rb14
2 files changed, 5 insertions, 10 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 1c4ecf83141..39ba48f61cb 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -646,6 +646,7 @@ describe Notify do
before(:each) { allow(note).to receive(:noteable).and_return(merge_request) }
subject { Notify.note_merge_request_email(recipient.id, note.id) }
+
it_behaves_like 'a note email'
it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
let(:model) { merge_request }
diff --git a/spec/models/discussion_spec.rb b/spec/models/discussion_spec.rb
index 187d0bc0150..2a67c60b978 100644
--- a/spec/models/discussion_spec.rb
+++ b/spec/models/discussion_spec.rb
@@ -595,23 +595,17 @@ 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_lines.count }
- let(:truncated_line_count) { truncated_lines.count }
-
it "returns fewer lines" do
- expect(initial_line_count).to be > described_class::NUMBER_OF_TRUNCATED_DIFF_LINES
+ expect(subject.diff_lines.count).to be > described_class::NUMBER_OF_TRUNCATED_DIFF_LINES
- expect(truncated_line_count).to be <= described_class::NUMBER_OF_TRUNCATED_DIFF_LINES
+ expect(truncated_lines.count).to be <= described_class::NUMBER_OF_TRUNCATED_DIFF_LINES
end
end
context "when some diff lines are meta" do
- let(:initial_meta_lines?) { subject.diff_lines.any?(&:meta?) }
- let(:truncated_meta_lines?) { truncated_lines.any?(&:meta?) }
-
it "returns no meta lines" do
- expect(initial_meta_lines?).to be true
- expect(truncated_meta_lines?).to be false
+ expect(subject.diff_lines).to include(be_meta)
+ expect(truncated_lines).not_to include(be_meta)
end
end
end