spree 0.10.2 → 0.11.0
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 +81 -4
- data/CONTRIBUTORS +18 -10
- data/Rakefile +5 -4
- data/app/controllers/admin/adjustments_controller.rb +17 -3
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/checkouts_controller.rb +43 -34
- data/app/controllers/admin/line_items_controller.rb +32 -18
- data/app/controllers/admin/option_types_controller.rb +1 -1
- data/app/controllers/admin/orders_controller.rb +28 -7
- data/app/controllers/admin/payments_controller.rb +7 -7
- data/app/controllers/admin/products_controller.rb +12 -23
- data/app/controllers/admin/reports_controller.rb +19 -7
- data/app/controllers/admin/return_authorizations_controller.rb +1 -1
- data/app/controllers/admin/shipments_controller.rb +9 -9
- data/app/controllers/admin/users_controller.rb +3 -1
- data/app/controllers/admin/variants_controller.rb +2 -2
- data/app/controllers/checkouts_controller.rb +29 -18
- data/app/controllers/content_controller.rb +1 -1
- data/{vendor/extensions/localization/app → app}/controllers/locale_controller.rb +1 -1
- data/app/controllers/orders_controller.rb +33 -30
- data/app/controllers/password_resets_controller.rb +4 -4
- data/app/controllers/products_controller.rb +0 -6
- data/app/controllers/spree/base_controller.rb +9 -2
- data/app/controllers/user_sessions_controller.rb +18 -18
- data/app/controllers/users_controller.rb +2 -2
- data/app/helpers/admin/base_helper.rb +5 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/admin/orders_helper.rb +0 -13
- data/app/helpers/admin/products_helper.rb +0 -8
- data/app/helpers/checkouts_helper.rb +5 -5
- data/app/helpers/products_helper.rb +0 -12
- data/app/helpers/spree/base_helper.rb +10 -39
- data/app/helpers/taxons_helper.rb +1 -0
- data/app/models/address.rb +6 -1
- data/app/models/app_configuration.rb +15 -14
- data/app/models/calculator/flexi_rate.rb +2 -1
- data/app/models/calculator/vat.rb +1 -1
- data/app/models/checkout.rb +1 -1
- data/app/models/creditcard.rb +26 -20
- data/app/models/inventory_unit.rb +70 -21
- data/app/models/line_item.rb +25 -11
- data/app/models/order.rb +16 -10
- data/app/models/payment.rb +4 -1
- data/app/models/payment_method.rb +14 -5
- data/app/models/product.rb +12 -4
- data/app/models/role.rb +2 -2
- data/app/models/shipment.rb +21 -2
- data/app/models/tax_category.rb +8 -0
- data/app/models/taxon.rb +8 -0
- data/app/models/user.rb +2 -3
- data/app/models/variant.rb +18 -13
- data/config/boot.rb +1 -5
- data/config/cucumber.yml +7 -0
- data/config/database.yml +20 -37
- data/config/database.yml.example +5 -6
- data/config/environment.rb +6 -5
- data/config/environments/cucumber.rb +30 -0
- data/config/environments/production.rb +1 -4
- data/config/environments/staging.rb +3 -0
- data/config/environments/test.rb +1 -1
- data/config/initializers/cookie_verification_secret.rb +7 -0
- data/config/initializers/locales.rb +4 -2
- data/config/initializers/new_rails_defaults.rb +2 -0
- data/config/initializers/spree.rb +1 -0
- data/config/initializers/workarounds_for_ruby19.rb +0 -25
- data/config/locales/{en-US.yml → en_spree.yml} +18 -4
- data/config/routes.rb +2 -1
- data/db/migrate/20100317120946_add_alt_text_to_images.rb +9 -0
- data/db/migrate/20100427121301_add_display_to_payment_methods.rb +9 -0
- data/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb +16 -0
- data/db/migrate/20100506180619_add_icon_to_taxons.rb +18 -0
- data/db/migrate/20100506185838_add_description_to_taxons.rb +11 -0
- data/db/migrate/20100528155333_index_for_shipments_number.rb +9 -0
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +9 -0
- data/db/migrate/20100605152042_add_default_to_tax_categories.rb +9 -0
- data/db/sample/payment_methods.yml +8 -1
- data/db/sample/shipments.yml +2 -2
- data/db/schema.rb +54 -21
- data/features/checkout.feature +98 -0
- data/features/create_admin_user.feature +18 -0
- data/features/search.feature +35 -0
- data/features/sign_in.feature +25 -0
- data/features/sign_out.feature +12 -0
- data/features/sign_up.feature +20 -0
- data/features/step_definitions/error_steps.rb +3 -0
- data/features/step_definitions/model_steps.rb +3 -0
- data/features/step_definitions/pickle_steps.rb +73 -0
- data/features/step_definitions/role_steps.rb +8 -0
- data/features/step_definitions/session_steps.rb +14 -0
- data/features/step_definitions/user_steps.rb +67 -0
- data/features/step_definitions/web_steps.rb +197 -0
- data/features/support/create_admin_user.rb +6 -0
- data/features/support/env.rb +89 -0
- data/features/support/paths.rb +32 -0
- data/features/support/pickle.rb +24 -0
- data/features/work_with_cart.feature +41 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -10
- data/lib/generators/instance/templates/databases/mysql.yml +11 -0
- data/lib/scopes/variant.rb +10 -0
- data/lib/spree.rb +3 -3
- data/lib/spree/extensions.rb +1 -1
- data/lib/tasks/cucumber.rake +47 -0
- data/lib/tasks/database.rake +29 -29
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/javascripts/admin/checkouts/edit.js +33 -0
- data/public/javascripts/dashboard.js +2 -2
- data/public/javascripts/taxonomy.js +2 -2
- data/public/stylesheets/admin/admin-tables.css +4 -0
- data/public/stylesheets/admin/admin.css +31 -16
- data/public/stylesheets/screen.css +16 -3
- data/script/about +3 -2
- data/script/console +2 -2
- data/script/cucumber +10 -0
- data/script/dbconsole +1 -1
- data/script/destroy +2 -2
- data/script/generate +2 -2
- data/script/performance/benchmarker +1 -1
- data/script/performance/profiler +1 -1
- data/script/plugin +2 -2
- data/script/runner +2 -2
- data/script/server +2 -2
- data/test/fixtures/payment_methods.yml +12 -0
- data/test/functional/admin/checkouts_controller_test.rb +0 -2
- data/test/functional/admin/line_items_controller_test.rb +78 -39
- data/test/functional/admin/products_controller_test.rb +4 -5
- data/test/integration/checkout_test.rb +1 -0
- data/test/test_helper.rb +114 -86
- data/test/unit/creditcard_test.rb +28 -7
- data/test/unit/flexi_rate_calculator_test.rb +75 -0
- data/test/unit/helpers/products_helper_test.rb +4 -4
- data/test/unit/inventory_unit_test.rb +39 -5
- data/test/unit/line_item_test.rb +60 -1
- data/test/unit/order_state_test.rb +85 -58
- data/test/unit/order_test.rb +144 -123
- data/test/unit/product_test.rb +21 -0
- data/test/unit/return_authorization_test.rb +22 -28
- data/test/unit/shipment_test.rb +19 -7
- data/test/unit/variant_test.rb +100 -24
- data/vendor/extensions/api/api_extension.rb +2 -2
- data/vendor/extensions/api/app/controllers/api/base_controller.rb +14 -6
- data/vendor/extensions/api/app/controllers/api/countries_controller.rb +4 -0
- data/vendor/extensions/api/app/controllers/api/orders_controller.rb +4 -4
- data/vendor/extensions/api/app/controllers/api/products_controller.rb +5 -1
- data/vendor/extensions/api/app/controllers/api/shipments_controller.rb +7 -7
- data/vendor/extensions/api/app/controllers/api/states_controller.rb +5 -0
- data/vendor/extensions/api/config/locales/{en-US.yml → en.yml} +2 -2
- data/vendor/extensions/api/config/routes.rb +5 -0
- data/vendor/extensions/api/test/integration/orders_api_test.rb +4 -4
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +41 -29
- data/vendor/extensions/payment_gateway/app/models/gateway/bogus.rb +3 -3
- data/vendor/extensions/payment_gateway/app/models/gateway/eway.rb +11 -0
- data/vendor/extensions/payment_gateway/app/models/gateway/sage_pay.rb +9 -0
- data/vendor/extensions/payment_gateway/config/locales/{en-US.yml → en.yml} +1 -1
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +46 -56
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +9 -10
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +7 -6
- data/vendor/extensions/theme_default/app/stylesheets/_checkout.less +10 -3
- data/vendor/extensions/theme_default/app/views/admin/adjustments/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/checkouts/_form.html.erb +31 -5
- data/vendor/extensions/theme_default/app/views/admin/checkouts/show.html.erb +27 -16
- data/vendor/extensions/theme_default/app/views/admin/images/_form.html.erb +4 -0
- data/vendor/extensions/theme_default/app/views/admin/images/index.html.erb +16 -13
- data/vendor/extensions/theme_default/app/views/admin/orders/_add_product.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/orders/_form.html.erb +7 -0
- data/vendor/extensions/theme_default/app/views/admin/orders/index.html.erb +5 -5
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +12 -6
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +22 -11
- data/vendor/extensions/theme_default/app/views/admin/product_groups/update.js.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/products/_form.html.erb +6 -4
- data/vendor/extensions/theme_default/app/views/admin/shared/_address_form.html.erb +64 -55
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_order_tabs.html.erb +11 -3
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipments/_form.html.erb +32 -29
- data/vendor/extensions/theme_default/app/views/admin/shipments/index.html.erb +2 -1
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/_form.html.erb +6 -3
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/index.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_taxon.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/taxons/_form.html.erb +11 -1
- data/vendor/extensions/theme_default/app/views/admin/taxons/edit.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/users/_form.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/variants/_form.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/checkouts/_confirm.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_delivery.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/checkouts/edit.html.erb +3 -3
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +7 -5
- data/vendor/extensions/theme_default/app/views/layouts/spree_application.html.erb +8 -4
- data/vendor/extensions/theme_default/app/views/orders/_line_item.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/products/index.html.erb +0 -1
- data/vendor/extensions/theme_default/app/views/shared/_footer.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +3 -1
- data/vendor/extensions/theme_default/app/views/shared/_user_form.html.erb +1 -1
- data/vendor/extensions/theme_default/public/images/admin/bg/spree_50.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-header.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-slider.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/admin/checkouts/edit.js +50 -0
- data/vendor/extensions/theme_default/public/javascripts/taxonomy.js +2 -2
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin-tables.css +8 -0
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +31 -16
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +16 -3
- data/vendor/plugins/attribute_fu/{tasks → lib/tasks}/attribute_fu_tasks.rake +0 -0
- data/vendor/plugins/enumerable_constants/{tasks → lib/tasks}/enumerable_constants_tasks.rake +0 -0
- data/vendor/plugins/find_by_param/lib/find_by_param.rb +9 -5
- data/vendor/plugins/find_by_param/{tasks → lib/tasks}/find_by_param_tasks.rake +0 -0
- data/vendor/plugins/jrails/{tasks → lib/tasks}/jrails.rake +0 -0
- data/vendor/plugins/jrails_auto_complete/{tasks → lib/tasks}/jrails_auto_complete_tasks.rake +0 -0
- data/vendor/plugins/mail_queue/{tasks → lib/tasks}/mailer_queue_tasks.rake +0 -0
- data/vendor/plugins/open_id_authentication/{tasks → lib/tasks}/open_id_authentication_tasks.rake +0 -0
- data/vendor/plugins/resource_controller/lib/resource_controller/helpers/internal.rb +2 -2
- data/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +7 -7
- data/vendor/plugins/unobtrusive_date_picker/{tasks → lib/tasks}/datepicker_tasks.rake +0 -0
- metadata +82 -342
- data/app/helpers/admin/adjustments_helper.rb +0 -2
- data/app/helpers/admin/checkouts_helper.rb +0 -2
- data/app/helpers/admin/line_items_helper.rb +0 -2
- data/app/helpers/admin/properties_helper.rb +0 -9
- data/app/helpers/admin/prototypes_helper.rb +0 -18
- data/app/helpers/admin/return_authorizations_helper.rb +0 -2
- data/config/locales/cs-CZ.yml +0 -924
- data/config/locales/cs-CZ_rails.yml +0 -202
- data/config/locales/da.yml +0 -924
- data/config/locales/da_rails.yml +0 -197
- data/config/locales/de-CH.yml +0 -924
- data/config/locales/de-CH_rails.yml +0 -142
- data/config/locales/de.yml +0 -924
- data/config/locales/de_rails.yml +0 -140
- data/config/locales/en-AU.yml +0 -924
- data/config/locales/en-AU_rails.yml +0 -202
- data/config/locales/en-GB.yml +0 -924
- data/config/locales/en-GB_rails.yml +0 -196
- data/config/locales/en-US_rails.yml +0 -200
- data/config/locales/es.yml +0 -924
- data/config/locales/es_rails.yml +0 -173
- data/config/locales/fi.yml +0 -924
- data/config/locales/fi_rails.yml +0 -143
- data/config/locales/fr-FR.yml +0 -924
- data/config/locales/fr-FR_rails.yml +0 -123
- data/config/locales/il.yml +0 -924
- data/config/locales/il_rails.yml +0 -103
- data/config/locales/it.yml +0 -924
- data/config/locales/it_rails.yml +0 -146
- data/config/locales/jp.yml +0 -924
- data/config/locales/jp_rails.yml +0 -135
- data/config/locales/mx.yml +0 -924
- data/config/locales/mx_rails.yml +0 -181
- data/config/locales/nb-NO.yml +0 -924
- data/config/locales/nb-NO_rails.yml +0 -105
- data/config/locales/nl-BE.yml +0 -924
- data/config/locales/nl-BE_rails.yml +0 -155
- data/config/locales/nl-NL.yml +0 -924
- data/config/locales/nl-NL_rails.yml +0 -172
- data/config/locales/pl.yml +0 -924
- data/config/locales/pl_rails.yml +0 -118
- data/config/locales/pt-BR.yml +0 -924
- data/config/locales/pt-BR_rails.yml +0 -138
- data/config/locales/pt-PT.yml +0 -924
- data/config/locales/pt-PT_rails.yml +0 -133
- data/config/locales/ru-RU.yml +0 -924
- data/config/locales/ru-RU_rails.yml +0 -206
- data/config/locales/th.yml +0 -924
- data/config/locales/th_rails.yml +0 -195
- data/config/locales/vn.yml +0 -924
- data/config/locales/vn_rails.yml +0 -202
- data/lib/tasks/translation.rake +0 -102
- data/vendor/extensions/localization/README.rdoc +0 -5
- data/vendor/extensions/localization/Rakefile +0 -120
- data/vendor/extensions/localization/app/controllers/admin/localization_controller.rb +0 -2
- data/vendor/extensions/localization/app/helpers/locale_helper.rb +0 -2
- data/vendor/extensions/localization/app/helpers/localization_helper.rb +0 -2
- data/vendor/extensions/localization/app/views/shared/_language_bar.html.erb +0 -8
- data/vendor/extensions/localization/config/routes.rb +0 -4
- data/vendor/extensions/localization/lib/localization/user_preferences.rb +0 -9
- data/vendor/extensions/localization/lib/tasks/localization_extension_tasks.rake +0 -17
- data/vendor/extensions/localization/localization_extension.rb +0 -21
- data/vendor/extensions/localization/public/images/flags/ad.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ae.png +0 -0
- data/vendor/extensions/localization/public/images/flags/af.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ag.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ai.png +0 -0
- data/vendor/extensions/localization/public/images/flags/al.png +0 -0
- data/vendor/extensions/localization/public/images/flags/am.png +0 -0
- data/vendor/extensions/localization/public/images/flags/an.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ao.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ar.png +0 -0
- data/vendor/extensions/localization/public/images/flags/as.png +0 -0
- data/vendor/extensions/localization/public/images/flags/at.png +0 -0
- data/vendor/extensions/localization/public/images/flags/au.png +0 -0
- data/vendor/extensions/localization/public/images/flags/aw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ax.png +0 -0
- data/vendor/extensions/localization/public/images/flags/az.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ba.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/be.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/br.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/by.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ca.png +0 -0
- data/vendor/extensions/localization/public/images/flags/catalonia.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ch.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ci.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ck.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/co.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/da.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de_CH.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/do.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ec.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ee.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/england.png +0 -0
- data/vendor/extensions/localization/public/images/flags/er.png +0 -0
- data/vendor/extensions/localization/public/images/flags/es.png +0 -0
- data/vendor/extensions/localization/public/images/flags/et.png +0 -0
- data/vendor/extensions/localization/public/images/flags/europeanunion.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fam.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ga.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ge.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ht.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/id.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ie.png +0 -0
- data/vendor/extensions/localization/public/images/flags/il.png +0 -0
- data/vendor/extensions/localization/public/images/flags/in.png +0 -0
- data/vendor/extensions/localization/public/images/flags/io.png +0 -0
- data/vendor/extensions/localization/public/images/flags/iq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ir.png +0 -0
- data/vendor/extensions/localization/public/images/flags/is.png +0 -0
- data/vendor/extensions/localization/public/images/flags/it.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ke.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ki.png +0 -0
- data/vendor/extensions/localization/public/images/flags/km.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ky.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/la.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/li.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ls.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ly.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ma.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/md.png +0 -0
- data/vendor/extensions/localization/public/images/flags/me.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ml.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ms.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/my.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/na.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ne.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ng.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ni.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/no.png +0 -0
- data/vendor/extensions/localization/public/images/flags/np.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/om.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pe.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ph.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ps.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/py.png +0 -0
- data/vendor/extensions/localization/public/images/flags/qa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/re.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ro.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ru.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/scotland.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/se.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/si.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/so.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/st.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/td.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/th.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/to.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ua.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ug.png +0 -0
- data/vendor/extensions/localization/public/images/flags/um.png +0 -0
- data/vendor/extensions/localization/public/images/flags/us.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/va.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ve.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wales.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ws.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ye.png +0 -0
- data/vendor/extensions/localization/public/images/flags/yt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/za.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zw.png +0 -0
- data/vendor/extensions/localization/spec/controllers/admin/localization_controller_spec.rb +0 -10
- data/vendor/extensions/localization/spec/controllers/locale_controller_spec.rb +0 -35
- data/vendor/extensions/localization/spec/helpers/locale_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/helpers/localization_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/spec.opts +0 -6
- data/vendor/extensions/localization/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/app/models/gateway/protx.rb +0 -9
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_manage_products.rhtml +0 -31
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_success.rhtml +0 -1
@@ -0,0 +1,89 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'spork'
|
9
|
+
|
10
|
+
Spork.prefork do
|
11
|
+
ENV["RAILS_ENV"] ||= "cucumber"
|
12
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
13
|
+
|
14
|
+
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
|
15
|
+
require 'cucumber/rails/world'
|
16
|
+
require 'cucumber/rails/active_record'
|
17
|
+
require 'cucumber/web/tableish'
|
18
|
+
|
19
|
+
|
20
|
+
require 'capybara/rails'
|
21
|
+
require 'capybara/cucumber'
|
22
|
+
require 'capybara/session'
|
23
|
+
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
24
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
25
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
26
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
27
|
+
# steps to use the XPath syntax.
|
28
|
+
Capybara.default_selector = :css
|
29
|
+
|
30
|
+
|
31
|
+
Dir.glob(SPREE_ROOT + '/db/default/*.{yml,csv,rb}').each do |file|
|
32
|
+
Fixtures.create_fixtures('db/default', File.basename(file, '.*'))
|
33
|
+
end
|
34
|
+
Dir.glob(SPREE_ROOT + '/test/fixtures/*.{yml,csv,rb}').each do |file|
|
35
|
+
Fixtures.create_fixtures('test/fixtures', File.basename(file, '.*'))
|
36
|
+
end
|
37
|
+
|
38
|
+
Zone.class_eval do
|
39
|
+
def self.global
|
40
|
+
find_by_name("GlobalZone") || Factory(:global_zone)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
Product.class_eval do
|
45
|
+
def taxon=(taxon_name)
|
46
|
+
taxonomy = Taxonomy.find_or_create_by_name("Category")
|
47
|
+
taxon = Taxon.find_or_create_by_name_and_taxonomy_id(taxon_name, taxonomy)
|
48
|
+
self.taxons << taxon
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
ShippingMethod.create(:name => "UPS Ground", :zone => Zone.global, :calculator => Calculator::FlatRate.new)
|
53
|
+
|
54
|
+
coupon = Coupon.create(:code => "SPREE", :description => "$5 off any order", :combine => false, :calculator => Calculator::FlatRate.new)
|
55
|
+
coupon.calculator.update_attribute(:preferred_amount, 5)
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
Spork.each_run do
|
60
|
+
# If you set this to false, any error raised from within your app will bubble
|
61
|
+
# up to your step definition and out to cucumber unless you catch it somewhere
|
62
|
+
# on the way. You can make Rails rescue errors and render error pages on a
|
63
|
+
# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
|
64
|
+
#
|
65
|
+
# If you set this to true, Rails will rescue all errors and render error
|
66
|
+
# pages, more or less in the same way your application would behave in the
|
67
|
+
# default production environment. It's not recommended to do this for all
|
68
|
+
# of your scenarios, as this makes it hard to discover errors in your application.
|
69
|
+
ActionController::Base.allow_rescue = false
|
70
|
+
|
71
|
+
# If you set this to true, each scenario will run in a database transaction.
|
72
|
+
# You can still turn off transactions on a per-scenario basis, simply tagging
|
73
|
+
# a feature or scenario with the @no-txn tag. If you are using Capybara,
|
74
|
+
# tagging with @culerity or @javascript will also turn transactions off.
|
75
|
+
#
|
76
|
+
# If you set this to false, transactions will be off for all scenarios,
|
77
|
+
# regardless of whether you use @no-txn or not.
|
78
|
+
#
|
79
|
+
# Beware that turning transactions off will leave data in your database
|
80
|
+
# after each scenario, which can lead to hard-to-debug failures in
|
81
|
+
# subsequent scenarios. If you do this, we recommend you create a Before
|
82
|
+
# block that will explicitly put your database in a known state.
|
83
|
+
Cucumber::Rails::World.use_transactional_fixtures = true
|
84
|
+
|
85
|
+
# How to clean your database when transactions are turned off. See
|
86
|
+
# http://github.com/bmabey/database_cleaner for more info.
|
87
|
+
require 'database_cleaner'
|
88
|
+
DatabaseCleaner.strategy = :truncation
|
89
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
# Maps a name to a path. Used by the
|
3
|
+
#
|
4
|
+
# When /^I go to (.+)$/ do |page_name|
|
5
|
+
#
|
6
|
+
# step definition in web_steps.rb
|
7
|
+
#
|
8
|
+
def path_to(page_name)
|
9
|
+
case page_name
|
10
|
+
|
11
|
+
when /the home\s?page/
|
12
|
+
'/'
|
13
|
+
when /the sign up page/
|
14
|
+
signup_path
|
15
|
+
when /the sign in page/
|
16
|
+
login_path
|
17
|
+
when /the products page/
|
18
|
+
products_path
|
19
|
+
# Add more mappings here.
|
20
|
+
# Here is an example that pulls values out of the Regexp:
|
21
|
+
#
|
22
|
+
# when /^(.*)'s profile page$/i
|
23
|
+
# user_profile_path(User.find_by_login($1))
|
24
|
+
|
25
|
+
else
|
26
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
27
|
+
"Now, go and add a mapping in #{__FILE__}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
World(NavigationHelpers)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# this file generated by script/generate pickle [paths] [email]
|
2
|
+
#
|
3
|
+
# Make sure that you are loading your factory of choice in your cucumber environment
|
4
|
+
#
|
5
|
+
# For machinist add: features/support/machinist.rb
|
6
|
+
#
|
7
|
+
# require 'machinist/active_record' # or your chosen adaptor
|
8
|
+
# require File.dirname(__FILE__) + '/../../spec/blueprints' # or wherever your blueprints are
|
9
|
+
# Before { Sham.reset } # to reset Sham's seed between scenarios so each run has same random sequences
|
10
|
+
#
|
11
|
+
# For FactoryGirl add: features/support/factory_girl.rb
|
12
|
+
#
|
13
|
+
# require 'factory_girl'
|
14
|
+
# require File.dirname(__FILE__) + '/../../spec/factories' # or wherever your factories are
|
15
|
+
#
|
16
|
+
# You may also need to add gem dependencies on your factory of choice in <tt>config/environments/cucumber.rb</tt>
|
17
|
+
|
18
|
+
require 'pickle/world'
|
19
|
+
# Example of configuring pickle:
|
20
|
+
#
|
21
|
+
# Pickle.configure do |config|
|
22
|
+
# config.adapters = [:machinist]
|
23
|
+
# config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
|
24
|
+
# end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Feature: Work with cart
|
2
|
+
|
3
|
+
Scenario: Visitor can work with cart
|
4
|
+
When I add a product with name: "RoR Mug", price: "15" to cart
|
5
|
+
Then I should see "Shopping Cart" within "h1"
|
6
|
+
And I should see "RoR Mug" within "#line_items h4 a"
|
7
|
+
And I should see "$15" within "#line_items td"
|
8
|
+
And I should see "$15" within "#subtotal"
|
9
|
+
|
10
|
+
When I add a product with name: "RoR Mug", price: "15" to cart
|
11
|
+
Then I should see "Shopping Cart" within "h1"
|
12
|
+
And I should see "RoR Mug" within "#line_items h4 a"
|
13
|
+
And I should see "$15" within "#line_items td"
|
14
|
+
And I should see "$30" within "#line_items td"
|
15
|
+
And I should see "$30" within "#subtotal"
|
16
|
+
|
17
|
+
When I add a product with name: "RoR Bag", price: "17" to cart
|
18
|
+
Then I should see "Shopping Cart" within "h1"
|
19
|
+
And I should see "RoR Bag" within "#line_items h4 a"
|
20
|
+
And I should see "$15" within "#line_items td"
|
21
|
+
And I should see "$17" within "#line_items td"
|
22
|
+
And I should see "$47" within "#subtotal"
|
23
|
+
|
24
|
+
When I fill in "order_line_items_attributes_0_quantity" with "3"
|
25
|
+
Then the "order_line_items_attributes_0_quantity" field should contain "3"
|
26
|
+
# When I press "order_line_items_attributes_0_quantity"
|
27
|
+
# Then I should see "Shopping Cart" within "h1"
|
28
|
+
# And I should see "$45" within "#line_items td"
|
29
|
+
# And I should see "$62" within "#subtotal"
|
30
|
+
|
31
|
+
# When I fill in "order_line_items_attributes_0_quantity" with "0"
|
32
|
+
# And follow "Update"
|
33
|
+
# Then I should see "Shopping Cart" within "h1"
|
34
|
+
# And I should see "$17" within "#subtotal"
|
35
|
+
|
36
|
+
|
37
|
+
Scenario: Following by cart link should not create order
|
38
|
+
When I go to the homepage
|
39
|
+
And follow "Cart"
|
40
|
+
When 0 orders should exist
|
41
|
+
|
@@ -5,7 +5,7 @@ require 'rails_generator/generators/components/model/model_generator'
|
|
5
5
|
class Rails::Generator::Commands::Base
|
6
6
|
protected
|
7
7
|
def migration_directory(relative_path)
|
8
|
-
directory(@migration_directory =
|
8
|
+
directory(@migration_directory = relative_path)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -24,15 +24,15 @@ class Rails::Generator::Commands::Destroy
|
|
24
24
|
end
|
25
25
|
|
26
26
|
class ExtensionModelGenerator < ModelGenerator
|
27
|
-
|
27
|
+
|
28
28
|
attr_accessor :extension_name
|
29
|
-
|
29
|
+
|
30
30
|
def initialize(runtime_args, runtime_options = {})
|
31
31
|
runtime_args = runtime_args.dup
|
32
32
|
@extension_name = runtime_args.shift
|
33
33
|
super(runtime_args, runtime_options)
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def manifest
|
37
37
|
if extension_uses_rspec?
|
38
38
|
rspec_manifest
|
@@ -40,7 +40,7 @@ class ExtensionModelGenerator < ModelGenerator
|
|
40
40
|
super
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def rspec_manifest
|
45
45
|
record do |m|
|
46
46
|
# Check for class naming collisions.
|
@@ -63,21 +63,21 @@ class ExtensionModelGenerator < ModelGenerator
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
def banner
|
68
68
|
"Usage: #{$0} extension_model ExtensionName ModelName [field:type, field:type]"
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
def extension_path
|
72
72
|
File.join('vendor', 'extensions', @extension_name.underscore)
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def destination_root
|
76
76
|
File.join(RAILS_ROOT, extension_path)
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
def extension_uses_rspec?
|
80
80
|
File.exists?(File.join(destination_root, 'spec'))
|
81
81
|
end
|
82
82
|
|
83
|
-
end
|
83
|
+
end
|
@@ -35,6 +35,17 @@ test:
|
|
35
35
|
host: localhost
|
36
36
|
<% end -%>
|
37
37
|
|
38
|
+
staging:
|
39
|
+
adapter: mysql
|
40
|
+
database: <%= app_name %>_staging
|
41
|
+
username: root
|
42
|
+
password:
|
43
|
+
<% if socket -%>
|
44
|
+
socket: <%= socket %>
|
45
|
+
<% else -%>
|
46
|
+
host: localhost
|
47
|
+
<% end -%>
|
48
|
+
|
38
49
|
production:
|
39
50
|
adapter: mysql
|
40
51
|
database: <%= app_name %>
|
data/lib/scopes/variant.rb
CHANGED
@@ -5,5 +5,15 @@ module Scopes::Variant
|
|
5
5
|
:order => 'COALESCE((SELECT COUNT(*) FROM line_items GROUP BY line_items.variant_id HAVING line_items.variant_id = variants.id), 0) DESC'
|
6
6
|
}
|
7
7
|
}
|
8
|
+
|
9
|
+
# for selecting variants with an option value
|
10
|
+
# no option type given since the value implies an option type
|
11
|
+
# this scope can be chained repeatedly, since the join name is unique
|
12
|
+
Variant.named_scope :has_option, lambda {|opt|
|
13
|
+
tbl = 'o' + Time.now.to_i.to_s + Time.now.usec.to_s
|
14
|
+
{ :joins => "inner join option_values_variants as #{tbl} on variants.id = #{tbl}.variant_id",
|
15
|
+
:conditions => ["#{tbl}.option_value_id = (?)", opt]
|
16
|
+
}
|
17
|
+
}
|
8
18
|
|
9
19
|
end
|
data/lib/spree.rb
CHANGED
data/lib/spree/extensions.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
9
|
+
|
10
|
+
vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'cucumber/rake/task'
|
15
|
+
|
16
|
+
namespace :cucumber do
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
20
|
+
t.profile = 'default'
|
21
|
+
end
|
22
|
+
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
24
|
+
t.binary = vendored_cucumber_bin
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
26
|
+
t.profile = 'wip'
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Run all features'
|
30
|
+
task :all => [:ok, :wip]
|
31
|
+
end
|
32
|
+
desc 'Alias for cucumber:ok'
|
33
|
+
task :cucumber => 'cucumber:ok'
|
34
|
+
|
35
|
+
task :default => :cucumber
|
36
|
+
|
37
|
+
task :features => :cucumber do
|
38
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
39
|
+
end
|
40
|
+
rescue LoadError
|
41
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
42
|
+
task :cucumber do
|
43
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/lib/tasks/database.rake
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
require 'active_record'
|
1
|
+
require 'active_record'
|
2
2
|
require 'custom_fixtures'
|
3
3
|
|
4
4
|
namespace :db do
|
5
5
|
desc "Migrate schema to version 0 and back up again. WARNING: Destroys all data in tables!!"
|
6
6
|
task :remigrate => :environment do
|
7
|
-
require 'highline/import'
|
8
|
-
|
9
|
-
if ENV['SKIP_NAG'] or ENV['OVERWRITE'].to_s.downcase == 'true' or agree("This task will destroy any data in the database. Are you sure you want to \ncontinue? [
|
7
|
+
require 'highline/import'
|
8
|
+
|
9
|
+
if ENV['SKIP_NAG'] or ENV['OVERWRITE'].to_s.downcase == 'true' or agree("This task will destroy any data in the database. Are you sure you want to \ncontinue? [y/n] ")
|
10
10
|
|
11
11
|
# Drop all tables
|
12
12
|
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.drop_table t }
|
13
13
|
|
14
|
-
# Migrate upward
|
14
|
+
# Migrate upward
|
15
15
|
Rake::Task["db:migrate"].invoke
|
16
|
-
|
16
|
+
|
17
17
|
# Dump the schema
|
18
18
|
Rake::Task["db:schema:dump"].invoke
|
19
19
|
else
|
@@ -21,18 +21,18 @@ namespace :db do
|
|
21
21
|
exit
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
|
-
namespace :admin do
|
24
|
+
|
25
|
+
namespace :admin do
|
26
26
|
desc "Create admin username and password"
|
27
27
|
task :create => :environment do
|
28
|
-
require 'authlogic'
|
29
|
-
require "#{SPREE_ROOT}/db/sample/users.rb"
|
28
|
+
require 'authlogic'
|
29
|
+
require "#{SPREE_ROOT}/db/sample/users.rb"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
desc "Loading db/sample for spree and each extension"
|
34
34
|
task :sample => :environment do # an invoke will not execute the task after defaults has already executed it
|
35
|
-
Rake::Task["db:load_dir"].execute( Rake::TaskArguments.new([:dir], ["sample" ]) )
|
35
|
+
Rake::Task["db:load_dir"].execute( Rake::TaskArguments.new([:dir], ["sample" ]) )
|
36
36
|
puts "Sample data has been loaded"
|
37
37
|
end
|
38
38
|
|
@@ -45,7 +45,7 @@ namespace :db do
|
|
45
45
|
Fixtures.create_fixtures(File.dirname(file) , File.basename(file, '.*') )
|
46
46
|
else
|
47
47
|
if File.exists? file
|
48
|
-
puts "loading ruby " + file
|
48
|
+
puts "loading ruby " + file
|
49
49
|
require file
|
50
50
|
end
|
51
51
|
end
|
@@ -57,11 +57,11 @@ namespace :db do
|
|
57
57
|
objects = {}
|
58
58
|
clazz.find( :all ).each do |obj|
|
59
59
|
attributes = obj.attributes
|
60
|
-
attributes.delete("created_at")
|
61
|
-
attributes.delete("updated_at")
|
62
|
-
name = attributes["name"]
|
60
|
+
attributes.delete("created_at")
|
61
|
+
attributes.delete("updated_at")
|
62
|
+
name = attributes["name"]
|
63
63
|
unless name
|
64
|
-
name = args.clazz
|
64
|
+
name = args.clazz
|
65
65
|
name = name + "_" + attributes["id"].to_s if attributes["id"]
|
66
66
|
end
|
67
67
|
name = name.gsub( " " , "_")
|
@@ -70,17 +70,17 @@ namespace :db do
|
|
70
70
|
puts objects.to_yaml
|
71
71
|
end
|
72
72
|
|
73
|
-
desc 'Create the database, load the schema, and initialize with the seed data'
|
74
|
-
task :setup => [ 'db:create', 'db:schema:load', 'db:seed' ]
|
75
|
-
|
73
|
+
desc 'Create the database, load the schema, and initialize with the seed data'
|
74
|
+
task :setup => [ 'db:create', 'db:schema:load', 'db:seed' ]
|
75
|
+
|
76
76
|
desc "Bootstrap is: migrating, loading defaults, sample data and seeding (for all extensions) invoking create_admin and load_products tasks"
|
77
77
|
task :bootstrap => :environment do
|
78
|
-
require 'highline/import'
|
78
|
+
require 'highline/import'
|
79
79
|
require 'authlogic'
|
80
80
|
|
81
81
|
# remigrate unless production mode (as saftey check)
|
82
|
-
if %w[demo development test].include? RAILS_ENV
|
83
|
-
if ENV['AUTO_ACCEPT'] or agree("This task will destroy any data in the database. Are you sure you want to \ncontinue? [
|
82
|
+
if %w[demo development test].include? RAILS_ENV
|
83
|
+
if ENV['AUTO_ACCEPT'] or agree("This task will destroy any data in the database. Are you sure you want to \ncontinue? [y/n] ")
|
84
84
|
ENV['SKIP_NAG'] = 'yes'
|
85
85
|
Rake::Task["db:remigrate"].invoke
|
86
86
|
puts "remigrate"
|
@@ -88,22 +88,22 @@ namespace :db do
|
|
88
88
|
say "Task cancelled, exiting."
|
89
89
|
exit
|
90
90
|
end
|
91
|
-
else
|
91
|
+
else
|
92
92
|
say "NOTE: Bootstrap in production mode will not drop database before migration"
|
93
93
|
Rake::Task["db:migrate"].invoke
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
load_defaults = Country.count == 0
|
97
97
|
unless load_defaults # ask if there are already Countries => default data hass been loaded
|
98
|
-
load_defaults = agree('Countries present, load sample data anyways? [y]: ')
|
98
|
+
load_defaults = agree('Countries present, load sample data anyways? [y/n]: ')
|
99
99
|
end
|
100
100
|
Rake::Task["db:seed"].invoke if load_defaults
|
101
|
-
|
101
|
+
|
102
102
|
if RAILS_ENV == 'production' and Product.count > 0
|
103
|
-
load_sample = agree("WARNING: In Production and products exist in database, load sample data anyways? [y]:" )
|
103
|
+
load_sample = agree("WARNING: In Production and products exist in database, load sample data anyways? [y/n]:" )
|
104
104
|
else
|
105
|
-
load_sample = true if ENV['AUTO_ACCEPT']
|
106
|
-
load_sample = agree('Load Sample Data? [y]: ') unless load_sample
|
105
|
+
load_sample = true if ENV['AUTO_ACCEPT']
|
106
|
+
load_sample = agree('Load Sample Data? [y/n]: ') unless load_sample
|
107
107
|
end
|
108
108
|
Rake::Task["db:sample"].invoke if load_sample
|
109
109
|
|