Browse Source

refactor: reorganise filter lists

pull/1998/head
natdeanlewissoftwire 3 years ago
parent
commit
ce6da3f637
  1. 2
      app/helpers/filters_helper.rb
  2. 1
      spec/features/organisation_spec.rb
  3. 6
      spec/models/user_spec.rb

2
app/helpers/filters_helper.rb

@ -154,7 +154,7 @@ private
def filters_count(filters)
filters.each.sum do |category, category_filters|
if %w[status needstypes years bulk_upload_id].include?(category)
if %w[years status needstypes bulk_upload_id].include?(category)
category_filters.count(&:present?)
elsif %w[user owning_organisation managing_organisation].include?(category)
1

1
spec/features/organisation_spec.rb

@ -212,7 +212,6 @@ RSpec.describe "User Features" do
other_supported_housing_logs.each do |supported_housing_log|
expect(page).not_to have_link supported_housing_log.id.to_s, href: "/lettings-logs/#{supported_housing_log.id}"
end
end
end

6
spec/models/user_spec.rb

@ -163,7 +163,7 @@ RSpec.describe User, type: :model do
end
it "can filter lettings logs by user, year and status" do
expect(user.logs_filters).to match_array(%w[status needstypes years assigned_to user bulk_upload_id])
expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user bulk_upload_id])
end
end
@ -173,7 +173,7 @@ RSpec.describe User, type: :model do
end
it "can filter lettings logs by user, year, status, managing_organisation and owning_organisation" do
expect(user.logs_filters).to match_array(%w[status needstypes years assigned_to user managing_organisation owning_organisation bulk_upload_id])
expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user managing_organisation owning_organisation bulk_upload_id])
end
end
end
@ -214,7 +214,7 @@ RSpec.describe User, type: :model do
end
it "can filter lettings logs by user, year, status, managing_organisation and owning_organisation" do
expect(user.logs_filters).to match_array(%w[status needstypes years assigned_to user owning_organisation managing_organisation bulk_upload_id])
expect(user.logs_filters).to match_array(%w[years status needstypes assigned_to user owning_organisation managing_organisation bulk_upload_id])
end
end

Loading…
Cancel
Save