Remove redundant include of CloudinaryHelper (#8136)

This commit is contained in:
Mac Siri 2020-05-29 10:26:46 -04:00 committed by GitHub
parent 15d2dd0b3a
commit 25c1f9210f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -1,6 +1,4 @@
module ApplicationHelper
include CloudinaryHelper
# rubocop:disable Performance/OpenStruct
DELETED_USER = OpenStruct.new(
id: nil,

View file

@ -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("<script>alert('alert')</script>")).to eq("alert('alert')")
expect(helper.sanitize_and_decode("&lt; 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

View file

@ -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