Files
eminuxCRM/test/controllers/organizations_controller_test.rb
eminuxandCursor 3e73e708e4
CI / scan_ruby (push) Failing after 12m54s
CI / scan_js (push) Successful in 12m34s
CI / lint (push) Failing after 13m10s
Rende usabili i filtri destinatari e permette di eliminare le bozze email.
Le listbox non applicavano sport e altri criteri; ora i filtri sono checkbox, c'è «mai contattati» e dal cruscotto si cancellano le bozze. La lista organizzazioni allinea le colonne al foglio campagna.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 07:57:50 +02:00

42 lines
1.6 KiB
Ruby

require "test_helper"
class OrganizationsControllerTest < ActionDispatch::IntegrationTest
test "sport filter is a dropdown of values already in the project" do
login_as users(:admin)
create_campaign_org(name: "Futsal Test", email: "futsal@example.com", sport: "Calcio a 5")
get organizations_path(project_code: "matchlivetv")
assert_response :success
assert_select "select[name=sport]" do
assert_select "option[value='']", text: "Sport"
assert_select "option[value=Calcio]", text: "Calcio"
assert_select "option[value='Calcio a 5']", text: "Calcio a 5"
end
assert_select "input[name=sport]", count: 0
end
test "sport filter keeps only organizations of that sport" do
login_as users(:admin)
create_campaign_org(name: "Futsal Test", email: "futsal@example.com", sport: "Calcio a 5")
get organizations_path(project_code: "matchlivetv", sport: "Calcio a 5")
assert_response :success
assert_match(/Futsal Test/, response.body)
assert_no_match(/ASD Test Calcio/, response.body)
assert_select "select[name=sport] option[value='Calcio a 5'][selected]"
end
test "index table uses campaign spreadsheet columns" do
login_as users(:admin)
get organizations_path(project_code: "matchlivetv")
assert_response :success
%w[N. Regione Prov. Società Email\ verificata Streaming\ rilevato Evidenza\ /\ fit\ commerciale Stato\ invio Fonte\ contatto\ /\ ricerca Note\ follow-up].each do |header|
assert_select "th", text: header
end
assert_select "th", text: "Organizzazione", count: 0
end
end