spree 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/CHANGELOG +457 -425
- data/{README.markdown → README.md} +4 -0
- data/Rakefile +2 -2
- data/app/controllers/admin/adjustments_controller.rb +8 -9
- data/app/controllers/admin/checkouts_controller.rb +10 -2
- data/app/controllers/admin/line_items_controller.rb +0 -1
- data/app/controllers/admin/payments_controller.rb +8 -7
- data/app/controllers/admin/shipments_controller.rb +1 -1
- data/app/controllers/checkouts_controller.rb +16 -5
- data/app/controllers/spree/base_controller.rb +2 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/checkouts_helper.rb +1 -1
- data/app/helpers/products_helper.rb +1 -1
- data/app/helpers/taxons_helper.rb +1 -1
- data/app/models/address.rb +9 -0
- data/app/models/checkout.rb +13 -7
- data/app/models/creditcard.rb +2 -2
- data/app/models/model_cache_cleaner.rb +13 -0
- data/app/models/order.rb +6 -8
- data/app/models/payment.rb +18 -17
- data/app/models/payment_method.rb +2 -2
- data/app/models/product.rb +1 -2
- data/app/models/return_authorization.rb +3 -1
- data/app/models/shipping_method.rb +16 -6
- data/app/models/zone.rb +34 -3
- data/config/database.yml +4 -21
- data/config/environment.rb +6 -6
- data/config/environments/test.rb +1 -0
- data/config/locales/en_spree.yml +10 -9
- data/db/migrate/20100624110730_add_display_to_shipping_methods.rb +9 -0
- data/db/migrate/20100624123336_rename_payment_method_display.rb +9 -0
- data/db/sample/orders.yml +3 -3
- data/db/sample/payments.rb +6 -5
- data/db/sample/products.rb +2 -2
- data/db/schema.rb +9 -27
- data/lib/easy_role_requirement_system.rb +1 -1
- data/lib/generators/extension/extension_generator.rb +7 -22
- data/lib/generators/extension/templates/functional_test.rb +1 -1
- data/lib/generators/extension/templates/tasks.rake +2 -2
- data/lib/generators/extension_controller/extension_controller_generator.rb +1 -1
- data/lib/generators/extension_model/extension_model_generator.rb +1 -1
- data/lib/generators/instance/instance_generator.rb +24 -24
- data/lib/generators/instance/templates/instance_generate +1 -1
- data/lib/generators/theme/theme_generator.rb +6 -10
- data/lib/plugins/extension_patches/lib/asset_copy.rb +2 -2
- data/lib/spree.rb +1 -1
- data/lib/spree/initializer.rb +15 -15
- data/lib/spree/search.rb +1 -1
- data/lib/tasks/cucumber.rake +1 -1
- data/lib/tasks/extensions.rake +6 -6
- data/lib/tasks/framework.rake +1 -1
- data/lib/tasks/instance.rake +6 -6
- data/lib/validation_group.rb +16 -16
- data/script/extension +2 -2
- data/test/functional/products_controller_test.rb +13 -0
- data/test/test_helper.rb +1 -1
- data/test/unit/checkout_test.rb +18 -9
- data/vendor/extensions/README +1 -1
- data/vendor/extensions/api/Rakefile +2 -2
- data/vendor/extensions/api/lib/tasks/api_extension_tasks.rake +2 -2
- data/vendor/extensions/overview_dashboard/Rakefile +2 -2
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +5 -5
- data/vendor/extensions/overview_dashboard/lib/tasks/overview_dashboard_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/Rakefile +2 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +6 -2
- data/vendor/extensions/payment_gateway/app/models/gateway/braintree.rb +88 -0
- data/vendor/extensions/payment_gateway/config/locales/en.yml +2 -1
- data/vendor/extensions/payment_gateway/lib/active_merchant/billing/authorize_net_cim.rb +4 -2
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/lib/tasks/payment_gateway_extension_tasks.rake +2 -2
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +1 -0
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +2 -1
- data/vendor/extensions/payment_gateway/test/unit/braintree_test.rb +200 -0
- data/vendor/extensions/theme_default/Rakefile +2 -2
- data/vendor/extensions/theme_default/app/stylesheets/_buttons.less +7 -2
- data/vendor/extensions/theme_default/app/stylesheets/_colors.less +1 -1
- data/vendor/extensions/theme_default/app/stylesheets/_layout.less +7 -2
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +3 -4
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_additional_field.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_calculator_fields.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +13 -13
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/_form.html.erb +6 -0
- data/vendor/extensions/theme_default/app/views/admin/shipping_methods/index.html.erb +2 -0
- data/vendor/extensions/theme_default/app/views/checkouts/_address.html.erb +7 -9
- data/vendor/extensions/theme_default/app/views/checkouts/_payment.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +4 -4
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +36 -35
- data/vendor/extensions/theme_default/app/views/products/_thumbnails.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/shared/_head.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/states/index.js.erb +1 -1
- data/vendor/extensions/theme_default/lib/tasks/theme_default_extension_tasks.rake +2 -2
- data/vendor/extensions/theme_default/public/favicon.ico +0 -0
- data/vendor/extensions/theme_default/public/images/admin/bg/header.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/calculator.js +3 -1
- data/vendor/extensions/theme_default/public/javascripts/checkout.js +44 -18
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +29 -24
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +9 -7
- data/vendor/plugins/attribute_fu/init.rb +2 -2
- data/vendor/plugins/delegate_belongs_to/spec/spec_helper.rb +1 -1
- data/vendor/plugins/jrails/install.rb +1 -1
- data/vendor/plugins/jrails/lib/tasks/jrails.rake +2 -2
- data/vendor/plugins/jrails_auto_complete/install.rb +1 -1
- data/vendor/plugins/jrails_auto_complete/uninstall.rb +1 -1
- data/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +1 -1
- metadata +59 -659
- data/lib/generators/extension/templates/RSpecRakefile +0 -137
- data/lib/generators/extension/templates/spec.opts +0 -6
- data/lib/generators/extension/templates/spec_helper.rb +0 -37
- data/lib/generators/extension_controller/templates/controller_spec.rb +0 -23
- data/lib/generators/extension_controller/templates/helper_spec.rb +0 -11
- data/lib/generators/extension_controller/templates/view_spec.rb +0 -12
- data/lib/generators/extension_model/templates/model_spec.rb +0 -11
- data/lib/tasks/rspec.rake +0 -182
- data/public/images/add-to-cart.png +0 -0
- data/public/images/admin/bg/active-tab.png +0 -0
- data/public/images/admin/bg/admin_tab_back.png +0 -0
- data/public/images/admin/bg/admin_tab_selected_back.png +0 -0
- data/public/images/admin/bg/content-back-blue.png +0 -0
- data/public/images/admin/bg/content-back-green.png +0 -0
- data/public/images/admin/bg/content-back.png +0 -0
- data/public/images/admin/bg/flash-error.png +0 -0
- data/public/images/admin/bg/flash-notice.png +0 -0
- data/public/images/admin/bg/green-stripes.gif +0 -0
- data/public/images/admin/bg/green-stripes.png +0 -0
- data/public/images/admin/bg/grid_header_back.png +0 -0
- data/public/images/admin/bg/grid_header_back_green.png +0 -0
- data/public/images/admin/bg/header-bg.png +0 -0
- data/public/images/admin/bg/header_bg.jpg +0 -0
- data/public/images/admin/bg/menu-current.png +0 -0
- data/public/images/admin/bg/red-stripes.gif +0 -0
- data/public/images/admin/bg/red-stripes.png +0 -0
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/admin/bg/subnav-divider.png +0 -0
- data/public/images/admin/bg/subnav.png +0 -0
- data/public/images/admin/bg/tab-back.png +0 -0
- data/public/images/admin/buttons/blue/left_01.png +0 -0
- data/public/images/admin/buttons/blue/right_01.png +0 -0
- data/public/images/admin/buttons/drag-handle-green.png +0 -0
- data/public/images/admin/buttons/green/left_01.png +0 -0
- data/public/images/admin/buttons/green/right_01.png +0 -0
- data/public/images/admin/buttons/left_01.png +0 -0
- data/public/images/admin/buttons/left_01_small.png +0 -0
- data/public/images/admin/buttons/orange/left_03.png +0 -0
- data/public/images/admin/buttons/orange/right_03.png +0 -0
- data/public/images/admin/buttons/right_01.png +0 -0
- data/public/images/admin/buttons/right_01_small.png +0 -0
- data/public/images/admin/icons/16x16/1.png +0 -0
- data/public/images/admin/icons/16x16/10.png +0 -0
- data/public/images/admin/icons/16x16/2.png +0 -0
- data/public/images/admin/icons/16x16/3.png +0 -0
- data/public/images/admin/icons/16x16/4.png +0 -0
- data/public/images/admin/icons/16x16/5.png +0 -0
- data/public/images/admin/icons/16x16/6.png +0 -0
- data/public/images/admin/icons/16x16/7.png +0 -0
- data/public/images/admin/icons/16x16/8.png +0 -0
- data/public/images/admin/icons/16x16/9.png +0 -0
- data/public/images/admin/icons/32x32/1.png +0 -0
- data/public/images/admin/icons/32x32/10.png +0 -0
- data/public/images/admin/icons/32x32/11.png +0 -0
- data/public/images/admin/icons/32x32/2.png +0 -0
- data/public/images/admin/icons/32x32/3.png +0 -0
- data/public/images/admin/icons/32x32/4.png +0 -0
- data/public/images/admin/icons/32x32/5.png +0 -0
- data/public/images/admin/icons/32x32/6.png +0 -0
- data/public/images/admin/icons/32x32/7.png +0 -0
- data/public/images/admin/icons/32x32/8.png +0 -0
- data/public/images/admin/icons/32x32/9.png +0 -0
- data/public/images/admin/icons/accept.png +0 -0
- data/public/images/admin/icons/add.gif +0 -0
- data/public/images/admin/icons/add.png +0 -0
- data/public/images/admin/icons/arrow-down.gif +0 -0
- data/public/images/admin/icons/cross.png +0 -0
- data/public/images/admin/icons/delete.gif +0 -0
- data/public/images/admin/icons/delete.png +0 -0
- data/public/images/admin/icons/drag.gif +0 -0
- data/public/images/admin/icons/edit.gif +0 -0
- data/public/images/admin/icons/edit.png +0 -0
- data/public/images/admin/icons/email.png +0 -0
- data/public/images/admin/icons/error.png +0 -0
- data/public/images/admin/icons/exclamation.png +0 -0
- data/public/images/admin/icons/feed.png +0 -0
- data/public/images/admin/icons/pdf.png +0 -0
- data/public/images/admin/icons/reorder.gif +0 -0
- data/public/images/admin/icons/search.gif +0 -0
- data/public/images/admin/icons/send-email.png +0 -0
- data/public/images/admin/icons/stop.png +0 -0
- data/public/images/admin/icons/tick.png +0 -0
- data/public/images/admin/icons/up.gif +0 -0
- data/public/images/admin/icons/xls.png +0 -0
- data/public/images/admin/tabs/off-left.png +0 -0
- data/public/images/admin/tabs/off-right.png +0 -0
- data/public/images/admin/tabs/on-left.png +0 -0
- data/public/images/admin/tabs/on-right.png +0 -0
- data/public/images/ajax_loader.gif +0 -0
- data/public/images/amex_cid.gif +0 -0
- data/public/images/bg-button-hover.png +0 -0
- data/public/images/bg-button-pressed.png +0 -0
- data/public/images/bg-button.gif +0 -0
- data/public/images/bg-button.png +0 -0
- data/public/images/blue/left_01.png +0 -0
- data/public/images/blue/right_01.png +0 -0
- data/public/images/body-back.png +0 -0
- data/public/images/bottom_shine.png +0 -0
- data/public/images/breadcrumb.gif +0 -0
- data/public/images/button-dark-hover.png +0 -0
- data/public/images/button-dark.png +0 -0
- data/public/images/buttons/bg-button-hover.png +0 -0
- data/public/images/buttons/bg-button-pressed.png +0 -0
- data/public/images/buttons/bg-button.gif +0 -0
- data/public/images/buttons/bg-button.png +0 -0
- data/public/images/buttons/blue/left_01.png +0 -0
- data/public/images/buttons/blue/right_01.png +0 -0
- data/public/images/buttons/button-dark-hover.png +0 -0
- data/public/images/buttons/button-dark.png +0 -0
- data/public/images/buttons/drag-handle-green.png +0 -0
- data/public/images/buttons/green/left_01.png +0 -0
- data/public/images/buttons/green/right_01.png +0 -0
- data/public/images/buttons/left_01.png +0 -0
- data/public/images/buttons/left_01_small.png +0 -0
- data/public/images/buttons/orange/left_03.png +0 -0
- data/public/images/buttons/orange/right_03.png +0 -0
- data/public/images/buttons/right_01.png +0 -0
- data/public/images/buttons/right_01_small.png +0 -0
- data/public/images/buttons/sxsw-ribbon-v1.png +0 -0
- data/public/images/buttons/top-shine.png +0 -0
- data/public/images/calendar_date_select/calendar.gif +0 -0
- data/public/images/cart-empty.png +0 -0
- data/public/images/cart-empty_x32.png +0 -0
- data/public/images/cart-full.png +0 -0
- data/public/images/cart-full_x32.png +0 -0
- data/public/images/checkout.png +0 -0
- data/public/images/creditcard.gif +0 -0
- data/public/images/datepicker/backstripes.gif +0 -0
- data/public/images/datepicker/bg_header.jpg +0 -0
- data/public/images/datepicker/bullet1.gif +0 -0
- data/public/images/datepicker/bullet2.gif +0 -0
- data/public/images/datepicker/cal.gif +0 -0
- data/public/images/datepicker/gradient-e5e5e5-ffffff.gif +0 -0
- data/public/images/discover_cid.gif +0 -0
- data/public/images/drag-handle-green.png +0 -0
- data/public/images/flags/ad.png +0 -0
- data/public/images/flags/ae.png +0 -0
- data/public/images/flags/af.png +0 -0
- data/public/images/flags/ag.png +0 -0
- data/public/images/flags/ai.png +0 -0
- data/public/images/flags/al.png +0 -0
- data/public/images/flags/am.png +0 -0
- data/public/images/flags/an.png +0 -0
- data/public/images/flags/ao.png +0 -0
- data/public/images/flags/ar.png +0 -0
- data/public/images/flags/as.png +0 -0
- data/public/images/flags/at.png +0 -0
- data/public/images/flags/au.png +0 -0
- data/public/images/flags/aw.png +0 -0
- data/public/images/flags/ax.png +0 -0
- data/public/images/flags/az.png +0 -0
- data/public/images/flags/ba.png +0 -0
- data/public/images/flags/bb.png +0 -0
- data/public/images/flags/bd.png +0 -0
- data/public/images/flags/be.png +0 -0
- data/public/images/flags/bf.png +0 -0
- data/public/images/flags/bg.png +0 -0
- data/public/images/flags/bh.png +0 -0
- data/public/images/flags/bi.png +0 -0
- data/public/images/flags/bj.png +0 -0
- data/public/images/flags/bm.png +0 -0
- data/public/images/flags/bn.png +0 -0
- data/public/images/flags/bo.png +0 -0
- data/public/images/flags/br.png +0 -0
- data/public/images/flags/bs.png +0 -0
- data/public/images/flags/bt.png +0 -0
- data/public/images/flags/bv.png +0 -0
- data/public/images/flags/bw.png +0 -0
- data/public/images/flags/by.png +0 -0
- data/public/images/flags/bz.png +0 -0
- data/public/images/flags/ca.png +0 -0
- data/public/images/flags/catalonia.png +0 -0
- data/public/images/flags/cc.png +0 -0
- data/public/images/flags/cd.png +0 -0
- data/public/images/flags/cf.png +0 -0
- data/public/images/flags/cg.png +0 -0
- data/public/images/flags/ch.png +0 -0
- data/public/images/flags/ci.png +0 -0
- data/public/images/flags/ck.png +0 -0
- data/public/images/flags/cl.png +0 -0
- data/public/images/flags/cm.png +0 -0
- data/public/images/flags/cn.png +0 -0
- data/public/images/flags/co.png +0 -0
- data/public/images/flags/cr.png +0 -0
- data/public/images/flags/cs.png +0 -0
- data/public/images/flags/cu.png +0 -0
- data/public/images/flags/cv.png +0 -0
- data/public/images/flags/cx.png +0 -0
- data/public/images/flags/cy.png +0 -0
- data/public/images/flags/cz.png +0 -0
- data/public/images/flags/da.png +0 -0
- data/public/images/flags/de.png +0 -0
- data/public/images/flags/de_CH.png +0 -0
- data/public/images/flags/dj.png +0 -0
- data/public/images/flags/dm.png +0 -0
- data/public/images/flags/do.png +0 -0
- data/public/images/flags/dz.png +0 -0
- data/public/images/flags/ec.png +0 -0
- data/public/images/flags/ee.png +0 -0
- data/public/images/flags/eg.png +0 -0
- data/public/images/flags/eh.png +0 -0
- data/public/images/flags/england.png +0 -0
- data/public/images/flags/er.png +0 -0
- data/public/images/flags/es.png +0 -0
- data/public/images/flags/et.png +0 -0
- data/public/images/flags/europeanunion.png +0 -0
- data/public/images/flags/fam.png +0 -0
- data/public/images/flags/fi.png +0 -0
- data/public/images/flags/fj.png +0 -0
- data/public/images/flags/fk.png +0 -0
- data/public/images/flags/fm.png +0 -0
- data/public/images/flags/fo.png +0 -0
- data/public/images/flags/fr.png +0 -0
- data/public/images/flags/ga.png +0 -0
- data/public/images/flags/gb.png +0 -0
- data/public/images/flags/gd.png +0 -0
- data/public/images/flags/ge.png +0 -0
- data/public/images/flags/gf.png +0 -0
- data/public/images/flags/gh.png +0 -0
- data/public/images/flags/gi.png +0 -0
- data/public/images/flags/gl.png +0 -0
- data/public/images/flags/gm.png +0 -0
- data/public/images/flags/gn.png +0 -0
- data/public/images/flags/gp.png +0 -0
- data/public/images/flags/gq.png +0 -0
- data/public/images/flags/gr.png +0 -0
- data/public/images/flags/gs.png +0 -0
- data/public/images/flags/gt.png +0 -0
- data/public/images/flags/gu.png +0 -0
- data/public/images/flags/gw.png +0 -0
- data/public/images/flags/gy.png +0 -0
- data/public/images/flags/hk.png +0 -0
- data/public/images/flags/hm.png +0 -0
- data/public/images/flags/hn.png +0 -0
- data/public/images/flags/hr.png +0 -0
- data/public/images/flags/ht.png +0 -0
- data/public/images/flags/hu.png +0 -0
- data/public/images/flags/id.png +0 -0
- data/public/images/flags/ie.png +0 -0
- data/public/images/flags/il.png +0 -0
- data/public/images/flags/in.png +0 -0
- data/public/images/flags/io.png +0 -0
- data/public/images/flags/iq.png +0 -0
- data/public/images/flags/ir.png +0 -0
- data/public/images/flags/is.png +0 -0
- data/public/images/flags/it.png +0 -0
- data/public/images/flags/jm.png +0 -0
- data/public/images/flags/jo.png +0 -0
- data/public/images/flags/jp.png +0 -0
- data/public/images/flags/ke.png +0 -0
- data/public/images/flags/kg.png +0 -0
- data/public/images/flags/kh.png +0 -0
- data/public/images/flags/ki.png +0 -0
- data/public/images/flags/km.png +0 -0
- data/public/images/flags/kn.png +0 -0
- data/public/images/flags/kp.png +0 -0
- data/public/images/flags/kr.png +0 -0
- data/public/images/flags/kw.png +0 -0
- data/public/images/flags/ky.png +0 -0
- data/public/images/flags/kz.png +0 -0
- data/public/images/flags/la.png +0 -0
- data/public/images/flags/lb.png +0 -0
- data/public/images/flags/lc.png +0 -0
- data/public/images/flags/li.png +0 -0
- data/public/images/flags/lk.png +0 -0
- data/public/images/flags/lr.png +0 -0
- data/public/images/flags/ls.png +0 -0
- data/public/images/flags/lt.png +0 -0
- data/public/images/flags/lu.png +0 -0
- data/public/images/flags/lv.png +0 -0
- data/public/images/flags/ly.png +0 -0
- data/public/images/flags/ma.png +0 -0
- data/public/images/flags/mc.png +0 -0
- data/public/images/flags/md.png +0 -0
- data/public/images/flags/me.png +0 -0
- data/public/images/flags/mg.png +0 -0
- data/public/images/flags/mh.png +0 -0
- data/public/images/flags/mk.png +0 -0
- data/public/images/flags/ml.png +0 -0
- data/public/images/flags/mm.png +0 -0
- data/public/images/flags/mn.png +0 -0
- data/public/images/flags/mo.png +0 -0
- data/public/images/flags/mp.png +0 -0
- data/public/images/flags/mq.png +0 -0
- data/public/images/flags/mr.png +0 -0
- data/public/images/flags/ms.png +0 -0
- data/public/images/flags/mt.png +0 -0
- data/public/images/flags/mu.png +0 -0
- data/public/images/flags/mv.png +0 -0
- data/public/images/flags/mw.png +0 -0
- data/public/images/flags/mx.png +0 -0
- data/public/images/flags/my.png +0 -0
- data/public/images/flags/mz.png +0 -0
- data/public/images/flags/na.png +0 -0
- data/public/images/flags/nc.png +0 -0
- data/public/images/flags/ne.png +0 -0
- data/public/images/flags/nf.png +0 -0
- data/public/images/flags/ng.png +0 -0
- data/public/images/flags/ni.png +0 -0
- data/public/images/flags/nl.png +0 -0
- data/public/images/flags/no.png +0 -0
- data/public/images/flags/np.png +0 -0
- data/public/images/flags/nr.png +0 -0
- data/public/images/flags/nu.png +0 -0
- data/public/images/flags/nz.png +0 -0
- data/public/images/flags/om.png +0 -0
- data/public/images/flags/pa.png +0 -0
- data/public/images/flags/pe.png +0 -0
- data/public/images/flags/pf.png +0 -0
- data/public/images/flags/pg.png +0 -0
- data/public/images/flags/ph.png +0 -0
- data/public/images/flags/pk.png +0 -0
- data/public/images/flags/pl.png +0 -0
- data/public/images/flags/pm.png +0 -0
- data/public/images/flags/pn.png +0 -0
- data/public/images/flags/pr.png +0 -0
- data/public/images/flags/ps.png +0 -0
- data/public/images/flags/pt.png +0 -0
- data/public/images/flags/pw.png +0 -0
- data/public/images/flags/py.png +0 -0
- data/public/images/flags/qa.png +0 -0
- data/public/images/flags/re.png +0 -0
- data/public/images/flags/ro.png +0 -0
- data/public/images/flags/rs.png +0 -0
- data/public/images/flags/ru.png +0 -0
- data/public/images/flags/rw.png +0 -0
- data/public/images/flags/sa.png +0 -0
- data/public/images/flags/sb.png +0 -0
- data/public/images/flags/sc.png +0 -0
- data/public/images/flags/scotland.png +0 -0
- data/public/images/flags/sd.png +0 -0
- data/public/images/flags/se.png +0 -0
- data/public/images/flags/sg.png +0 -0
- data/public/images/flags/sh.png +0 -0
- data/public/images/flags/si.png +0 -0
- data/public/images/flags/sj.png +0 -0
- data/public/images/flags/sk.png +0 -0
- data/public/images/flags/sl.png +0 -0
- data/public/images/flags/sm.png +0 -0
- data/public/images/flags/sn.png +0 -0
- data/public/images/flags/so.png +0 -0
- data/public/images/flags/sr.png +0 -0
- data/public/images/flags/st.png +0 -0
- data/public/images/flags/sv.png +0 -0
- data/public/images/flags/sy.png +0 -0
- data/public/images/flags/sz.png +0 -0
- data/public/images/flags/tc.png +0 -0
- data/public/images/flags/td.png +0 -0
- data/public/images/flags/tf.png +0 -0
- data/public/images/flags/tg.png +0 -0
- data/public/images/flags/th.png +0 -0
- data/public/images/flags/tj.png +0 -0
- data/public/images/flags/tk.png +0 -0
- data/public/images/flags/tl.png +0 -0
- data/public/images/flags/tm.png +0 -0
- data/public/images/flags/tn.png +0 -0
- data/public/images/flags/to.png +0 -0
- data/public/images/flags/tr.png +0 -0
- data/public/images/flags/tt.png +0 -0
- data/public/images/flags/tv.png +0 -0
- data/public/images/flags/tw.png +0 -0
- data/public/images/flags/tz.png +0 -0
- data/public/images/flags/ua.png +0 -0
- data/public/images/flags/ug.png +0 -0
- data/public/images/flags/um.png +0 -0
- data/public/images/flags/us.png +0 -0
- data/public/images/flags/uy.png +0 -0
- data/public/images/flags/uz.png +0 -0
- data/public/images/flags/va.png +0 -0
- data/public/images/flags/vc.png +0 -0
- data/public/images/flags/ve.png +0 -0
- data/public/images/flags/vg.png +0 -0
- data/public/images/flags/vi.png +0 -0
- data/public/images/flags/vn.png +0 -0
- data/public/images/flags/vu.png +0 -0
- data/public/images/flags/wales.png +0 -0
- data/public/images/flags/wf.png +0 -0
- data/public/images/flags/ws.png +0 -0
- data/public/images/flags/ye.png +0 -0
- data/public/images/flags/yt.png +0 -0
- data/public/images/flags/za.png +0 -0
- data/public/images/flags/zm.png +0 -0
- data/public/images/flags/zw.png +0 -0
- data/public/images/green/left_01.png +0 -0
- data/public/images/green/right_01.png +0 -0
- data/public/images/grid.png +0 -0
- data/public/images/left_01.png +0 -0
- data/public/images/left_01_small.png +0 -0
- data/public/images/master_cid.jpg +0 -0
- data/public/images/menu-current.png +0 -0
- data/public/images/menu-hover.png +0 -0
- data/public/images/noimage/mini.jpg +0 -0
- data/public/images/noimage/product.jpg +0 -0
- data/public/images/noimage/small.jpg +0 -0
- data/public/images/openid-inputicon.gif +0 -0
- data/public/images/orange/left_03.png +0 -0
- data/public/images/orange/right_03.png +0 -0
- data/public/images/progress.gif +0 -0
- data/public/images/rails.png +0 -0
- data/public/images/right_01.png +0 -0
- data/public/images/right_01_small.png +0 -0
- data/public/images/separator.png +0 -0
- data/public/images/shadow-top.png +0 -0
- data/public/images/shadow_top.png +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/images/spree.jpg +0 -0
- data/public/images/spree/progress.gif +0 -0
- data/public/images/spree/spinner.gif +0 -0
- data/public/images/spree/spree.jpg +0 -0
- data/public/images/step-progress/completed-completed.gif +0 -0
- data/public/images/step-progress/completed-current.gif +0 -0
- data/public/images/step-progress/completed-first.gif +0 -0
- data/public/images/step-progress/current-first.gif +0 -0
- data/public/images/step-progress/current-incomplete.gif +0 -0
- data/public/images/step-progress/current-right.gif +0 -0
- data/public/images/step-progress/incomplete-incomplete.gif +0 -0
- data/public/images/step-progress/incomplete-right.gif +0 -0
- data/public/images/steps/1.png +0 -0
- data/public/images/steps/1_small.png +0 -0
- data/public/images/steps/2.png +0 -0
- data/public/images/steps/2_small.png +0 -0
- data/public/images/steps/3.png +0 -0
- data/public/images/steps/3_small.png +0 -0
- data/public/images/steps/4.png +0 -0
- data/public/images/steps/4_small.png +0 -0
- data/public/images/steps/5.png +0 -0
- data/public/images/steps/5_small.png +0 -0
- data/public/images/steps/6.png +0 -0
- data/public/images/steps/6_small.png +0 -0
- data/public/images/sxsw-ribbon-v1.png +0 -0
- data/public/images/tab_bottom.gif +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/images/top-shine.png +0 -0
- data/public/images/tree-nav-icons/bullet.gif +0 -0
- data/public/images/tree-nav-icons/minus.gif +0 -0
- data/public/images/tree-nav-icons/plus.gif +0 -0
- data/public/images/tree-nav-icons/treeview-loading.gif +0 -0
- data/public/images/tree-nav-icons/treeview-sprite.gif +0 -0
- data/public/images/update.png +0 -0
- data/public/images/visa_cid.gif +0 -0
- data/public/images/wrapper-back-2.png +0 -0
- data/public/images/wrapper-back.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator.png +0 -0
- data/public/images/yui-menubaritem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-menuitem_checkbox.png +0 -0
- data/public/images/yui-menuitem_checkbox_disabled.png +0 -0
- data/public/images/yui-menuitem_submenuindicator.png +0 -0
- data/public/images/yui-menuitem_submenuindicator_disabled.png +0 -0
- data/public/images/yui-sprite.png +0 -0
- data/public/javascripts/additional-methods.js +0 -236
- data/public/javascripts/admin/address_states.js +0 -25
- data/public/javascripts/admin/checkouts/edit.js +0 -129
- data/public/javascripts/admin/orders/edit.js +0 -96
- data/public/javascripts/admin/orders/edit_form.js +0 -17
- data/public/javascripts/admin/payments/new.js +0 -9
- data/public/javascripts/admin/unobtrusive_handlers.js +0 -15
- data/public/javascripts/calculator.js +0 -13
- data/public/javascripts/checkout.js +0 -65
- data/public/javascripts/dashboard.js +0 -143
- data/public/javascripts/datepicker.js +0 -1445
- data/public/javascripts/gateway.js +0 -13
- data/public/javascripts/jqPlot/excanvas.min.js +0 -1
- data/public/javascripts/jqPlot/jquery.jqplot.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.highlighter.min.js +0 -14
- data/public/javascripts/jqPlot/plugins/jqplot.pieRenderer.min.js +0 -14
- data/public/javascripts/jquery-1.3.2.min.js +0 -19
- data/public/javascripts/jquery-and-plugins.js +0 -36
- data/public/javascripts/jquery-ui.js +0 -188
- data/public/javascripts/jquery.alerts/images/help.gif +0 -0
- data/public/javascripts/jquery.alerts/images/important.gif +0 -0
- data/public/javascripts/jquery.alerts/images/info.gif +0 -0
- data/public/javascripts/jquery.alerts/images/title.gif +0 -0
- data/public/javascripts/jquery.alerts/jquery.alerts.css +0 -57
- data/public/javascripts/jquery.alerts/jquery.alerts.js +0 -235
- data/public/javascripts/jquery.alerts/jquery.alerts.spree.css +0 -30
- data/public/javascripts/jquery.autocomplete.min.js +0 -13
- data/public/javascripts/jquery.js +0 -19
- data/public/javascripts/jquery.suggest.js +0 -276
- data/public/javascripts/jquery.template.js +0 -255
- data/public/javascripts/jquery.validate.min.js +0 -16
- data/public/javascripts/jrails.autocomplete.js +0 -274
- data/public/javascripts/jrails.js +0 -1
- data/public/javascripts/jsTree/jquery.tree.js +0 -2058
- data/public/javascripts/jsTree/plugins/jquery.tree.contextmenu.js +0 -129
- data/public/javascripts/jsTree/themes/apple/bg.jpg +0 -0
- data/public/javascripts/jsTree/themes/apple/dot_for_ie.gif +0 -0
- data/public/javascripts/jsTree/themes/apple/icons.png +0 -0
- data/public/javascripts/jsTree/themes/apple/style.css +0 -34
- data/public/javascripts/jsTree/themes/apple/throbber.gif +0 -0
- data/public/javascripts/lang/af.js +0 -40
- data/public/javascripts/lang/ar.js +0 -50
- data/public/javascripts/lang/de.js +0 -40
- data/public/javascripts/lang/du.js +0 -40
- data/public/javascripts/lang/en.js +0 -42
- data/public/javascripts/lang/es.js +0 -41
- data/public/javascripts/lang/fi.js +0 -40
- data/public/javascripts/lang/fr.js +0 -44
- data/public/javascripts/lang/gr.js +0 -40
- data/public/javascripts/lang/he.js +0 -49
- data/public/javascripts/lang/it.js +0 -13
- data/public/javascripts/lang/nl.js +0 -40
- data/public/javascripts/lang/no.js +0 -40
- data/public/javascripts/lang/pt.js +0 -50
- data/public/javascripts/lang/ro.js +0 -40
- data/public/javascripts/lang/ru.js +0 -40
- data/public/javascripts/lang/sp.js +0 -40
- data/public/javascripts/lang/sv.js +0 -41
- data/public/javascripts/lang/ua.js +0 -40
- data/public/javascripts/localization/messages_cn.js +0 -24
- data/public/javascripts/localization/messages_cs.js +0 -23
- data/public/javascripts/localization/messages_da.js +0 -21
- data/public/javascripts/localization/messages_de.js +0 -21
- data/public/javascripts/localization/messages_es.js +0 -24
- data/public/javascripts/localization/messages_fr.js +0 -23
- data/public/javascripts/localization/messages_hu.js +0 -21
- data/public/javascripts/localization/messages_it.js +0 -26
- data/public/javascripts/localization/messages_kk.js +0 -23
- data/public/javascripts/localization/messages_nl.js +0 -23
- data/public/javascripts/localization/messages_no.js +0 -23
- data/public/javascripts/localization/messages_pl.js +0 -23
- data/public/javascripts/localization/messages_ptbr.js +0 -30
- data/public/javascripts/localization/messages_ro.js +0 -24
- data/public/javascripts/localization/messages_ru.js +0 -23
- data/public/javascripts/localization/messages_se.js +0 -23
- data/public/javascripts/localization/messages_sk.js +0 -21
- data/public/javascripts/localization/messages_tr.js +0 -24
- data/public/javascripts/localization/messages_tw.js +0 -24
- data/public/javascripts/localization/messages_ua.js +0 -24
- data/public/javascripts/nested-attribute.js +0 -25
- data/public/javascripts/open_id.js +0 -15
- data/public/javascripts/product.js +0 -49
- data/public/javascripts/spree.js +0 -53
- data/public/javascripts/taxonomy.js +0 -196
- data/public/javascripts/zone.js +0 -40
- data/public/stylesheets/admin/admin-forms.css +0 -159
- data/public/stylesheets/admin/admin-reset.css +0 -67
- data/public/stylesheets/admin/admin-tables.css +0 -39
- data/public/stylesheets/admin/admin-typography.css +0 -117
- data/public/stylesheets/admin/admin.css +0 -571
- data/public/stylesheets/admin/dashboard.css +0 -143
- data/public/stylesheets/admin/edit_checkouts.css +0 -57
- data/public/stylesheets/admin/edit_orders.css +0 -65
- data/public/stylesheets/admin/grids.css +0 -314
- data/public/stylesheets/admin/reset-fonts-grids-2-6-0.css +0 -7
- data/public/stylesheets/admin/yui-includes.css +0 -14
- data/public/stylesheets/datepicker.css +0 -263
- data/public/stylesheets/jquery.autocomplete.css +0 -48
- data/public/stylesheets/scaffold.css +0 -54
- data/public/stylesheets/screen.css +0 -1194
- data/script/autospec +0 -5
- data/script/breakpointer +0 -3
- data/script/performance/request +0 -3
- data/script/spec +0 -5
- data/script/spec_server +0 -125
- data/spec/controllers/admin/configurations_controller_spec.rb +0 -9
- data/spec/controllers/admin/mail_settings_controller_spec.rb +0 -24
- data/spec/controllers/admin/shipping_categories_controller_spec.rb +0 -10
- data/spec/controllers/admin/shipping_methods_controller_spec.rb +0 -10
- data/spec/controllers/countries_controller_spec.rb +0 -24
- data/spec/controllers/orders_controller_spec.rb +0 -35
- data/spec/controllers/products_controller_spec.rb +0 -16
- data/spec/controllers/states_controller_spec.rb +0 -18
- data/spec/controllers/taxons_controller_spec.rb +0 -18
- data/spec/fixtures/app_configurations.yml +0 -7
- data/spec/fixtures/countries.yml +0 -3
- data/spec/fixtures/gateways.yml +0 -8
- data/spec/fixtures/preferences.yml +0 -15
- data/spec/fixtures/roles.yml +0 -2
- data/spec/fixtures/states.yml +0 -2
- data/spec/fixtures/tax_categories.yml +0 -4
- data/spec/fixtures/users.yml +0 -5
- data/spec/fixtures/zone_members.yml +0 -7
- data/spec/fixtures/zones.yml +0 -4
- data/spec/lib/easy_role_requirement_system_spec.rb +0 -140
- data/spec/models/address_spec.rb +0 -79
- data/spec/models/app_configuration_spec.rb +0 -13
- data/spec/models/creditcard_payment_spec.rb +0 -17
- data/spec/models/creditcard_spec.rb +0 -43
- data/spec/models/inventory_unit_spec.rb +0 -18
- data/spec/models/option_type_spec.rb +0 -36
- data/spec/models/option_value_spec.rb +0 -39
- data/spec/models/order_spec.rb +0 -207
- data/spec/models/payment_sepc.rb +0 -29
- data/spec/models/product_option_type_spec.rb +0 -38
- data/spec/models/product_property_spec.rb +0 -29
- data/spec/models/property_spec.rb +0 -37
- data/spec/models/prototype_spec.rb +0 -35
- data/spec/models/shipment_spec.rb +0 -8
- data/spec/models/shipping_category_spec.rb +0 -8
- data/spec/models/shipping_order_spec.rb +0 -113
- data/spec/models/tax_category_spec.rb +0 -11
- data/spec/models/taxon_spec.rb +0 -50
- data/spec/models/taxonomy_spec.rb +0 -37
- data/spec/models/zone_member_spec.rb +0 -5
- data/spec/models/zone_spec.rb +0 -137
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -79
- data/vendor/extensions/overview_dashboard/spec/spec.opts +0 -6
- data/vendor/extensions/overview_dashboard/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/spec/helpers/admin/gateways_helper_spec.rb +0 -6
- data/vendor/extensions/payment_gateway/spec/models/creditcard_spec.rb +0 -15
- data/vendor/extensions/payment_gateway/spec/models/gateway_spec.rb +0 -11
- data/vendor/extensions/payment_gateway/spec/models/order_spec.rb +0 -45
- data/vendor/extensions/payment_gateway/spec/spec.opts +0 -6
- data/vendor/extensions/payment_gateway/spec/spec_helper.rb +0 -37
- data/vendor/extensions/theme_default/spec/spec.opts +0 -6
- data/vendor/extensions/theme_default/spec/spec_helper.rb +0 -37
data/lib/tasks/framework.rake
CHANGED
@@ -4,7 +4,7 @@ namespace :spree do
|
|
4
4
|
task :gems do
|
5
5
|
|
6
6
|
# Do not allow freeze and unfreeze tasks in instance mode
|
7
|
-
if File.directory? "#{
|
7
|
+
if File.directory? "#{Rails.root}/app"
|
8
8
|
puts "Spree cannot be frozen in instance mode. Spree is meant to be frozen in a deployed Spree application only."
|
9
9
|
return
|
10
10
|
end
|
data/lib/tasks/instance.rake
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
# Redefined standard Rails tasks only in instance mode
|
2
|
-
unless File.directory? "#{
|
2
|
+
unless File.directory? "#{Rails.root}/app"
|
3
3
|
require 'rake/testtask'
|
4
4
|
|
5
|
-
ENV['SPREE_ENV_FILE'] =
|
5
|
+
ENV['SPREE_ENV_FILE'] = Rails.root.join('config', 'environment').to_s
|
6
6
|
|
7
7
|
[Dir["#{SPREE_ROOT}/vendor/rails/railties/lib/tasks/*.rake"], Dir["#{SPREE_ROOT}/vendor/plugins/rspec_on_rails/tasks/*.rake"]].flatten.each do |rake|
|
8
8
|
lines = IO.readlines(rake)
|
9
9
|
lines.map! do |line|
|
10
|
-
line.gsub!('
|
10
|
+
line.gsub!('Rails.root', 'SPREE_ROOT') unless rake =~ /(misc|rspec)\.rake$/
|
11
11
|
case rake
|
12
12
|
when /testing\.rake$/
|
13
13
|
line.gsub!(/t.libs << (["'])/, 't.libs << \1' + SPREE_ROOT + '/')
|
14
14
|
line.gsub!(/t\.pattern = (["'])/, 't.pattern = \1' + SPREE_ROOT + '/')
|
15
15
|
when /databases\.rake$/
|
16
16
|
line.gsub!(/migrate\((["'])/, 'migrate(\1' + SPREE_ROOT + '/')
|
17
|
-
line.sub!("db/schema.rb", "#{
|
17
|
+
line.sub!("db/schema.rb", "#{Rails.root}/db/schema.rb")
|
18
18
|
when /rspec\.rake$/
|
19
|
-
line.gsub!('
|
19
|
+
line.gsub!('Rails.root', 'SPREE_ROOT') unless line =~ /:noop/
|
20
20
|
line.gsub!(/FileList\[(["'])/, "FileList[\\1#{SPREE_ROOT}/")
|
21
21
|
end
|
22
22
|
line
|
23
23
|
end
|
24
24
|
eval(lines.join("\n"), binding, rake)
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
data/lib/validation_group.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# This is a modified version of wizardly plugin (Jeff Patmon), which itself is based on the validationgroup
|
1
|
+
# This is a modified version of wizardly plugin (Jeff Patmon), which itself is based on the validationgroup
|
2
2
|
# plugin (akira)
|
3
3
|
module ValidationGroup
|
4
4
|
module ActiveRecord
|
@@ -9,7 +9,7 @@ module ValidationGroup
|
|
9
9
|
base.class_eval do
|
10
10
|
cattr_accessor :validation_group_classes
|
11
11
|
self.validation_group_classes = {}
|
12
|
-
|
12
|
+
|
13
13
|
def self.validation_group_order; @validation_group_order; end
|
14
14
|
def self.validation_groups(all_classes = false)
|
15
15
|
return (self.validation_group_classes[self] || {}) unless all_classes
|
@@ -22,7 +22,7 @@ module ValidationGroup
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def validation_group(name, options={})
|
27
27
|
self_groups = (self.validation_group_classes[self] ||= {})
|
28
28
|
self_groups[name.to_sym] = case options[:fields]
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
# jeffp: capture the declaration order for this class only (no
|
34
34
|
# superclasses)
|
35
35
|
(@validation_group_order ||= []) << name.to_sym
|
36
|
-
|
36
|
+
|
37
37
|
unless included_modules.include?(InstanceMethods)
|
38
38
|
# jeffp: added reader for current_validation_fields
|
39
39
|
attr_reader :current_validation_group, :current_validation_fields
|
@@ -43,7 +43,7 @@ end
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
module InstanceMethods # included in every model which calls validation_group
|
48
48
|
#needs testing
|
49
49
|
# def reset_fields_for_validation_group(group)
|
@@ -68,32 +68,32 @@ end
|
|
68
68
|
if found
|
69
69
|
@current_validation_group = group
|
70
70
|
# jeffp: capture current fields for performance optimization
|
71
|
-
@current_validation_fields = group_classes[found][group]
|
71
|
+
@current_validation_fields = group_classes[found][group].clone
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def disable_validation_group
|
76
76
|
@current_validation_group = nil
|
77
77
|
# jeffp: delete fields
|
78
78
|
@current_validation_fields = nil
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def reject_non_validation_group_errors
|
82
82
|
return unless validation_group_enabled?
|
83
83
|
self.errors.remove_on(@current_validation_fields)
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
# jeffp: optimizer for someone writing custom :validate method -- no need
|
87
87
|
# to validate fields outside the current validation group note: could also
|
88
88
|
# use in validation modules to improve performance
|
89
89
|
def should_validate?(attribute)
|
90
90
|
!self.validation_group_enabled? || (@current_validation_fields && @current_validation_fields.include?(attribute.to_sym))
|
91
91
|
end
|
92
|
-
|
92
|
+
|
93
93
|
def validation_group_enabled?
|
94
94
|
respond_to?(:current_validation_group) && !current_validation_group.nil?
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
# eliminates need to use :enable_validation_group before :valid? call --
|
98
98
|
# nice
|
99
99
|
def valid_with_validation_group?(group=nil)
|
@@ -101,7 +101,7 @@ end
|
|
101
101
|
valid_without_validation_group?
|
102
102
|
end
|
103
103
|
end
|
104
|
-
|
104
|
+
|
105
105
|
module Errors # included in ActiveRecord::Errors
|
106
106
|
def add_with_validation_group(attribute,
|
107
107
|
msg = @@default_error_messages[:invalid], *args,
|
@@ -110,13 +110,13 @@ end
|
|
110
110
|
add_error = @base.respond_to?(:should_validate?) ? @base.should_validate?(attribute.to_sym) : true
|
111
111
|
add_without_validation_group(attribute, msg, *args, &block) if add_error
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
def remove_on(attributes)
|
115
115
|
return unless attributes
|
116
116
|
attributes = [attributes] unless attributes.is_a?(Array)
|
117
117
|
@errors.reject!{|k,v| !attributes.include?(k.to_sym)}
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
def self.included(base) #:nodoc:
|
121
121
|
base.class_eval do
|
122
122
|
alias_method_chain :add, :validation_group
|
@@ -124,7 +124,7 @@ end
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
127
|
-
|
127
|
+
|
128
128
|
module Util
|
129
129
|
# Return array consisting of current and its superclasses down to and
|
130
130
|
# including base_class.
|
@@ -140,6 +140,6 @@ end
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
143
|
-
|
143
|
+
|
144
144
|
# jeffp: moved from init.rb for gemification purposes --
|
145
145
|
# require 'validation_group' loads everything now, init.rb requires 'validation_group' only
|
data/script/extension
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require File.
|
3
|
-
require 'commands/extension'
|
2
|
+
require File.expand_path('../../config/boot', __FILE__)
|
3
|
+
require 'commands/extension'
|
@@ -8,4 +8,17 @@ class ProductsControllerTest < ActionController::TestCase
|
|
8
8
|
should_respond_with :success
|
9
9
|
should_not_set_the_flash
|
10
10
|
end
|
11
|
+
|
12
|
+
context "with a Taxonomy without a root Taxon" do
|
13
|
+
setup do
|
14
|
+
taxonomy = Factory(:taxonomy)
|
15
|
+
taxonomy2 = Factory(:taxonomy)
|
16
|
+
taxonomy2.root.destroy
|
17
|
+
get :index
|
18
|
+
end
|
19
|
+
should_respond_with :success
|
20
|
+
should "render only one Taxonomy" do
|
21
|
+
assert_select "#taxonomies .navigation-list li"
|
22
|
+
end
|
23
|
+
end
|
11
24
|
end
|
data/test/test_helper.rb
CHANGED
data/test/unit/checkout_test.rb
CHANGED
@@ -4,17 +4,26 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
4
4
|
fixtures :payment_methods
|
5
5
|
|
6
6
|
should_belong_to :bill_address
|
7
|
-
|
8
|
-
|
9
|
-
context Checkout do
|
7
|
+
|
8
|
+
context Checkout do
|
10
9
|
setup do
|
11
10
|
@order = Factory(:order_with_totals)
|
12
11
|
@checkout = @order.checkout
|
12
|
+
@checkout.email = Faker::Internet.email
|
13
13
|
@checkout.shipping_method = Factory(:shipping_method)
|
14
14
|
@checkout.state = "confirm"
|
15
15
|
@checkout.save!
|
16
16
|
end
|
17
17
|
|
18
|
+
context "with :register as current validation group" do
|
19
|
+
setup do
|
20
|
+
@checkout.enable_validation_group(:register)
|
21
|
+
end
|
22
|
+
subject { @checkout }
|
23
|
+
|
24
|
+
should_not_allow_values_for :email, "blah", "b lah", "blah@blah"
|
25
|
+
end
|
26
|
+
|
18
27
|
context "in confirm state w/no auto capture" do
|
19
28
|
setup do
|
20
29
|
Spree::Config.set(:auto_capture => false)
|
@@ -22,7 +31,7 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
22
31
|
end
|
23
32
|
context "next" do
|
24
33
|
setup do
|
25
|
-
@checkout.next!
|
34
|
+
@checkout.next!
|
26
35
|
end
|
27
36
|
should_change("@checkout.state", :to => "complete") { @checkout.state }
|
28
37
|
should_change("@checkout.order.completed_at", :from => nil) { @checkout.order.completed_at }
|
@@ -30,7 +39,7 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
30
39
|
should_change("CreditcardTxn.count", :by => 1) { CreditcardTxn.count }
|
31
40
|
end
|
32
41
|
end
|
33
|
-
|
42
|
+
|
34
43
|
context "in payment state w/no auto capture" do
|
35
44
|
context "next with declineable creditcard" do
|
36
45
|
setup do
|
@@ -46,7 +55,7 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
46
55
|
should_not_change("@checkout.state") { @checkout.state }
|
47
56
|
end
|
48
57
|
end
|
49
|
-
|
58
|
+
|
50
59
|
context "in confirm state w/auto capture" do
|
51
60
|
setup do
|
52
61
|
Spree::Config.set(:auto_capture => true)
|
@@ -55,7 +64,7 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
55
64
|
setup do
|
56
65
|
@checkout.state = 'confirm'
|
57
66
|
@payment = Factory(:payment, :payable => @checkout)
|
58
|
-
@checkout.next!
|
67
|
+
@checkout.next!
|
59
68
|
end
|
60
69
|
should_change("@checkout.state", :to => "complete") { @checkout.state }
|
61
70
|
should_change("@checkout.order.completed_at", :from => nil) { @checkout.order.completed_at }
|
@@ -102,9 +111,9 @@ class CheckoutTest < ActiveSupport::TestCase
|
|
102
111
|
assert_equal [@country], Checkout.countries
|
103
112
|
end
|
104
113
|
end
|
105
|
-
end
|
114
|
+
end
|
106
115
|
context "Checkout state machine with no Gateway configured" do
|
107
|
-
setup do
|
116
|
+
setup do
|
108
117
|
Gateway.stub!(:current, :return => nil)
|
109
118
|
@order = Factory(:order_with_totals)
|
110
119
|
@checkout = @order.checkout
|
data/vendor/extensions/README
CHANGED
@@ -1 +1 @@
|
|
1
|
-
So-called "standard extensions" that ship with Spree go in this directory. Application specific extensions go in #{
|
1
|
+
So-called "standard extensions" that ship with Spree go in this directory. Application specific extensions go in #{Rails.root}/vendor/extensions.
|
@@ -67,7 +67,7 @@ namespace :spec do
|
|
67
67
|
# desc "Translate specs from pre-0.9 to 0.9 style"
|
68
68
|
# task :translate do
|
69
69
|
# translator = ::Spec::Translator.new
|
70
|
-
# dir =
|
70
|
+
# dir = Rails.root + '/spec'
|
71
71
|
# translator.translate(dir, dir)
|
72
72
|
# end
|
73
73
|
|
@@ -91,7 +91,7 @@ namespace :spec do
|
|
91
91
|
task :load => :environment do
|
92
92
|
require 'active_record/fixtures'
|
93
93
|
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
94
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(
|
94
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(Rails.root.join('spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
95
95
|
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
96
96
|
end
|
97
97
|
end
|
@@ -8,8 +8,8 @@ namespace :spree do
|
|
8
8
|
path = file.sub(ApiExtension.root, '')
|
9
9
|
directory = File.dirname(path)
|
10
10
|
puts "Copying #{path}..."
|
11
|
-
mkdir_p
|
12
|
-
cp file,
|
11
|
+
mkdir_p Rails.root + directory
|
12
|
+
cp file, Rails.root + path
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -67,7 +67,7 @@ namespace :spec do
|
|
67
67
|
# desc "Translate specs from pre-0.9 to 0.9 style"
|
68
68
|
# task :translate do
|
69
69
|
# translator = ::Spec::Translator.new
|
70
|
-
# dir =
|
70
|
+
# dir = Rails.root + '/spec'
|
71
71
|
# translator.translate(dir, dir)
|
72
72
|
# end
|
73
73
|
|
@@ -91,7 +91,7 @@ namespace :spec do
|
|
91
91
|
task :load => :environment do
|
92
92
|
require 'active_record/fixtures'
|
93
93
|
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
94
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(
|
94
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(Rails.root.join('spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
95
95
|
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
96
96
|
end
|
97
97
|
end
|
@@ -150,15 +150,15 @@
|
|
150
150
|
<% hook :admin_dashboard_javascript do %>
|
151
151
|
<% if @show_dashboard %>
|
152
152
|
<script type="text/javascript">
|
153
|
-
var orders_by_day_points = [[<%= @orders_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %>]];
|
154
|
-
var best_selling_variants_points = [<%= @best_selling_variants.map { |v| "[\"#{v[0]}\",#{v[1]}]" }.join(",") %>];
|
155
|
-
var top_grossing_variants_points = [<%= @top_grossing_variants.map { |v| "[\"#{v[0]}\",#{v[1]}]" }.join(",") %>];
|
156
|
-
var best_selling_taxons_points = [<%= @best_selling_taxons.map { |t| "[\"#{t[0]}\",#{t[1]}]" }.join(",") %>];
|
153
|
+
var orders_by_day_points = [[<%= raw @orders_by_day.map { |day| "[\"#{day[0]}\",#{day[1]}]" }.join(",") %>]];
|
154
|
+
var best_selling_variants_points = [<%= raw @best_selling_variants.map { |v| "[\"#{v[0]}\",#{v[1]}]" }.join(",") %>];
|
155
|
+
var top_grossing_variants_points = [<%= raw @top_grossing_variants.map { |v| "[\"#{v[0]}\",#{v[1]}]" }.join(",") %>];
|
156
|
+
var best_selling_taxons_points = [<%= raw @best_selling_taxons.map { |t| "[\"#{t[0]}\",#{t[1]}]" }.join(",") %>];
|
157
157
|
|
158
158
|
var orders = "<%= t(:orders) %>";
|
159
159
|
var by_day = "<%= t(:by_day) %>";
|
160
160
|
|
161
|
-
var pie_colors = [<%= @pie_colors.map{|c| "'#{c}'"}.join(",") %>];
|
161
|
+
var pie_colors = [<%= raw @pie_colors.map{|c| "'#{c}'"}.join(",") %>];
|
162
162
|
</script>
|
163
163
|
<% end %>
|
164
164
|
|
@@ -19,8 +19,8 @@ namespace :spree do
|
|
19
19
|
path = file.sub(OverviewDashboardExtension.root, '')
|
20
20
|
directory = File.dirname(path)
|
21
21
|
puts "Copying #{path}..."
|
22
|
-
mkdir_p
|
23
|
-
cp file,
|
22
|
+
mkdir_p Rails.root + directory
|
23
|
+
cp file, Rails.root + path
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -67,7 +67,7 @@ namespace :spec do
|
|
67
67
|
# desc "Translate specs from pre-0.9 to 0.9 style"
|
68
68
|
# task :translate do
|
69
69
|
# translator = ::Spec::Translator.new
|
70
|
-
# dir =
|
70
|
+
# dir = Rails.root + '/spec'
|
71
71
|
# translator.translate(dir, dir)
|
72
72
|
# end
|
73
73
|
|
@@ -91,7 +91,7 @@ namespace :spec do
|
|
91
91
|
task :load => :environment do
|
92
92
|
require 'active_record/fixtures'
|
93
93
|
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
94
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(
|
94
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(Rails.root.join('spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
95
95
|
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
96
96
|
end
|
97
97
|
end
|
@@ -2,6 +2,7 @@ class Gateway::AuthorizeNetCim < Gateway
|
|
2
2
|
preference :login, :string
|
3
3
|
preference :password, :string
|
4
4
|
preference :test_mode, :boolean, :default => false
|
5
|
+
preference :validate_on_profile_create, :boolean, :default => false
|
5
6
|
|
6
7
|
ActiveMerchant::Billing::Response.class_eval do
|
7
8
|
attr_writer :authorization
|
@@ -96,10 +97,13 @@ class Gateway::AuthorizeNetCim < Gateway
|
|
96
97
|
info = { :bill_to => generate_address_hash(payment.order.bill_address),
|
97
98
|
:payment => { :credit_card => payment.source } }
|
98
99
|
end
|
100
|
+
|
101
|
+
validation_mode = preferred_validate_on_profile_create ? preferred_server.to_sym : :none
|
102
|
+
|
99
103
|
{ :profile => { :merchant_customer_id => "#{Time.now.to_f}",
|
100
104
|
#:ship_to_list => generate_address_hash(creditcard.checkout.ship_address),
|
101
|
-
:payment_profiles => info }
|
102
|
-
|
105
|
+
:payment_profiles => info },
|
106
|
+
:validation_mode => validation_mode }
|
103
107
|
end
|
104
108
|
|
105
109
|
# As in PaymentGateway but with separate name fields
|
@@ -0,0 +1,88 @@
|
|
1
|
+
class Gateway::Braintree < Gateway
|
2
|
+
preference :merchant_id, :string
|
3
|
+
preference :public_key, :string
|
4
|
+
preference :private_key, :string
|
5
|
+
|
6
|
+
def provider_class
|
7
|
+
ActiveMerchant::Billing::BraintreeGateway
|
8
|
+
end
|
9
|
+
|
10
|
+
def authorize(money, creditcard, options = {})
|
11
|
+
adjust_options_for_braintree(creditcard, options)
|
12
|
+
payment_method = creditcard.gateway_customer_profile_id || creditcard
|
13
|
+
provider.authorize(money, payment_method, options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def capture(authorization, ignored_creditcard, ignored_options)
|
17
|
+
amount = (authorization.amount * 100).to_i
|
18
|
+
provider.capture(amount, authorization.response_code)
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_profile(payment)
|
22
|
+
if payment.source.gateway_customer_profile_id.nil?
|
23
|
+
response = provider.store(payment.source)
|
24
|
+
if response.success?
|
25
|
+
payment.source.update_attributes!(:gateway_customer_profile_id => response.params["customer_vault_id"])
|
26
|
+
else
|
27
|
+
payment.source.gateway_error response.message
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def credit(*args)
|
33
|
+
if args.size == 4
|
34
|
+
credit_with_payment_profiles(*args)
|
35
|
+
elsif args.size == 3
|
36
|
+
credit_without_payment_profiles(*args)
|
37
|
+
else
|
38
|
+
raise ArgumentError, "Expected 3 or 4 arguments, received #{args.size}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def credit_with_payment_profiles(amount, payment, response_code, option)
|
43
|
+
provider.credit(amount, payment)
|
44
|
+
end
|
45
|
+
|
46
|
+
def credit_without_payment_profiles(amount, response_code, options)
|
47
|
+
transaction = ::Braintree::Transaction.find(response_code)
|
48
|
+
if BigDecimal.new(amount.to_s) == (transaction.amount * 100)
|
49
|
+
provider.refund(response_code)
|
50
|
+
else
|
51
|
+
raise NotImplementedError
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def payment_profiles_supported?
|
56
|
+
true
|
57
|
+
end
|
58
|
+
|
59
|
+
def purchase(money, creditcard, options = {})
|
60
|
+
authorize(money, creditcard, options.merge(:submit_for_settlement => true))
|
61
|
+
end
|
62
|
+
|
63
|
+
def void(response_code, ignored_creditcard, ignored_options)
|
64
|
+
provider.void(response_code)
|
65
|
+
end
|
66
|
+
|
67
|
+
protected
|
68
|
+
|
69
|
+
def adjust_country_name(options)
|
70
|
+
[:billing_address, :shipping_address].each do |address|
|
71
|
+
if options[address] && options[address][:country] == "US"
|
72
|
+
options[address][:country] = "United States of America"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def adjust_billing_address(creditcard, options)
|
78
|
+
if creditcard.gateway_customer_profile_id
|
79
|
+
options.delete(:billing_address)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def adjust_options_for_braintree(creditcard, options)
|
84
|
+
adjust_country_name(options)
|
85
|
+
adjust_billing_address(creditcard, options)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|