Browse Source

feat: update tests

pull/1998/head
natdeanlewissoftwire 3 years ago
parent
commit
b9f3bf3a6f
  1. 2
      app/views/logs/_log_filters.html.erb
  2. 2
      spec/features/organisation_spec.rb
  3. 6
      spec/models/user_spec.rb

2
app/views/logs/_log_filters.html.erb

@ -93,7 +93,7 @@
} %>
<% end %>
<% if current_user.support? || non_support_with_multiple_managing_orgs? %>
<% if (current_user.support? || non_support_with_multiple_managing_orgs?) && user_or_org_lettings_path? %>
<%= render partial: "filters/radio_filter", locals: {
f:,
options: {

2
spec/features/organisation_spec.rb

@ -194,7 +194,7 @@ RSpec.describe "User Features" do
end
check("years-2021-field")
click_button("Apply filters")
expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2021&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=")
expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2021&status[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=&managing_organisation_select=all&managing_organisation=")
expect(page).not_to have_link first_log.id.to_s, href: "/lettings-logs/#{first_log.id}"
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 eq(%w[status years assigned_to user bulk_upload_id])
expect(user.logs_filters).to match_array(%w[status needstypes years 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 years assigned_to user managing_organisation owning_organisation bulk_upload_id])
expect(user.logs_filters).to match_array(%w[status needstypes years 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 years assigned_to user owning_organisation managing_organisation bulk_upload_id])
expect(user.logs_filters).to match_array(%w[status needstypes years assigned_to user owning_organisation managing_organisation bulk_upload_id])
end
end

Loading…
Cancel
Save