diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 53b8a75cc..23c0dad13 100644 --- a/spec/features/organisation_spec.rb +++ b/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[]=&user=all") + expect(page).to have_current_path("/organisations/#{org_id}/lettings-logs?years[]=&years[]=2021&status[]=&user=all&owning_organisation_select=all&owning_organisation=") expect(page).not_to have_link first_log.id.to_s, href: "/lettings-logs/#{first_log.id}" end end @@ -227,7 +227,7 @@ RSpec.describe "User Features" do end check("years-2021-field") click_button("Apply filters") - expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2021&status[]=&user=all") + expect(page).to have_current_path("/organisations/#{org_id}/sales-logs?years[]=&years[]=2021&status[]=&user=all&owning_organisation_select=all&owning_organisation=") expect(page).not_to have_link first_log.id.to_s, href: "/sales-logs/#{first_log.id}" end end diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index 62e185b2e..777e6c287 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -724,10 +724,10 @@ RSpec.describe "User Features" do expect(page).to have_field("organisation-field", with: "") find("#organisation-field").click.native.send_keys("F", "i", "l", "t", :down, :enter) click_button("Apply filters") - expect(page).to have_current_path("/lettings-logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&organisation_select=specific_org&organisation=#{organisation.id}") + expect(page).to have_current_path("/lettings-logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&owning_organisation_select=all&organisation_select=specific_org&organisation=#{organisation.id}") choose("organisation-select-all-field", allow_label_click: true) click_button("Apply filters") - expect(page).to have_current_path("/lettings-logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&organisation_select=all") + expect(page).to have_current_path("/lettings-logs?%5Byears%5D%5B%5D=&%5Bstatus%5D%5B%5D=&user=all&owning_organisation_select=all&organisation_select=all") end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b9fb91c06..ef2045753 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -151,8 +151,8 @@ RSpec.describe User, type: :model do create(:organisation_relationship, parent_organisation: user.organisation) end - it "can filter lettings logs by user, year, status and organisation" do - expect(user.logs_filters).to eq(%w[status years user organisation bulk_upload_id]) + it "can filter lettings logs by user, owning_organisation, year, status and organisation" do + expect(user.logs_filters).to eq(%w[status years user organisation owning_organisation bulk_upload_id]) end end end @@ -192,8 +192,8 @@ RSpec.describe User, type: :model do }) end - it "can filter lettings logs by user, year, status and organisation" do - expect(user.logs_filters).to eq(%w[status years user organisation bulk_upload_id]) + it "can filter lettings logs by user, owning_organisation, year, status and organisation" do + expect(user.logs_filters).to eq(%w[status years user organisation owning_organisation bulk_upload_id]) end end