0
0
Fork 0

Merge pull request #1184 from thoughtbot/extract-proper-status

DRY up reblog vs original status check
This commit is contained in:
Eugen 2017-04-07 22:28:15 +02:00 committed by GitHub
commit 32748c0f71
7 changed files with 86 additions and 11 deletions

View file

@ -107,4 +107,15 @@ RSpec.describe Status, type: :model do
expect(subject.favourites_count).to eq 2
end
end
describe '#proper' do
it 'is itself for original statuses' do
expect(subject.proper).to eq subject
end
it 'is the source status for reblogs' do
subject.reblog = other
expect(subject.proper).to eq other
end
end
end