mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
change for xhr to avoid csrf during testing
This commit is contained in:
@@ -148,16 +148,16 @@ describe EnterprisesController, type: :controller do
|
||||
# let(:enterprise) { create(:enterprise, permalink: 'enterprise_permalink') }
|
||||
|
||||
it "responds with status of 200 when the route does not exist" do
|
||||
spree_get :check_permalink, permalink: 'some_nonexistent_route', format: :js
|
||||
xhr :get, :check_permalink, permalink: 'some_nonexistent_route', format: :js
|
||||
expect(response.status).to be 200
|
||||
end
|
||||
|
||||
it "responds with status of 409 when the permalink matches an existing route" do
|
||||
# spree_get :check_permalink, { permalink: 'enterprise_permalink', format: :js }
|
||||
# expect(response.status).to be 409
|
||||
spree_get :check_permalink, permalink: 'map', format: :js
|
||||
xhr :get, :check_permalink, permalink: 'map', format: :js
|
||||
expect(response.status).to be 409
|
||||
spree_get :check_permalink, permalink: '', format: :js
|
||||
xhr :get, :check_permalink, permalink: '', format: :js
|
||||
expect(response.status).to be 409
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user