Skip to content

Commit

Permalink
Fixes #1264
Browse files Browse the repository at this point in the history
erwanlr committed Dec 13, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 46a00cc commit dec73c2
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/wp_version.rb
Original file line number Diff line number Diff line change
@@ -53,12 +53,12 @@ def vulnerabilities

# @return [ String ]
def release_date
@release_date ||= db_data['release_date']
@release_date ||= db_data['release_date'] || 'Unknown'
end

# @return [ String ]
def status
@status ||= db_data['status']
@status ||= db_data['status'] || 'Unknown'
end
end
end
12 changes: 12 additions & 0 deletions spec/app/models/wp_version_spec.rb
Original file line number Diff line number Diff line change
@@ -91,11 +91,23 @@
subject(:version) { described_class.new('3.8.1') }

its(:release_date) { should eql '2014-01-23' }

context 'when the version is not in the DB' do
subject(:version) { described_class.new('3.8.2') }

its(:release_date) { should eql 'Unknown' }
end
end

describe '#status' do
subject(:version) { described_class.new('3.8.1') }

its(:status) { should eql 'outdated' }

context 'when the version is not in the DB' do
subject(:version) { described_class.new('3.8.2') }

its(:release_date) { should eql 'Unknown' }
end
end
end

0 comments on commit dec73c2

Please sign in to comment.