diff --git a/spec/features/organisation_spec.rb b/spec/features/organisation_spec.rb index 6b4efb80c..283293f80 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[]=&assigned_to=all&user=&owning_organisation_select=all&owning_organisation=") + expect(page).to have_current_path("/organisations/#{organisation.id}/lettings-logs?years[]=&years[]=2021&status[]=&assigned_to=all&user=") expect(page).not_to have_link first_log.id.to_s, href: "/lettings-logs/#{first_log.id}" end end diff --git a/spec/features/sales_log_spec.rb b/spec/features/sales_log_spec.rb index 190b9f775..023353fef 100644 --- a/spec/features/sales_log_spec.rb +++ b/spec/features/sales_log_spec.rb @@ -96,17 +96,9 @@ RSpec.describe "Sales Log Features" do context "when filtering logs" do let(:user) { create(:user, last_sign_in_at: Time.zone.now) } - let(:stock_owner_1) { create(:organisation, name: "stock owner 1") } - let(:stock_owner_2) { create(:organisation, name: "stock owner 2") } - let(:managing_agent_1) { create(:organisation, name: "managing agent 1") } - let(:managing_agent_2) { create(:organisation, name: "managing agent 2") } context "when I am signed in" do before do - FactoryBot.create(:organisation_relationship, child_organisation: user.organisation, parent_organisation: stock_owner_1) - FactoryBot.create(:organisation_relationship, child_organisation: user.organisation, parent_organisation: stock_owner_2) - FactoryBot.create(:organisation_relationship, child_organisation: managing_agent_1, parent_organisation: user.organisation) - FactoryBot.create(:organisation_relationship, child_organisation: managing_agent_2, parent_organisation: user.organisation) visit("/sales-logs") fill_in("user[email]", with: user.email) fill_in("user[password]", with: user.password) @@ -125,15 +117,11 @@ RSpec.describe "Sales Log Features" do check("Not started") check("In progress") choose("You") - choose("Specific owning organisation") - select(stock_owner_1.name, from: "owning_organisation") - choose("Specific managing organisation") - select(managing_agent_1.name, from: "managing_organisation") click_button("Apply filters") end it "displays the filters component with a correct count and clear button" do - expect(page).to have_content("5 filters applied") + expect(page).to have_content("3 filters applied") expect(page).to have_content("Clear") end diff --git a/spec/helpers/filters_helper_spec.rb b/spec/helpers/filters_helper_spec.rb index 58ecf738d..10b18ac1e 100644 --- a/spec/helpers/filters_helper_spec.rb +++ b/spec/helpers/filters_helper_spec.rb @@ -222,7 +222,7 @@ RSpec.describe FiltersHelper do "assigned_to" => "all", "status" => [""], "years" => [""], - "organisation" => "all", + "organisation_select" => "all", } end @@ -237,7 +237,8 @@ RSpec.describe FiltersHelper do "assigned_to" => "all", "status" => %w[in_progress completed], "years" => [""], - "organisation" => 2, + "organisation_select" => "specific_org", + "managing_organisation" => 2, } end