File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,8 +194,12 @@ def preview_card
194194 def title
195195 if destroyed?
196196 "#{ account . acct } deleted status"
197+ elsif reblog?
198+ preview = sensitive ? '<sensitive>' : text . slice ( 0 , 10 ) . split ( "\n " ) [ 0 ]
199+ "#{ account . acct } shared #{ reblog . account . acct } 's: #{ preview } "
197200 else
198- reblog? ? "#{ account . acct } shared a status by #{ reblog . account . acct } " : "New status by #{ account . acct } "
201+ preview = sensitive ? '<sensitive>' : text . slice ( 0 , 20 ) . split ( "\n " ) [ 0 ]
202+ "#{ account . acct } : #{ preview } "
199203 end
200204 end
201205
Original file line number Diff line number Diff line change 9696
9797 context 'unless destroyed?' do
9898 context 'if reblog?' do
99- it 'returns "#{account.acct} shared a status by #{reblog.account.acct}"' do
99+ it 'returns "#{account.acct} shared #{reblog.account.acct}\'s: #{preview }"' do
100100 reblog = subject . reblog = other
101- expect ( subject . title ) . to eq "#{ account . acct } shared a status by #{ reblog . account . acct } "
101+ preview = subject . text . slice ( 0 , 10 ) . split ( "\n " ) [ 0 ]
102+ expect ( subject . title ) . to (
103+ eq "#{ account . acct } shared #{ reblog . account . acct } 's: #{ preview } "
104+ )
102105 end
103106 end
104107
105108 context 'unless reblog?' do
106- it 'returns "New status by #{account.acct}"' do
109+ it 'returns "#{account.acct}: #{preview }"' do
107110 subject . reblog = nil
108- expect ( subject . title ) . to eq "New status by #{ account . acct } "
111+ preview = subject . text . slice ( 0 , 20 ) . split ( "\n " ) [ 0 ]
112+ expect ( subject . title ) . to eq "#{ account . acct } : #{ preview } "
109113 end
110114 end
111115 end
You can’t perform that action at this time.
0 commit comments