diff options
Diffstat (limited to 'spec/models/concerns/noteable_spec.rb')
-rw-r--r-- | spec/models/concerns/noteable_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/models/concerns/noteable_spec.rb b/spec/models/concerns/noteable_spec.rb index 485a6e165a1..760b6c50679 100644 --- a/spec/models/concerns/noteable_spec.rb +++ b/spec/models/concerns/noteable_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe Noteable do let!(:active_diff_note1) { create(:diff_note_on_merge_request) } @@ -40,10 +40,10 @@ describe Noteable do ) end - describe '#discussions' do + describe "#discussions" do let(:discussions) { subject.discussions } - it 'includes discussions for diff notes, commit diff notes, commit notes, and regular notes' do + it "includes discussions for diff notes, commit diff notes, commit notes, and regular notes" do expect(discussions).to eq([ DiffDiscussion.new([active_diff_note1, active_diff_note2], subject), DiffDiscussion.new([active_diff_note3], subject), @@ -54,12 +54,12 @@ describe Noteable do Discussion.new([commit_discussion_note1, commit_discussion_note2], subject), Discussion.new([commit_discussion_note3], subject), IndividualNoteDiscussion.new([note1], subject), - IndividualNoteDiscussion.new([note2], subject) + IndividualNoteDiscussion.new([note2], subject), ]) end end - describe '#grouped_diff_discussions' do + describe "#grouped_diff_discussions" do let(:grouped_diff_discussions) { subject.grouped_diff_discussions } it "includes active discussions" do @@ -225,34 +225,34 @@ describe Noteable do allow(third_discussion).to receive(:to_be_resolved?).and_return(false) end - it 'includes only discussions that need to be resolved' do + it "includes only discussions that need to be resolved" do expect(subject.discussions_to_be_resolved).to eq([first_discussion]) end end - describe '#discussions_can_be_resolved_by?' do + describe "#discussions_can_be_resolved_by?" do let(:user) { build(:user) } - context 'all discussions can be resolved by the user' do + context "all discussions can be resolved by the user" do before do allow(first_discussion).to receive(:can_resolve?).with(user).and_return(true) allow(second_discussion).to receive(:can_resolve?).with(user).and_return(true) allow(third_discussion).to receive(:can_resolve?).with(user).and_return(true) end - it 'allows a user to resolve the discussions' do + it "allows a user to resolve the discussions" do expect(subject.discussions_can_be_resolved_by?(user)).to be(true) end end - context 'one discussion cannot be resolved by the user' do + context "one discussion cannot be resolved by the user" do before do allow(first_discussion).to receive(:can_resolve?).with(user).and_return(true) allow(second_discussion).to receive(:can_resolve?).with(user).and_return(true) allow(third_discussion).to receive(:can_resolve?).with(user).and_return(false) end - it 'allows a user to resolve the discussions' do + it "allows a user to resolve the discussions" do expect(subject.discussions_can_be_resolved_by?(user)).to be(false) end end |