diff --git a/lib/fech/filing.rb b/lib/fech/filing.rb index b01cf27..2fe96b2 100644 --- a/lib/fech/filing.rb +++ b/lib/fech/filing.rb @@ -246,7 +246,7 @@ def file_path # The raw contents of the Filing def file_contents - File.open(file_path, 'r') + File.open(file_path, "r:#{@encoding}") end # Determine the form type of the filing diff --git a/spec/data/1247604.fec b/spec/data/1247604.fec new file mode 100644 index 0000000..e739c7b --- /dev/null +++ b/spec/data/1247604.fec @@ -0,0 +1,58 @@ +HDRFEC8.2FECfile8.2.0.0(f31) +F3NC00670364Friends of Susan BoserP.O. Box 2056IndianaPA15701PA15Q22018042620180630BradyDavidMr.2018071519909.080.0019909.0835056.580.0035056.582801.190.0020500.0010047.916555.0316602.940.00591.492714.6519909.080.006500.000.006500.000.000.0026409.0835056.580.000.000.000.000.000.000.000.000.0035056.5811448.6926409.0837857.7735056.582801.1922904.830.0022904.8344376.830.0044376.8311557.378041.3219598.690.00591.492714.6522904.830.0020500.000.0020500.000.000.0043404.8344376.830.000.000.000.000.000.000.000.000.0044376.83 +SA11AIC00670364SA11AI.4279INDAaronRoger339 Liberty StreetFranklinPA16323G201820180522250.00250.00Check received by mailUnknownUnknown +SA11AIC00670364SA11AI.4291INDArmbrustGary225 Heasley Hollow RoadVandergriftPA15690P201820180510150.00300.00Check received by mailSelfAttorney +SA11AIC00670364SA11AI.4532CANBoserBoserLMrs.830 White Farm RdIndianaPA15701G2018201806301078.0124292.66In-kind - Car Expenses - IRS rate @$0.55Pennsylvania State Higher EdProfessorH8PA09065BoserBoserLMrs.HPA15 +SA11AIC00670364SA11AI.4266INDBradwickFaye634 Willow AveIndianaPA15701P201820180429300.00400.00Check received at house partyRetiredRetired +SA11AIC00670364SA11AI.4351INDBradyDavidMr.830 White Farm RdIndianaPA15701P20182018051550.001059.46In-kind - Snacks fo Election NightWescoDir Supply Chain +SA11AIC00670364SA11AI.4353INDBradyDavidMr.830 White Farm RdIndianaPA15701G20182018051620.271079.73In-kind - Facebook adWescoDir Supply Chain +SA11AIC00670364SA11AI.4411INDBradyDavidMr.830 White Farm RdIndianaPA15701G201820180608250.261329.99In-kind - WIX Email AccuntsWescoDir Supply Chain +SA11AIC00670364SA11AI.4412INDBradyDavidMr.830 White Farm RdIndianaPA15701G20182018061224.991354.98In-kind - Facebook AdWescoDir Supply Chain +SA11AIC00670364SA11AI.4413INDBradyDavidMr.830 White Farm RdIndianaPA15701G20182018061516.381371.36In-kind - Facebook AdWescoDir Supply Chain +SA11AIC00670364SA11AI.4465INDBrownMargaret106 Sumar Rd.St. Mary'sPA15857G201820180626500.00500.00ACT BlueUniversity of PittsburghProfessor +SA11AIC00670364SA11AI.4467INDBrownMargaret106 Sumar Rd.St. Mary'sPA15857G201820180626500.001000.00ACT BlueUniversity of PittsburghProfessor +SA11AIC00670364SA11AI.4330INDFeldmanLarry649 Shryock Ave.IndianaPA15701G201820180520200.00250.00Act BlueRetiredRetired +SA11AIC00670364SA11AI.4461INDHartleyHarold60 Stonehedge CircleBrookvillePA15825G201820180624250.00250.00ACT BlueRetiredRetired +SA11AIC00670364SA11AI.4447INDIntemannGerald453 Cheese Run RoadIndianaPA15701G201820180617100.00250.00ACT BlueRetiredRetired +SA11AIC00670364SA11AI.4254INDKlainMatthew1795 Barkley RdClarksburgPA15725P201820180428250.00250.00Check from home eventIRMCPhysician +SA11AIC00670364SA11AI.4456INDLongStacy1900 Mumau RoadGlenn CampbellPA15742G201820180626208.00208.00In-kind - Graphic Design - LogoCats Up GraphicsOwner +SA11AIC00670364SA11AI.4430INDPerlowCharles310 Grant StreetSuite 2500PittsburghPA15219G2018201806181000.001000.00Check received from CallsMcKnight Reality PartnersLawyer +SA11AIC00670364SA11AI.4420INDRoseJonathan33 Katonah AveKatonahNY10536G2018201806012500.002500.00Check ReceivedSelfProperty Devleopment +SA11AIC00670364SA11AI.4310INDSteelmanSarah220 N 6th StIndianaPA15701P201820180508500.00500.00Act BlueRetiredNone +SA11AIC00670364SA11AI.4328INDSuttieJill988 Creston RoadBerkleyCA94708G201820180518250.00250.00Act BlueSelfWriter/editor +SA11AIC00670364SA11AI.4444INDWheatleySusan1107 ray roadPenn RunPA15765G201820180616150.00250.00ACT BlueRetiredRetired +SA11AIC00670364SA11AI.4497INDWheelerSarah870 Harvest LaneIndianaPA15701G201820180617500.00500.00Check ReceivedRetiredRetired +SA11AIC00670364SA11AI.4432INDWilcoxMichel1172 Old Route 322CochrantonoPA16314G2018201806211000.001000.00Check received at Oil Region Rising eventRetiredRetired +SA11CC00670364SA11C.4357PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G2018201805233.373.37Check Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4359PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G201820180523136.66140.03Check Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4360PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G20182018052316.70156.73Check Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4361PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G2018201805230.92157.65Check Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4362PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G201820180523406.54564.19Check Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4524PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G2018201806047.93572.12Received by MailC00630012It Starts Today +SA11CC00670364SA11C.4422PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G20182018061112.78584.90Check ReceiptC00630012It Starts Today +SA11CC00670364SA11C.4523PACIt Starts Today237 Florida Avenue NWWashingtonDC20001G2018201806186.59591.49Received by MailC00630012It Starts Today +SA11DC00670364SA11D.4364CANBoserBoserLMrs.830 White Farm RdIndianaPA15701G2018201805312714.6523214.65In-kind - Mileage at IRS rate for campaign travelPennsylvania State Higher EdProfessorH8PA09065BoserBoserLMrs.HPA15 +SA13AC00670364SA13A.4349CANBoserBoserLMrs.830 White Farm RdIndianaPA15701P2018201805022500.0016500.00Personal LoanPennsylvania State Higher EdProfessorH8PA09065BoserBoserLMrs.HPA15 +SA13AC00670364SA13A.4350CANBoserBoserLMrs.830 White Farm RdIndianaPA15701P2018201805034000.0020500.00Personal LoanPennsylvania State Higher EdProfessorH8PA09065BoserBoserLMrs.HPA15 +SB17C00670364SB17.4196ORGAmpersand Consulting4105 Penn AvenuePittsburghPA15224P2018201804277740.00Mail Piece preparation001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4201ORGAmpersand Consulting4105 Penn AvenuePittsburghPA15224P2018201805026824.62Postage - Mail piece004C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4202ORGAmpersand Consulting4105 Penn AvenuePittsburghPA15224P2018201805033950.00Radio Advertising - Creation and Airtime004C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4437ORGAmpersand Consulting4105 Penn AvenuePittsburghPA15224G2018201806056000.00Payment for Fund Raising Consulting003C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4365CANBoserBoserLMrs.830 White Farm RdIndianaPA15701G2018201805312714.65In-kind - Mileage at IRS rate for campaign travelH8PA09065HPA15 +SB17C00670364SB17.4533CANBoserBoserLMrs.830 White Farm RdIndianaPA15701G2018201806301078.01In-kind - Car Expenses - IRS rate @$0.55H8PA09065HPA15 +SB17C00670364SB17.4416INDBradyDavidMr.830 White Farm RdIndianaPA15701G201820180608250.26In-kind - WIX Email Accunts +SB17C00670364SB17.4415INDBradyDavidMr.830 White Farm RdIndianaPA15701G20182018061224.99In-kind - Facebook Ad +SB17C00670364SB17.4414INDBradyDavidMr.830 White Farm RdIndianaPA15701G20182018061516.38In-kind - Facebook Ad +SB17C00670364SB17.4199INDCampbellCallie123 Charles DriveCamillusNY13031P201820180429210.00Campaign Work Various001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4206INDCampbellCallie123 Charles DriveCamillusNY13031P201820180518160.00Campaign Work001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4204INDGuerraChelsea104 Greenview DriveIndianaPA15701P201820180515250.00Campaign Work001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4205INDHorvathElliePO Box 2Tire HillPA15959P201820180515840.00Campaign Work001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4458INDLongStacy1900 Mumau RoadGlenn CampbellPA15742G201820180626208.00In-kind - Graphic Design - Logo +SB17C00670364SB17.4203ORGPrint and Copy Center731 Allegheny BlvdIndianaPA15701P201820180503179.76Printing004C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4409ORGPrint and Copy Center731 Allegheny BlvdIndianaPA15701G201820180611873.12Literature and Buttons004C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4207INDStenmanAmber415 Pearl StPittsburghPA15224P2018201805261600.00Campaign Work - Labor001C00670364Friends of Susan BoserHPA15 +SB17C00670364SB17.4496INDStenmanAmber415 Pearl StPittsburghPA15224G2018201806291516.67Campaign Manager - Contract Rate001C00670364Friends of Susan BoserHPA15 +SC/10C00670364SC/10.424513ACANBoserBoserLMrs.830 White Farm RdIndianaPA15701P20182000.000.002000.002018042112/31/20180.0000NYH8PA09065BoserBoserLMrs.HPA15 +SC/10C00670364SC/10.424713ACANBoserBoserLMrs.830 White Farm RdIndianaPA15701P201812000.000.0012000.002018042512/31/20180.0000NYH8PA09065BoserBoserLMrs.HPA15 +SC/10C00670364SC/10.434913ACANBoserBoserLMrs.830 White Farm RdIndianaPA15701P20182500.000.002500.002018050212/31/20180.0000NYH8PA09065BoserBoserLMrs.HPA15 +SC/10C00670364SC/10.435013ACANBoserBoserLMrs.830 White Farm RdIndianaPA15701P20184000.000.004000.002018050312/31/20180.0000NYH8PA09065BoserBoserLMrs.HPA15 diff --git a/spec/filing_spec.rb b/spec/filing_spec.rb index 0baf144..345d791 100644 --- a/spec/filing_spec.rb +++ b/spec/filing_spec.rb @@ -27,6 +27,8 @@ @filing_special_character.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '771694.fec')) @filing_f99 = Fech::Filing.new(862554) @filing_f99.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '862554.fec')) + @filing_encoding = Fech::Filing.new(1247604) + @filing_encoding.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '1247604.fec')) end describe "#filing_version" do @@ -83,6 +85,7 @@ sum_f13[:form_type].should == 'F13N' sum_filing_special_character = @filing_special_character.summary sum_filing_special_character[:form_type].should == "F3XN" + expect{@filing_encoding.summary}.to_not raise_error end end