mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix enterprise specs
Plus small refactor
This commit is contained in:
@@ -85,6 +85,7 @@ module Admin
|
||||
end
|
||||
else
|
||||
load_tag_rule_types
|
||||
load_tag_rules
|
||||
respond_with(@object) do |format|
|
||||
format.json {
|
||||
render json: { errors: @object.errors.messages }, status: :unprocessable_entity
|
||||
|
||||
@@ -733,19 +733,16 @@ RSpec.describe '
|
||||
it_behaves_like "edit link with", "openfoodnetwork.org", "http://openfoodnetwork.org"
|
||||
end
|
||||
|
||||
shared_examples "edit link with invalid" do |url|
|
||||
it "url: #{url}" do
|
||||
fill_in "enterprise_white_label_logo_link", with: url
|
||||
context "with an invalid link" do
|
||||
it "can not edit white label logo link" do
|
||||
fill_in "enterprise_white_label_logo_link", with: "invalid url"
|
||||
click_button 'Update'
|
||||
expect(page)
|
||||
.to have_content "Link for the logo used in shopfront '#{url}' is an invalid URL"
|
||||
expect(page).to have_content(
|
||||
"Link for the logo used in shopfront 'invalid url' is an invalid URL"
|
||||
)
|
||||
expect(distributor1.reload.white_label_logo_link).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "can not edit white label logo link" do
|
||||
it_behaves_like "edit link with invalid", "invalid url"
|
||||
end
|
||||
end
|
||||
|
||||
it "can check/uncheck the hide_groups_tab attribute" do
|
||||
|
||||
Reference in New Issue
Block a user