diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-08-28 12:17:05 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-08-28 12:17:05 +0000 |
commit | ed1ca47c9ea893d643ae613f39b65d80db3b0e67 (patch) | |
tree | 6ed56e2506eb4cd201b55e459f966a737cbf25b3 | |
parent | 58bddf28a7b2f39fd004a2a5d23d016cfd4948f7 (diff) | |
parent | 93f08ba05b9c40fe3e734798db299522234ab68f (diff) | |
download | gitlab-ce-ed1ca47c9ea893d643ae613f39b65d80db3b0e67.tar.gz |
Merge branch 'rs-aggregate-system-note-specs' into 'master'
Combine multiple expectations into one for shared system note example
See merge request !13814
-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 |