mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-17 12:42:35 +00:00
Add tests for Status#hidden? (#5719)
This commit is contained in:
parent
3e4b01b47d
commit
3023725936
|
@ -69,6 +69,36 @@ RSpec.describe Status, type: :model do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#hidden?' do
|
||||||
|
context 'if private_visibility?' do
|
||||||
|
it 'returns true' do
|
||||||
|
subject.visibility = :private
|
||||||
|
expect(subject.hidden?).to be true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'if direct_visibility?' do
|
||||||
|
it 'returns true' do
|
||||||
|
subject.visibility = :direct
|
||||||
|
expect(subject.hidden?).to be true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'if public_visibility?' do
|
||||||
|
it 'returns false' do
|
||||||
|
subject.visibility = :public
|
||||||
|
expect(subject.hidden?).to be false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'if unlisted_visibility?' do
|
||||||
|
it 'returns false' do
|
||||||
|
subject.visibility = :unlisted
|
||||||
|
expect(subject.hidden?).to be false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#content' do
|
describe '#content' do
|
||||||
it 'returns the text of the status if it is not a reblog' do
|
it 'returns the text of the status if it is not a reblog' do
|
||||||
expect(subject.content).to eql subject.text
|
expect(subject.content).to eql subject.text
|
||||||
|
|
Loading…
Reference in a new issue