parent
97931ceaed
commit
f86734bf50
@ -5,10 +5,10 @@ class AsciicastDecorator < ApplicationDecorator
|
|||||||
THUMBNAIL_HEIGHT = 10
|
THUMBNAIL_HEIGHT = 10
|
||||||
|
|
||||||
def os
|
def os
|
||||||
if uname.present?
|
if user_agent.present?
|
||||||
os_from_uname
|
|
||||||
elsif user_agent.present?
|
|
||||||
os_from_user_agent
|
os_from_user_agent
|
||||||
|
elsif uname.present?
|
||||||
|
os_from_uname
|
||||||
else
|
else
|
||||||
'unknown'
|
'unknown'
|
||||||
end
|
end
|
||||||
|
@ -86,15 +86,6 @@ describe AsciicastDecorator do
|
|||||||
|
|
||||||
it { should == 'unknown' }
|
it { should == 'unknown' }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user_agent and uname are present' do
|
|
||||||
before do
|
|
||||||
asciicast.user_agent = 'python-requests/2.0.0 CPython/2.7.5 Linux/3.11.3-201.fc19.x86_64'
|
|
||||||
asciicast.uname = 'Some t430u 3.5.0-18-generic #29-Ubuntu SMP'
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should == 'Some' }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#terminal_type' do
|
describe '#terminal_type' do
|
||||||
|
Loading…
Reference in New Issue
Block a user