Class: TC_FECTestScheduleB
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- TC_FECTestScheduleB
- Defined in:
- lib/tests/sbtest.rb
Overview
f.ordered_keys().each do |k| puts “assert_equal(”,f.#k)” end
Instance Method Summary collapse
- #setup ⇒ Object
- #test_v300 ⇒ Object
- #test_v500 ⇒ Object
- #test_v51 ⇒ Object
- #test_v52 ⇒ Object
- #test_v53 ⇒ Object
- #test_v61 ⇒ Object
- #test_v62 ⇒ Object
- #test_v63 ⇒ Object
- #test_v64 ⇒ Object
- #test_v70 ⇒ Object
Instance Method Details
#setup ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tests/sbtest.rb', line 16 def setup @testfiles = {} @testfiles["3.00"] = "tests/testdata/F3-3.00-32933-SB.fec" @testfiles["5.00"] = "tests/testdata/F3-5.00-97424-SB.fec" @testfiles["5.1"] = "tests/testdata/F3-5.1-126655-SB.fec" @testfiles["5.2"] = "tests/testdata/F3-5.2-170443.fec" @testfiles["5.3"] = "tests/testdata/F3-5.3-210119-SB.fec" @testfiles["6.1"] = "tests/testdata/F3-6.1-331453-SB.fec" @testfiles["6.2"] = "tests/testdata/F3-6.2-350775-SB.fec" @testfiles["6.3"] = "tests/testdata/F3-6.3-413226-SB.fec" @testfiles["6.4"] = "tests/testdata/F3-6.4-424586-SB.fec" @testfiles["7.0"] = "tests/testdata/F3-7.0-720829-SB.fec" end |
#test_v300 ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/tests/sbtest.rb', line 30 def test_v300 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["3.00"]) h.process(@testfiles["3.00"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" assert_equal('C00256131',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('Key Bank',f.payee_organization_name) #assert_equal('',f.payee_last_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('700 5th Avenue',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Seattle',f.payee_city) assert_equal('WA',f.payee_state) assert_equal('98104 ',f.payee_zip) assert_equal('P2002',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20020301',f.expenditure_date) assert_equal('241.64',f.expenditure_amount) assert_equal('001',f.expenditure_purpose_code) assert_equal('Bank Merchant Fee',f.expenditure_purpose_description) assert_equal('',f.expenditure_category_code) assert_equal('C00256131',f.beneficiary_committee_fecid) assert_equal('H2WA08075',f.beneficiary_candidate_fecid) assert_equal('H',f.beneficiary_candidate_office) assert_equal('WA',f.beneficiary_candidate_state) assert_equal('08',f.beneficiary_candidate_district) break end end end |
#test_v500 ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/tests/sbtest.rb', line 74 def test_v500 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.00"]) h.process(@testfiles["5.00"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) #SB17,C00364406,IND,Capitol Vial^^^,P. O. Box 446,,Fultonville,NY,12072,,Advertising,P2004,,20030812,223.44,C00364406,,FLETCHER FOR CONGRESS,H,LA,05,,,,,,,,,,SB17.4270,,,,,004, if schedule == "SB" assert_equal('C00364406',f.committee_fecid) assert_equal('IND',f.entity_type) #assert_equal('Key Bank',f.payee_organization_name) assert_equal('Capitol Vial',f.payee_last_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('P. O. Box 446',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Fultonville',f.payee_city) assert_equal('NY',f.payee_state) assert_equal('12072',f.payee_zip) assert_equal('P2004',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20030812',f.expenditure_date) assert_equal('223.44',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Advertising',f.expenditure_purpose_description) assert_equal('004',f.expenditure_category_code) assert_equal('C00364406',f.beneficiary_committee_fecid) #assert_equal('H2WA08075',f.beneficiary_candidate_fecid) assert_equal('H',f.beneficiary_candidate_office) assert_equal('LA',f.beneficiary_candidate_state) assert_equal('05',f.beneficiary_candidate_district) break end end end |
#test_v51 ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/tests/sbtest.rb', line 117 def test_v51 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.1"]) h.process(@testfiles["5.1"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" assert_equal('C00370197',f.committee_fecid) assert_equal('CAN',f.entity_type) #assert_equal('Key Bank',f.payee_organization_name) #assert_equal('Capitol Vial',f.payee_organization_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('5 Sommerville Place',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Ladera Ranch',f.payee_city) assert_equal('CA',f.payee_state) assert_equal('92694',f.payee_zip) assert_equal('P2002',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20040301',f.expenditure_date) assert_equal('123.69',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Office Supplies',f.expenditure_purpose_description) assert_equal('',f.expenditure_category_code) assert_equal('',f.beneficiary_committee_fecid) #assert_equal('H',f.beneficiary_candidate_office) #assert_equal('LA',f.beneficiary_candidate_state) #assert_equal('05',f.beneficiary_candidate_district) break end end end |
#test_v52 ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/tests/sbtest.rb', line 158 def test_v52 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.2"]) h.process(@testfiles["5.2"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17,C00378935,ORG,,Third Avenue,,New York,NY,10022,,Bank Charge,P2006,,20050103,20.00,C00378935,,FRIENDS OF ANTON SRDANOVIC,H,NY,14,,,,,,,,,,SB17.4679,,,,,,,Chase Bank,,,,, assert_equal('C00378935',f.committee_fecid) assert_equal('ORG',f.entity_type) #assert_equal('Key Bank',f.payee_organization_name) #assert_equal('Capitol Vial',f.payee_organization_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('Third Avenue',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('New York',f.payee_city) assert_equal('NY',f.payee_state) assert_equal('10022',f.payee_zip) assert_equal('P2006',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20050103',f.expenditure_date) assert_equal('20.00',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Bank Charge',f.expenditure_purpose_description) assert_equal('',f.expenditure_category_code) assert_equal('C00378935',f.beneficiary_committee_fecid) assert_equal('H',f.beneficiary_candidate_office) assert_equal('NY',f.beneficiary_candidate_state) assert_equal('14',f.beneficiary_candidate_district) ## 5.1-5.3 only for individuals / orgs assert_equal('Chase Bank', f.recipient_organization_name) break end end end |
#test_v53 ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/tests/sbtest.rb', line 202 def test_v53 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.3"]) h.process(@testfiles["5.3"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17,C00414391,IND,,RD 2 Box 359,,Ulster,PA,18850,,In-kind - office expenses & phone,P2006,,20051015,308.11,,,,,,,,,,,,,,,,SB17.4668,,,,,,,,Eldredge-Martin,Andrew,,, assert_equal('C00414391',f.committee_fecid) assert_equal('IND',f.entity_type) #assert_equal('Key Bank',f.payee_organization_name) #assert_equal('Capitol Vial',f.payee_organization_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('RD 2 Box 359',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Ulster',f.payee_city) assert_equal('PA',f.payee_state) assert_equal('18850',f.payee_zip) assert_equal('P2006',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20051015',f.expenditure_date) assert_equal('308.11',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('In-kind - office expenses & phone',f.expenditure_purpose_description) assert_equal('',f.expenditure_category_code) ## 5.1-5.3 only for individuals / orgs assert_equal('Eldredge-Martin', f.recipient_last_name) assert_equal('Andrew', f.recipient_first_name) #assert_equal('C00378935',f.beneficiary_committee_fecid) #assert_equal('H',f.beneficiary_candidate_office) #assert_equal('NY',f.beneficiary_candidate_state) #assert_equal('14',f.beneficiary_candidate_district) break end end end |
#test_v61 ⇒ Object
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/tests/sbtest.rb', line 247 def test_v61 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.1"]) h.process(@testfiles["6.1"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17C00390476SB17.34826ORGAdvantage Printing2717 N PerrySpokaneWA99207P2008200803089920.00Advertising - 1800 yard signs004 assert_equal('C00390476',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('Advantage Printing',f.payee_organization_name) #assert_equal('',f.payee_first_name) #assert_equal('',f.payee_middle_name) #assert_equal('',f.payee_prefix) #assert_equal('',f.payee_suffix) assert_equal('2717 N Perry',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Spokane',f.payee_city) assert_equal('WA',f.payee_state) assert_equal('99207',f.payee_zip) assert_equal('P2008',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20080308',f.expenditure_date) assert_equal('9920.00',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Advertising - 1800 yard signs',f.expenditure_purpose_description) assert_equal('004',f.expenditure_category_code) break end end end |
#test_v62 ⇒ Object
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/tests/sbtest.rb', line 285 def test_v62 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.2"]) h.process(@testfiles["6.2"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17C0031053280507.E8753ORGOffice Depot401 Carroll StreetFort WorthTX76107 20080401151.53Office SuppliesXMEMO: OFFICE SUPPLIES assert_equal('C00310532',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('Office Depot',f.payee_organization_name) assert_equal('401 Carroll Street',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Fort Worth',f.payee_city) assert_equal('TX',f.payee_state) assert_equal('76107 ',f.payee_zip) assert_equal('',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20080401',f.expenditure_date) assert_equal('151.53',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Office Supplies',f.expenditure_purpose_description) assert_equal('',f.expenditure_category_code) assert_equal('X', f.memo_code) assert_equal("MEMO: OFFICE SUPPLIES", f.memo_text) break end end end |
#test_v63 ⇒ Object
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/tests/sbtest.rb', line 320 def test_v63 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.3"]) h.process(@testfiles["6.3"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17C00372102B-E-21820ORGPaychex, Inc1100 Adams AvenueNorristownPA194032404P201020090206155.91Employers Payroll Tax001 assert_equal('C00372102',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('Paychex, Inc',f.payee_organization_name) assert_equal('1100 Adams Avenue',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Norristown',f.payee_city) assert_equal('PA',f.payee_state) assert_equal('194032404',f.payee_zip) assert_equal('P2010',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20090206',f.expenditure_date) assert_equal('155.91',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Employers Payroll Tax',f.expenditure_purpose_description) assert_equal('001',f.expenditure_category_code) assert_equal('', f.memo_code) assert_equal("", f.memo_text) break end end end |
#test_v64 ⇒ Object
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/tests/sbtest.rb', line 355 def test_v64 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.4"]) h.process(@testfiles["6.4"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" #SB17C0044370517-3809ORGPublic Storage1761 Adrian RdBurlingameCA94010200906171083.000.00Storage Fees001 assert_equal('C00443705',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('Public Storage',f.payee_organization_name) assert_equal('1761 Adrian Rd',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Burlingame',f.payee_city) assert_equal('CA',f.payee_state) assert_equal('94010',f.payee_zip) assert_equal('',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20090617',f.expenditure_date) assert_equal('1083.00',f.expenditure_amount) assert_equal('0.00',f.expenditure_purpose_code) assert_equal('Storage Fees',f.expenditure_category_code) break end end end |
#test_v70 ⇒ Object
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/tests/sbtest.rb', line 388 def test_v70 h = FECHell.new fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["7.0"]) h.process(@testfiles["7.0"]) do |line| schedule = line[0] values = line[1] f = FECForm.schedule_for(schedule, fec_version, values) if schedule == "SB" assert_equal('C00462721',f.committee_fecid) assert_equal('ORG',f.entity_type) assert_equal('AT&T Mobility',f.payee_organization_name) assert_equal('PO BOX 30218',f.payee_street_1) assert_equal('',f.payee_street_2) assert_equal('Los Angeles',f.payee_city) assert_equal('CA',f.payee_state) assert_equal('900300218',f.payee_zip) assert_equal('P2010',f.item_election_code) assert_equal('',f.item_election_other_description) assert_equal('20110315',f.expenditure_date) assert_equal('400.00',f.expenditure_amount) assert_equal('',f.expenditure_purpose_code) assert_equal('Paid off debt',f.expenditure_category_code) break end end end |