From a766ece166106fe5e877ec18469af020916ad292 Mon Sep 17 00:00:00 2001 From: ysksn Date: Thu, 16 Nov 2017 15:46:29 +0900 Subject: [PATCH] Add tests for Status#verb (#5717) --- spec/models/status_spec.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb index 0b8ed66f6e..d58ff50192 100644 --- a/spec/models/status_spec.rb +++ b/spec/models/status_spec.rb @@ -47,8 +47,27 @@ RSpec.describe Status, type: :model do end describe '#verb' do - it 'is always post' do - expect(subject.verb).to be :post + context 'if destroyed?' do + it 'returns :delete' do + subject.destroy! + expect(subject.verb).to be :delete + end + end + + context 'unless destroyed?' do + context 'if reblog?' do + it 'returns :share' do + subject.reblog = other + expect(subject.verb).to be :share + end + end + + context 'unless reblog?' do + it 'returns :post' do + subject.reblog = nil + expect(subject.verb).to be :post + end + end end end