Merge pull request #1184 from thoughtbot/extract-proper-status
DRY up reblog vs original status check
This commit is contained in:
commit
32748c0f71
7 changed files with 86 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue