Skip to content

Commit

Permalink
Fix filtered_editions_presenter_test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtrussler committed Sep 4, 2024
1 parent cfc3dee commit 966f046
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/presenters/filtered_editions_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ def edition_states
states
end

def available_users
User.enabled.alphabetized
end

def assignees
users = [{ text: "All assignees", value: "" }]

User.enabled.alphabetized.map do |user|
available_users.map do |user|
users << if user.id.to_s == @assigned_to_filter
{ text: user.name, value: user.id, selected: "true" }
else
Expand Down
4 changes: 2 additions & 2 deletions test/unit/presenters/filtered_editions_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class FilteredEditionsPresenterTest < ActiveSupport::TestCase
guide = FactoryBot.create(:guide_edition)
FactoryBot.create(:completed_transaction_edition)

filtered_editions = FilteredEditionsPresenter.new(format_filter: "guide").editions
filtered_editions = FilteredEditionsPresenter.new(content_type_filter: "guide").editions

assert_equal([guide], filtered_editions.to_a)
end
Expand All @@ -69,7 +69,7 @@ class FilteredEditionsPresenterTest < ActiveSupport::TestCase
FactoryBot.create(:guide_edition)
FactoryBot.create(:completed_transaction_edition)

filtered_editions = FilteredEditionsPresenter.new(format_filter: "all").editions
filtered_editions = FilteredEditionsPresenter.new(content_type_filter: "all").editions

assert_equal(2, filtered_editions.count)
end
Expand Down

0 comments on commit 966f046

Please sign in to comment.