From 5e1d2d04486907fcbfc01a4042f7a5ab8c5830a5 Mon Sep 17 00:00:00 2001 From: binarygit Date: Thu, 25 Jul 2024 15:58:40 +0545 Subject: [PATCH] Write test for warnings --- ...urce_missing_model_spec.rb => avo_warning_spec.rb} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename spec/features/avo/{resource_missing_model_spec.rb => avo_warning_spec.rb} (67%) diff --git a/spec/features/avo/resource_missing_model_spec.rb b/spec/features/avo/avo_warning_spec.rb similarity index 67% rename from spec/features/avo/resource_missing_model_spec.rb rename to spec/features/avo/avo_warning_spec.rb index a123ec16b5..ff39e07f94 100644 --- a/spec/features/avo/resource_missing_model_spec.rb +++ b/spec/features/avo/avo_warning_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" require "rails/generators" -RSpec.feature "ResourceMissingModels", type: :feature do +RSpec.feature "AvoWarning", type: :feature do before :all do Rails::Generators.invoke("avo:resource", ["bad", "--quiet", "--skip"], {destination_root: Rails.root}) end @@ -13,7 +13,7 @@ end end - it "tests the message" do + it "displays bad model warning" do visit "/admin/resources/comments" click_on_sidebar_item "Fish" @@ -21,4 +21,11 @@ expect(page).to have_text "Please create that model or assign one using self.model_class = YOUR_MODEL" expect(page).to have_link href: "https://docs.avohq.io/3.0/resources.html#self_model_class" end + + it "displays menu editor" do + visit "/admin/resources/comments" + + expect(page).to have_text "The menu editor is available exclusively with the Pro license. Consider upgrading to access this feature." + expect(page).to have_link href: "https://docs.avohq.io/3.0/menu-editor.html" + end end