diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-08-24 15:40:21 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-08-24 21:51:47 -0400 |
commit | 93f08ba05b9c40fe3e734798db299522234ab68f (patch) | |
tree | 5b4f159f8df1ed791b6f84d109d12b0b3a421a4e /spec/services | |
parent | 24244d03b55bc7732b3362bab1e1cc7e04c2dabf (diff) | |
download | gitlab-ce-93f08ba05b9c40fe3e734798db299522234ab68f.tar.gz |
Combine multiple expectations into one for shared system note examplers-aggregate-system-note-specs
These are all performing unique checks on the same object, so there's no
benefit to isolating them.
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 6d36affa9dc..e6a18654651 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -13,37 +13,16 @@ describe SystemNoteService do let(:expected_noteable) { noteable } let(:commit_count) { nil } - it 'is valid' do + it 'has the correct attributes', :aggregate_failures do expect(subject).to be_valid - end + expect(subject).to be_system - it 'sets the noteable model' do expect(subject.noteable).to eq expected_noteable - end - - it 'sets the project' do expect(subject.project).to eq project - end - - it 'sets the author' do expect(subject.author).to eq author - end - it 'is a system note' do - expect(subject).to be_system - end - - context 'metadata' do - it 'creates a new system note metadata record' do - expect { subject }.to change { SystemNoteMetadata.count }.from(0).to(1) - end - - it 'creates a record correctly' do - metadata = subject.system_note_metadata - - expect(metadata.commit_count).to eq(commit_count) - expect(metadata.action).to eq(action) - end + expect(subject.system_note_metadata.action).to eq(action) + expect(subject.system_note_metadata.commit_count).to eq(commit_count) end end |