Navigation Menu

Skip to content

Commit

Permalink
fixes #10996 - ignore content view histories without tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsherrill committed Jul 3, 2015
1 parent 445015f commit eee31ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/katello/content_view_version.rb
Expand Up @@ -85,7 +85,7 @@ def to_s
delegate :organization, to: :content_view

def active_history
self.history.select { |history| history.task.pending }
self.history.select { |history| history.task.try(:pending) }
end

def last_event
Expand Down
5 changes: 5 additions & 0 deletions test/models/content_view_version_test.rb
Expand Up @@ -70,6 +70,11 @@ def test_docker_count
assert_equal tag_count, cvv.docker_tag_count
end

def test_active_history_nil_task
@cvv.history = [ContentViewHistory.new(:status => ContentViewHistory::IN_PROGRESS, :user => 'admin')]
assert_empty @cvv.active_history
end

def test_search_equal_version
assert_includes ContentViewVersion.search_for("version = 1.0"), @cvv
query = ContentViewVersion.search_for("version = 1")
Expand Down

0 comments on commit eee31ac

Please sign in to comment.