Browse Source

fix tests

pull/1772/head
Kat 3 years ago
parent
commit
bc438482ef
  1. 4
      spec/features/organisation_spec.rb
  2. 4
      spec/features/user_spec.rb
  3. 8
      spec/models/user_spec.rb

4
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

4
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

8
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

Loading…
Cancel
Save