require 'rails_helper'

describe TargetFile::<%= class_name %> do
  subject { create 'target_file/<%= file_name %>' }

  describe "#execute_generation_process" do

    it "generates the file" do
      subject.execute_generation_process

      subject.reload.should_not have_log_entries /ERROR/
      subject.should be_completed

      File.basename(subject.original_file.path).should == "<%= file_name %>-#{Date.current.to_s(:number)}.csv"

      actual_string = read_zipfile(subject.original_file.path)

      actual_string.should eq <<-EXP.strip_heredoc
        Expected content for taget file <%= file_name %>
      EXP
    end
  end
end
