Browse Source

update tests

pull/3063/head
Samuel 1 week ago
parent
commit
185b111ff8
  1. 6
      spec/models/user_spec.rb
  2. 3
      spec/requests/sales_logs_controller_spec.rb

6
spec/models/user_spec.rb

@ -164,7 +164,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[years status needstypes assigned_to user bulk_upload_id user_text_search])
expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user bulk_upload_id user_text_search])
end
end
@ -174,7 +174,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[years status needstypes assigned_to user managing_organisation owning_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search])
expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user managing_organisation owning_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search])
end
it "can filter schemes by status and owning_organisation" do
@ -219,7 +219,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[years status needstypes assigned_to user owning_organisation managing_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search])
expect(user.logs_filters).to match_array(%w[years status needstypes salestypes assigned_to user owning_organisation managing_organisation bulk_upload_id managing_organisation_text_search owning_organisation_text_search user_text_search])
end
it "can filter bulk uploads by year, uploaded_by and uploading_organisation " do

3
spec/requests/sales_logs_controller_spec.rb

@ -981,12 +981,13 @@ RSpec.describe SalesLogsController, type: :request do
it "allows updating log filters" do
expect(page).to have_content("Check your filters")
expect(page).to have_link("Change", count: 5)
expect(page).to have_link("Change", count: 6)
expect(page).to have_link("Change", href: "/sales-logs/filters/years?codes_only=false&referrer=check_answers&search=#{search_term}")
expect(page).to have_link("Change", href: "/sales-logs/filters/assigned-to?codes_only=false&referrer=check_answers&search=#{search_term}")
expect(page).to have_link("Change", href: "/sales-logs/filters/owned-by?codes_only=false&referrer=check_answers&search=#{search_term}")
expect(page).to have_link("Change", href: "/sales-logs/filters/managed-by?codes_only=false&referrer=check_answers&search=#{search_term}")
expect(page).to have_link("Change", href: "/sales-logs/filters/status?codes_only=false&referrer=check_answers&search=#{search_term}")
expect(page).to have_link("Change", href: "/sales-logs/filters/salestype?codes_only=false&referrer=check_answers&search=#{search_term}")
end
it "has a hidden field with the search term" do

Loading…
Cancel
Save