diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 186fc7271..419cb8df3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,6 +1,4 @@ module ApplicationHelper - include CloudinaryHelper - # rubocop:disable Performance/OpenStruct DELETED_USER = OpenStruct.new( id: nil, diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index e2f1af093..a1177c337 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -159,9 +159,15 @@ RSpec.describe ApplicationHelper, type: :helper do end describe "#sanitize_and_decode" do - it "Sanitize and decode string" do + it "sanitize and decode string" do expect(helper.sanitize_and_decode("")).to eq("alert('alert')") expect(helper.sanitize_and_decode("< hello")).to eq("< hello") end end + + describe "#cloudinary" do + it "returns cloudinary-manipulated link" do + expect(helper.cloudinary(Faker::Placeholdit.image)).to start_with("https://res.cloudinary.com") + end + end end diff --git a/spec/system/user_uses_the_editor_spec.rb b/spec/system/user_uses_the_editor_spec.rb index 787a5c5e6..5a4aac59e 100644 --- a/spec/system/user_uses_the_editor_spec.rb +++ b/spec/system/user_uses_the_editor_spec.rb @@ -84,4 +84,17 @@ RSpec.describe "Using the editor", type: :system do end end end + + describe "using v2 editor", js: true do + before { user.update(editor_version: "v2") } + + it "fill out form with rich content and click publish" do + visit "/new" + fill_in "article-form-title", with: "This is a test" + fill_in "tag-input", with: "What, Yo" + fill_in "article_body_markdown", with: "Hello" + find("button", text: /\APUBLISH\z/).click + expect(page).to have_text("Hello") + end + end end