Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
CI / scan_ruby (push) Failing after 11m20s
CI / scan_js (push) Successful in 10m35s
CI / lint (push) Has been cancelled

Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 23:01:48 +02:00
co-authored by Cursor
commit c4e5f289cf
258 changed files with 11293 additions and 0 deletions
@@ -0,0 +1,44 @@
require "test_helper"
require "base64"
class MailImagesControllerTest < ActionDispatch::IntegrationTest
PNG = Base64.decode64("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==")
test "admin can upload an image for the editor" do
login_as users(:admin)
follow_redirect! if response.redirect?
upload = png_upload
assert_difference -> { ActiveStorage::Blob.count }, 1 do
post mail_images_path(project_code: "matchlivetv"), params: { file: upload }
end
assert_response :success
json = JSON.parse(response.body)
assert json["url"].present?
assert_match(/active_storage/, json["url"])
end
test "rejects non image files" do
login_as users(:admin)
follow_redirect! if response.redirect?
file = Tempfile.new(["note", ".txt"])
file.write("not-an-image")
file.rewind
post mail_images_path(project_code: "matchlivetv"), params: {
file: Rack::Test::UploadedFile.new(file.path, "text/plain")
}
assert_response :unprocessable_entity
end
private
def png_upload
file = Tempfile.new(["pixel", ".png"])
file.binmode
file.write(PNG)
file.rewind
Rack::Test::UploadedFile.new(file.path, "image/png")
end
end