diff options
author | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-08-29 09:46:40 -0400 |
---|---|---|
committer | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-09-06 09:00:57 -0400 |
commit | 65bcd141c883b1efd9518ff5f588e1dcb1d80f64 (patch) | |
tree | 21507da44c611c2a8cfeb0b64e4163374b6f2451 /spec/models | |
parent | 4130552b421f1b83e60f03715000efe56461fc6b (diff) | |
download | gitlab-ce-65bcd141c883b1efd9518ff5f588e1dcb1d80f64.tar.gz |
add controller spec
also fix some code styling issues
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/note_spec.rb | 21 |
2 files changed, 3 insertions, 24 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 098d33e46c5..fb5fb7daaab 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -501,7 +501,7 @@ describe Issuable do project.add_guest(contributor) project.add_guest(first_time_contributor) end - + let(:merged_mr) { create(:merge_request, :merged, author: contributor, target_project: project, source_project: project) } let(:open_mr) { create(:merge_request, author: first_time_contributor, target_project: project, source_project: project) } let(:merged_mr_other_project) { create(:merge_request, :merged, author: first_time_contributor, target_project: other_project, source_project: other_project) } @@ -515,13 +515,13 @@ describe Issuable do it "is false for OWNER" do mr = create(:merge_request, author: owner, target_project: project, source_project: project) - + expect(mr).not_to be_first_contribution end it "is false for REPORTER" do mr = create(:merge_request, author: reporter, target_project: project, source_project: project) - + expect(mr).not_to be_first_contribution end diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 09caa2c9991..b214074fdce 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -696,25 +696,4 @@ describe Note do note.destroy! end end - - describe '#specialize!' do - let(:note) { build(:note) } - let(:role) { Note::SpecialRole::FIRST_TIME_CONTRIBUTOR } - - it 'should set special role without a block' do - expect { note.specialize!(role) }.to change { note.special_role }.from(nil).to(role) - end - - it 'should set special role with a truthy block' do - tautology = -> (*) { true } - - expect { note.specialize!(role, &tautology) }.to change { note.special_role }.from(nil).to(role) - end - - it 'should not set special role with a falsey block' do - contradiction = -> (*) { false } - - expect { note.specialize!(role, &contradiction) }.not_to change { note.special_role } - end - end end |