spec/lib/bankserv/engine/engine_spec.rb in bankserv-0.1.7 vs spec/lib/bankserv/engine/engine_spec.rb in bankserv-0.1.8

- old
+ new

@@ -5,10 +5,11 @@ before(:all) do FileUtils.mkdir(Dir.pwd + "/spec/examples/host2host/archives") unless File.directory?(Dir.pwd + "/spec/examples/host2host/archives") FileUtils.copy(Dir.pwd + "/spec/examples/tmp/OUTPUT0412153500.txt", Dir.pwd + "/spec/examples/host2host/") FileUtils.copy(Dir.pwd + "/spec/examples/tmp/REPLY0412153000.txt", Dir.pwd + "/spec/examples/host2host/") + Bankserv::EngineConfiguration.create!(interval_in_minutes: 15, input_directory: "/tmp", output_directory: "/tmp", archive_directory: "/tmp") end after(:all) do Dir.glob(Dir.pwd + "/spec/examples/host2host/*.txt").each do |input_file| File.delete(input_file) @@ -38,10 +39,11 @@ end context "Testing individual methods of engine" do before(:all) do + create(:configuration, client_code: "986", client_name: "TESTTEST", user_code: "9999", user_generation_number: 846, client_abbreviated_name: "TESTTEST") t = Time.local(2012, 1, 23, 10, 5, 0) Timecop.travel(t) file_contents = File.open("./spec/examples/eft_input_with_2_sets.txt", "rb").read Bankserv::InputDocument.store(file_contents) @@ -97,21 +99,14 @@ end context "Processing an input document." do before(:all) do - Bankserv::Document.delete_all - Bankserv::Set.delete_all - Bankserv::Record.delete_all - Bankserv::AccountHolderVerification.delete_all - Bankserv::Debit.delete_all - Bankserv::Credit.delete_all - tear_it_down - create(:configuration, client_code: "986", client_name: "TESTTEST", user_code: "9999", user_generation_number: 846, client_abbreviated_name: "TESTTEST") - t = Time.local(2008, 8, 8, 10, 5, 0) - Timecop.travel(t) + Timecop.travel(Time.local(2008, 8, 8, 10, 5, 0)) + Bankserv::EngineConfiguration.create!(interval_in_minutes: 15, input_directory: "/tmp", output_directory: "/tmp", archive_directory: "/tmp") + create(:configuration, client_code: "986", client_name: "TESTTEST", user_code: "9999", user_generation_number: 846, client_abbreviated_name: "TESTTEST") create_credit_request Bankserv::Configuration.stub!(:live_env?).and_return(true) Bankserv::InputDocument.stub!(:fetch_next_transmission_number).and_return("846") \ No newline at end of file