mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Ensure that AUTH_TOKEN var is set in tests, since spree's admin JS errors without it
This commit is contained in:
9
app/overrides/set_auth_token_in_test.rb
Normal file
9
app/overrides/set_auth_token_in_test.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
|
||||
:insert_bottom => "[data-hook='inside_head']",
|
||||
:partial => "layouts/auth_token_script",
|
||||
:name => "auth_token_script")
|
||||
|
||||
Deface::Override.new(:virtual_path => "spree/layouts/admin",
|
||||
:insert_bottom => "[data-hook='admin_inside_head']",
|
||||
:partial => "layouts/auth_token_script",
|
||||
:name => "auth_token_script")
|
||||
4
app/views/layouts/_auth_token_script.html.haml
Normal file
4
app/views/layouts/_auth_token_script.html.haml
Normal file
@@ -0,0 +1,4 @@
|
||||
:javascript
|
||||
if(typeof AUTH_TOKEN === 'undefined') {
|
||||
var AUTH_TOKEN = '';
|
||||
}
|
||||
Reference in New Issue
Block a user