Sha256: 788aa1baa7136d1976fc65b3ab23114e91f19671cf45e03a70fcd42119ea6f01

Contents?: true

Size: 1.51 KB

Versions: 11

Compression:

Stored size: 1.51 KB

Contents

$:.reject! { |e| e.include? 'TextMate' }
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
gem 'muck-engine'
require 'mocha'
require 'muck_test_helper'
require 'muck_commerce_test_helper'
require 'authlogic/test_case'

class ActiveSupport::TestCase
  include MuckTestMethods
  include Authlogic::TestCase
  
  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures  = true
  
  def ensure_flash(val)
    assert_contains flash.values, val, ", Flash: #{flash.inspect}"
  end
  
end

def credit_card_hash(options = {})
  { :number => '1',
    :first_name => 'test',
    :last_name => 'guy',
    :month => '1',
    :year => "#{ Time.now.year + 1 }",
    :verification_value => '123',
    :type => 'visa'}.update(options)
end

def address(options = {})
  { :name => 'Test Guy',
    :address1 => '250 N 540 E',
    :address2 => 'Suite 1',
    :city => 'Chicago',
    :state => 'IL',
    :country => 'US',
    :zip => ''}.update(options)
end

def billing_params(options = {})
  { :first_name => 'test', 
    :last_name => 'guy',
    :address1 => '33 commerce way',
    :city => 'San Jose',
    :state_id => Factory(:state).id,
    :postal_code => 99999,
    :country_id => Factory(:country).id,
    :telephone => '777-777-7777',
    :payment_method => GlobalConfig.payment_methods[0][1],
    :credit_card_type => 'bogus',
    :credit_card_number => '1',
    :verification_value => '999',
    :credit_card_expiration => Time.now }.merge(options)
end

include ActiveMerchant::Billing

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
muck-commerce-0.2.8 test/rails_root/test/test_helper.rb
muck-commerce-0.2.7 test/rails_root/test/test_helper.rb
muck-commerce-0.2.6 test/rails_root/test/test_helper.rb
muck-commerce-0.2.5 test/rails_root/test/test_helper.rb
muck-commerce-0.2.4 test/rails_root/test/test_helper.rb
muck-commerce-0.2.3 test/rails_root/test/test_helper.rb
muck-commerce-0.2.2 test/rails_root/test/test_helper.rb
muck-commerce-0.2.1 test/rails_root/test/test_helper.rb
muck-commerce-0.2.0 test/rails_root/test/test_helper.rb
muck-commerce-0.1.9 test/rails_root/test/test_helper.rb
muck-commerce-0.1.8 test/rails_root/test/test_helper.rb