Files
eminuxCRM/test/controllers/organizations_controller_test.rb
T
eminuxandCursor e492c43bf8
CI / scan_ruby (push) Failing after 15m50s
CI / scan_js (push) Successful in 18m7s
CI / lint (push) Failing after 12m1s
Importa i prospect Calcio a 5 senza toccare la Pallavolo e filtra le organizzazioni per sport.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-05 11:07:43 +02:00

31 lines
1.1 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
end