Commit b8917eb7 authored by Sean McGivern's avatar Sean McGivern

Fix spec style

parent 87a2762b
...@@ -646,6 +646,7 @@ describe Notify do ...@@ -646,6 +646,7 @@ describe Notify do
before(:each) { allow(note).to receive(:noteable).and_return(merge_request) } before(:each) { allow(note).to receive(:noteable).and_return(merge_request) }
subject { Notify.note_merge_request_email(recipient.id, note.id) } subject { Notify.note_merge_request_email(recipient.id, note.id) }
it_behaves_like 'a note email' it_behaves_like 'a note email'
it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do it_behaves_like 'an answer to an existing thread with reply-by-email enabled' do
let(:model) { merge_request } let(:model) { merge_request }
......
...@@ -595,23 +595,17 @@ describe Discussion, model: true do ...@@ -595,23 +595,17 @@ describe Discussion, model: true do
let(:truncated_lines) { subject.truncated_diff_lines } let(:truncated_lines) { subject.truncated_diff_lines }
context "when diff is greater than allowed number of truncated diff lines " do 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 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
end end
context "when some diff lines are meta" do 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 it "returns no meta lines" do
expect(initial_meta_lines?).to be true expect(subject.diff_lines).to include(be_meta)
expect(truncated_meta_lines?).to be false expect(truncated_lines).not_to include(be_meta)
end end
end end
end end
......
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