Skip to content

Instantly share code, notes, and snippets.

View cmar's full-sized avatar

Chris Mar cmar

  • CustomInk
  • Northern, VA
  • X @cmar
View GitHub Profile
@cmar
cmar / gist:2776742
Created May 23, 2012 18:08
TaxCloud Test Script
require "savon"
cart_id = rand(9999)
order_id = rand(9999)
api_login_id = '1B3D4440'
api_key = '77CE20A3-0805-4A3D-BF36-AD7FC4D39BA0'
# create a client for your SOAP service
client = Savon::Client.new("https://api.taxcloud.net/1.0/?wsdl")
puts client.wsdl.soap_actions
{"name":"awesomeshop-37722","cmd":"cd /data/spree/current && bundle exec rake spree_shared:bootstrap['awesomeshop-37722']","output":"Creating database: awesomeshop-37722\nLoading seed & sample data into database: awesomeshop-37722\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/core/db/default/spree/countries.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/core/db/default/spree/roles.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/core/db/default/spree/states.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/core/db/default/spree/zone_members.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/core/db/default/spree/zones.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-27bca97223aa/sample/lib/tasks/../../db/sample/spree/addresses.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.
{"name":"awesomeshop-39311","cmd":"cd /data/spree/current && bundle exec rake spree_shared:bootstrap['awesomeshop-39311']","output":"Creating database: awesomeshop-39311\nLoading seed & sample data into database: awesomeshop-39311\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/core/db/default/spree/countries.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/core/db/default/spree/roles.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/core/db/default/spree/states.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/core/db/default/spree/zone_members.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/core/db/default/spree/zones.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-7f458cf6f9f6/sample/lib/tasks/../../db/sample/spree/addresses.yml\nloading fixture /data/spree/shared/bundle/ruby/1.9.
FactoryGirl.define do
factory :user do
first_name "Fox"
last_name "Mulder"
sequence(:email) { |n| "fox#{n}@xfiles.com"}
password "XXXXX111111"
factory :admin do |admin|
admin.after_create { |admin| admin.roles << Factory(:admin_role) }
end
require 'spree_shared/apartment_elevator'
require 'action_dispatch'
require 'rails/rack/logger'
module Apartment
module Elevators
describe Subdomain do
before do
@env = double("env")
Spree::BaseController.class_eval do
ENV['DEFAULT_HTTPS_HOST'] = 'spreeworks.dev'
ENV['DEFAULT_HTTP_HOST'] = 'spreebeta.dev'
protected
def https_redirect_url
redirect_url_with_session('https', "#{ENV['RAILS_CACHE_ID']}.#{ENV['DEFAULT_HTTPS_HOST']}")
end
➜ spree_multi_db rake "spree_shared:bootstrap[store2]" @13b60b5(1.9.3@multi_db)
Did not trace ActionView::Template#rails_initialize because that method does not exist
[DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported
Creating database: store2
Loading seed & sample data into database: store2
loading fixture /Users/cmar/.rvm/gems/ruby-1.9.3-p125@multi_db/bundler/gems/spree-95e6866064f7/sample/lib/tasks/../../db/sample/spree/addresses.yml
loading fixture /Users/cmar/.rvm/gems/ruby-1.9.3-p125@multi_db/bundler/gems/spree-95e6866064f7/sample/lib/tasks/../../db/sample/spree/adjustments.yml
loading fixture /Users/cmar/.rvm/gems/ruby-1.9.3-p125@multi_db/bundler/gems/spree-95e6866064f7/sample/lib/tasks/../../db/sample/spree/assets.yml
loading fixture /Users/cmar/.rvm/gems/ruby-1.9.3-p125@multi_db/bundler/gems/spree-95e6866064f7/sample/lib/
require 'spree/core/preference_rescue'
class NamespacePromoTables < ActiveRecord::Migration
def concat(str1, str2)
dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym
case dbtype
when :mysql, :mysql2
"CONCAT(#{str1}, #{str2})"
require 'spree/core/preference_rescue'
class NewPreferences < ActiveRecord::Migration
def up
add_column :spree_preferences, :key, :string
add_column :spree_preferences, :value_type, :string
add_index :spree_preferences, :key, :unique => true
remove_index :spree_preferences, :name => 'ix_prefs_on_owner_attr_pref'
Gemfile:
gem 'rails', '3.1.3'
gem 'spree', :git => 'https://github.com/spree/spree.git'
gem 'spree_skrill', :git => '[email protected]:spree/spree_skrill.git', :branch => 'v2'
bundle update:
Using spree_core (1.0.0.beta) from https://github.com/spree/spree.git (at master)
Using spree_auth (1.0.0.beta) from https://github.com/spree/spree.git (at master)
Using spree_api (1.0.0.beta) from https://github.com/spree/spree.git (at master)
Using spree_dash (1.0.0.beta) from https://github.com/spree/spree.git (at master)