Sha256: 50563024daa311ab94ab8a673857e1be4fc8aac6b27648a2d780189840bf49c2
Contents?: true
Size: 919 Bytes
Versions: 62
Compression:
Stored size: 919 Bytes
Contents
require 'test_helper' module Workarea module Reports class ExportTest < TestCase def test_email_validation export = Export.new(emails_list: 'bcrouse@weblinc.com, foo') refute(export.valid?) assert(export.errors[:emails].present?) end def test_process export = Export.new( report_type: 'sales_by_product', report_params: { sort_by: 'orders' }, emails: %w(bcrouse@workarea.com) ) export.process! { |csv| csv << %w(foo bar baz) } assert(export.started_at.present?) assert(export.file.present?) assert(export.completed_at.present?) results = CSV.parse(export.file.data) assert_equal(1, results.size) assert_equal('foo', results.first.first) assert_equal('bar', results.first.second) assert_equal('baz', results.first.third) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems