Add tests for Status#verb (#5717)

th-downstream
ysksn 7 years ago committed by Yamagishi Kazutoshi
parent ab48f2b239
commit a766ece166

@ -47,10 +47,29 @@ RSpec.describe Status, type: :model do
end
describe '#verb' do
it 'is always post' do
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
describe '#object_type' do
it 'is note when the status is self-contained' do

Loading…
Cancel
Save