mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
There were a few changes needed: * Plugins are now specified through `plugin:` config keyword. * All plugin gems need to be specified explicitly in Gemfile since they are no longer dependencies of plugins already specified explicitly. * All plugin gems need to be updated in other to use the new APIs. * One cop was renamed. * New offenses safe to correct were corrected directly with `bundle exec rubocop -a`. * New offenses unsafe to correct were added to the TODO configuration with `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp`.
22 lines
673 B
Ruby
22 lines
673 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'system_helper'
|
|
|
|
RSpec.describe 'sitemap' do
|
|
let(:enterprise) { create(:distributor_enterprise) }
|
|
let!(:group) { create(:enterprise_group, enterprises: [enterprise], on_front_page: true) }
|
|
|
|
it "renders sitemap" do
|
|
visit '/sitemap.xml'
|
|
expect(page.source).to have_content return_page(enterprise_shop_url(enterprise))
|
|
expect(page.source).to have_content return_page(group_url(group))
|
|
end
|
|
end
|
|
|
|
def return_page(website)
|
|
# routing does not include the port of the session, this method adds it
|
|
url = URI(page.driver.browser.url)
|
|
path = URI(website).path
|
|
return_page = "http://#{url.host}:#{url.port}#{path}"
|
|
end
|