Sha256: 7f068b7bf74b0f085e093d5566881ca6dedc620e3259f33652dafe8c69d22f52

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
# require 'spec'
# require 'spec/autorun'
# require 'rubygems'
#
require 'rubygems'
require 'bundler/setup'

require 'simplecov'
require 'active_record'

require 'acts_as_shopping_cart'

SimpleCov.start

#
# Required environment for the tests
#
class SomeCart < ActiveRecord::Base
  acts_as_shopping_cart_using :some_cart_item
end

class SomeCartItem < ActiveRecord::Base
  acts_as_shopping_cart_item_for :some_cart
end

class ShoppingCart < ActiveRecord::Base
  acts_as_shopping_cart
end

class ShoppingCartItem < ActiveRecord::Base
  acts_as_shopping_cart_item
end

class SomeClass < ActiveRecord::Base

end

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")

ActiveRecord::Schema.define(:version => 1) do
  create_table :some_carts do |t|
    t.float :taxes, :default => 0
    t.float :shipping_cost, :default => 0
  end

  create_table :some_classes do |t|

  end

  create_table :some_cart_items do |t|
    t.integer :owner_id
    t.string :owner_type
    t.integer :quantity
    t.integer :item_id
    t.string :item_type
    t.float :price
  end
end

RSpec.configure do |config|

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
acts_as_shopping_cart-0.0.3 spec/spec_helper.rb
acts_as_shopping_cart-0.0.2 spec/spec_helper.rb
acts_as_shopping_cart-0.0.1 spec/spec_helper.rb