Sha256: 882ff79d1940484f7e553ba0363a4df3306b2e958e0f2df5fdc7eb709c38a33f

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# Copyright:: (c) Autotelik Media Ltd 2011
# Author ::   Tom Statter
# Date ::     Aug 2011
# License::   MIT
#
# Details::   Specs for Excel aspect of Active Record Loader
#
require File.dirname(__FILE__) + '/spec_helper'

require 'erb'
require 'excel_generator'

include ARLoader

describe 'Excel Generator' do

  before(:all) do
    db_connect( 'test_file' )    # , test_memory, test_mysql

    db_clear()    # todo read up about proper transactional fixtures


    @klazz = Project
    @assoc_klazz = Category
  end
  
  before(:each) do
    MethodMapper.clear
    MethodMapper.find_operators( @klazz )
    MethodMapper.find_operators( @assoc_klazz )
  end
  
  it "should be able to create a new excel generator" do
    generator = ExcelGenerator.new( )
  end
  
  it "should export a simple model to .xls spreedsheet" do

    expect= $fixture_path + '/simple_export_spec.xls'

    begin FileUtils.rm(expect); rescue; end
  
    gen = ExcelGenerator.new
    
    gen.generate(@klazz, expect)
 
    File.exists?(expect).should be_true

  end

  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ar_loader-1.0.0.0 spec/excel_generator_spec.rb
ar_loader-9.9.9 spec/excel_generator_spec.rb