diff --git a/app/decorators/asciicast_decorator.rb b/app/decorators/asciicast_decorator.rb index 700cbe2..d9a1864 100644 --- a/app/decorators/asciicast_decorator.rb +++ b/app/decorators/asciicast_decorator.rb @@ -5,10 +5,10 @@ class AsciicastDecorator < ApplicationDecorator THUMBNAIL_HEIGHT = 10 def os - if uname.present? - os_from_uname - elsif user_agent.present? + if user_agent.present? os_from_user_agent + elsif uname.present? + os_from_uname else 'unknown' end diff --git a/spec/decorators/asciicast_decorator_spec.rb b/spec/decorators/asciicast_decorator_spec.rb index c3d821e..599dc40 100644 --- a/spec/decorators/asciicast_decorator_spec.rb +++ b/spec/decorators/asciicast_decorator_spec.rb @@ -86,15 +86,6 @@ describe AsciicastDecorator do it { should == 'unknown' } 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 describe '#terminal_type' do