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,98 @@
|
|
1
|
+
Feature: Checkout
|
2
|
+
In order to be able make checkout
|
3
|
+
Should be able make checkout
|
4
|
+
|
5
|
+
|
6
|
+
Scenario: Visitor make checkout as guest, without registration
|
7
|
+
When I add a product with name: "RoR Mug" to cart
|
8
|
+
Then I should see "Shopping Cart" within "h1"
|
9
|
+
When I follow "Checkout"
|
10
|
+
Then I should see "Registration"
|
11
|
+
|
12
|
+
When I fill in "Email" with "spree@test.com" within "#guest_checkout"
|
13
|
+
And press "Continue"
|
14
|
+
Then I should see "Billing Address" within "legend"
|
15
|
+
And I should see "Shipping Address" within "legend"
|
16
|
+
|
17
|
+
When I fill billing address with correct data
|
18
|
+
And check "checkout_use_billing"
|
19
|
+
And press "Save and Continue"
|
20
|
+
Then I should see "Shipping Method" within "legend"
|
21
|
+
When I fill in "coupon-code" with "SPREE"
|
22
|
+
And press "post-summary"
|
23
|
+
Then I should see "Coupon (SPREE)" within "#summary-order-credits"
|
24
|
+
And I should see "Shipping Method" within "legend"
|
25
|
+
|
26
|
+
When I choose "UPS Ground" as shipping method and "Check" as payment method
|
27
|
+
Then I should see "Your order has been processed successfully"
|
28
|
+
And 1 coupon_credits should exist
|
29
|
+
|
30
|
+
|
31
|
+
Scenario: User make checkout
|
32
|
+
Given I am signed up as "email@person.com/password"
|
33
|
+
When I add a product with name: "RoR Mug" to cart
|
34
|
+
Then I should see "Shopping Cart" within "h1"
|
35
|
+
When I follow "Checkout"
|
36
|
+
Then I should see "Registration"
|
37
|
+
|
38
|
+
When I follow "Log In as Existing Customer"
|
39
|
+
Then I should see "Log In as Existing Customer" within "h2"
|
40
|
+
When I sign in as "email@person.com/password"
|
41
|
+
Then I should see "Billing Address" within "legend"
|
42
|
+
And I should see "Shipping Address" within "legend"
|
43
|
+
|
44
|
+
When I press "Save and Continue"
|
45
|
+
Then I should see "Shipping Method" within "legend"
|
46
|
+
When I fill in "coupon-code" with "SPREE"
|
47
|
+
And press "post-summary"
|
48
|
+
Then I should see "Coupon (SPREE)" within "#summary-order-credits"
|
49
|
+
And I should see "Shipping Method" within "legend"
|
50
|
+
|
51
|
+
When I choose "UPS Ground" as shipping method and "Check" as payment method
|
52
|
+
Then I should see "Your order has been processed successfully"
|
53
|
+
And 1 coupon_credits should exist
|
54
|
+
|
55
|
+
|
56
|
+
Scenario: Uncompleted order associated with user
|
57
|
+
Given I am signed up as "email@person.com/password"
|
58
|
+
When I sign in as "email@person.com/password"
|
59
|
+
Then I should be logged in
|
60
|
+
|
61
|
+
When I add a product with price: "14.99" to cart
|
62
|
+
Then 1 orders should exist with item_total: "14.99"
|
63
|
+
And 0 orders should exist with user_id: nil
|
64
|
+
|
65
|
+
When I follow "Logout"
|
66
|
+
Then I should be logged out
|
67
|
+
And cart should be empty
|
68
|
+
When I add a product with price: "14.99" to cart
|
69
|
+
Then 2 orders should exist with item_total: "14.99"
|
70
|
+
And 1 orders should exist with user_id: nil
|
71
|
+
|
72
|
+
When I sign in as "email@person.com/password"
|
73
|
+
Then 1 orders should exist with item_total: "29.98"
|
74
|
+
And 0 orders should exist with user_id: nil
|
75
|
+
|
76
|
+
|
77
|
+
Scenario: Uncompleted guest order should be associated with user after log in
|
78
|
+
Given I am signed up as "email@person.com/password"
|
79
|
+
|
80
|
+
When I add a product with name: "RoR Mug" to cart
|
81
|
+
Then 1 orders should exist with user_id: nil
|
82
|
+
|
83
|
+
When I go to the sign in page
|
84
|
+
And sign in as "email@person.com/password"
|
85
|
+
Then I should be logged in
|
86
|
+
|
87
|
+
When I follow "Cart"
|
88
|
+
Then I should see "Shopping Cart" within "h1"
|
89
|
+
When I follow "Checkout"
|
90
|
+
Then I should see "Billing Address"
|
91
|
+
And I should see "Shipping Address" within "legend"
|
92
|
+
When I press "Save and Continue"
|
93
|
+
Then I should see "Shipping Method" within "legend"
|
94
|
+
When I choose "UPS Ground" as shipping method and "Check" as payment method
|
95
|
+
Then I should see "Your order has been processed successfully"
|
96
|
+
And 0 orders should exist with user_id: nil
|
97
|
+
|
98
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: Create Admin User
|
2
|
+
In order to manage products in the store
|
3
|
+
As a first time user
|
4
|
+
I should be able to create an admin account
|
5
|
+
|
6
|
+
Scenario: No Admin User
|
7
|
+
Given no users exist with the role: "admin"
|
8
|
+
When I am on the home page
|
9
|
+
Then I should see "Please create a user account"
|
10
|
+
|
11
|
+
Scenario: Create Admin User
|
12
|
+
Given no users exist with the role: "admin"
|
13
|
+
When I am on the home page
|
14
|
+
And I fill in "Email" with "email@person.com"
|
15
|
+
And I fill in "Password" with "password"
|
16
|
+
And I fill in "Confirm" with "password"
|
17
|
+
And I press "Create"
|
18
|
+
Then I should see "User created successfully"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Feature: Search products
|
2
|
+
In order to be able to search products
|
3
|
+
A visitor
|
4
|
+
|
5
|
+
Scenario: Visitor can search products by keywords
|
6
|
+
Given the following products exist:
|
7
|
+
| name | price | available_on | taxon |
|
8
|
+
| Ruby Mug | 15.99 | 2010-03-06 18:48:21 | Ruby |
|
9
|
+
| Ruby Bag | 19.99 | 2010-03-06 18:48:21 | Bag |
|
10
|
+
| Apache Bag | 17.99 | 2010-03-06 18:48:21 | Bag |
|
11
|
+
| Ruby T-Shirt | 16.99 | 2020-03-06 18:48:21 | Ruby |
|
12
|
+
When I go to the homepage
|
13
|
+
And fill in "keywords" with "ruby"
|
14
|
+
And press "Search"
|
15
|
+
Then I should see "Search results for 'ruby'"
|
16
|
+
And I should see "Ruby Mug"
|
17
|
+
And I should see "Ruby Bag"
|
18
|
+
And I should not see "Apache Bag"
|
19
|
+
And I should not see "Ruby T-Shirt"
|
20
|
+
|
21
|
+
When I go to the homepage
|
22
|
+
And fill in "keywords" with "ruby"
|
23
|
+
And select "Ruby" from "taxon"
|
24
|
+
And press "Search"
|
25
|
+
Then I should see "Ruby" within "h1"
|
26
|
+
And I should see "Search results for 'ruby'"
|
27
|
+
And I should see "Ruby Mug"
|
28
|
+
And I should not see "Ruby Bag"
|
29
|
+
And I should not see "Apache Bag"
|
30
|
+
And I should not see "Ruby T-Shirt"
|
31
|
+
|
32
|
+
When I go to the homepage
|
33
|
+
And fill in "keywords" with "hsgfhagsfg"
|
34
|
+
And press "Search"
|
35
|
+
Then I should see "No products found"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Feature: Sign in
|
2
|
+
In order to get access to protected sections of the site
|
3
|
+
A user
|
4
|
+
Should be able to sign in
|
5
|
+
|
6
|
+
Scenario: User is not signed up
|
7
|
+
Given no user exists with an email of "email@person.com"
|
8
|
+
When I go to the sign in page
|
9
|
+
And I sign in as "email@person.com/password"
|
10
|
+
Then I should see error messages
|
11
|
+
And I should be logged out
|
12
|
+
|
13
|
+
Scenario: User enters wrong password
|
14
|
+
Given I am signed up as "email@person.com/password"
|
15
|
+
When I go to the sign in page
|
16
|
+
And I sign in as "email@person.com/wrongpassword"
|
17
|
+
Then I should see error messages
|
18
|
+
And I should be logged out
|
19
|
+
|
20
|
+
Scenario: User signs in successfully
|
21
|
+
Given I am signed up as "email@person.com/password"
|
22
|
+
When I go to the sign in page
|
23
|
+
And I sign in as "email@person.com/password"
|
24
|
+
Then I should see "Logged in"
|
25
|
+
And I should be logged in
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Feature: Sign out
|
2
|
+
In order to remove web session from the browser
|
3
|
+
A user
|
4
|
+
Should be able to sign out
|
5
|
+
|
6
|
+
Scenario: User is signed in
|
7
|
+
Given I am signed up as "email@person.com/password"
|
8
|
+
When I go to the sign in page
|
9
|
+
And I sign in as "email@person.com/password"
|
10
|
+
And I follow "Logout"
|
11
|
+
Then I should see "You have been logged out"
|
12
|
+
And I should be logged out
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Sign up
|
2
|
+
In order to be able to access protected areas of the site
|
3
|
+
A visitor
|
4
|
+
Should be able to sign up
|
5
|
+
|
6
|
+
Scenario: User signs up with invalid data
|
7
|
+
When I go to the sign up page
|
8
|
+
And I fill in "Email" with "invalidemail"
|
9
|
+
And I fill in "Password" with "password"
|
10
|
+
And I fill in "Confirm" with ""
|
11
|
+
And I press "Create"
|
12
|
+
Then I should see error messages
|
13
|
+
|
14
|
+
Scenario: User signs up with valid data
|
15
|
+
When I go to the sign up page
|
16
|
+
And I fill in "Email" with "email@person.com"
|
17
|
+
And I fill in "Password" with "password"
|
18
|
+
And I fill in "Confirm" with "password"
|
19
|
+
And I press "Create"
|
20
|
+
Then I should see "User created successfully"
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# this file generated by script/generate pickle
|
2
|
+
|
3
|
+
# create a model
|
4
|
+
Given(/^#{capture_model} exists?(?: with #{capture_fields})?$/) do |name, fields|
|
5
|
+
create_model(name, fields)
|
6
|
+
end
|
7
|
+
|
8
|
+
# create n models
|
9
|
+
Given(/^(\d+) #{capture_plural_factory} exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
|
10
|
+
count.to_i.times { create_model(plural_factory.singularize, fields) }
|
11
|
+
end
|
12
|
+
|
13
|
+
# create models from a table
|
14
|
+
Given(/^the following #{capture_plural_factory} exists?:?$/) do |plural_factory, table|
|
15
|
+
name = plural_factory.singularize
|
16
|
+
table.hashes.each { |hash| create_model(name, hash) }
|
17
|
+
end
|
18
|
+
|
19
|
+
# find a model
|
20
|
+
Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields|
|
21
|
+
find_model!(name, fields)
|
22
|
+
end
|
23
|
+
|
24
|
+
# not find a model
|
25
|
+
Then(/^#{capture_model} should not exist(?: with #{capture_fields})?$/) do |name, fields|
|
26
|
+
find_model(name, fields).should be_nil
|
27
|
+
end
|
28
|
+
|
29
|
+
# find models with a table
|
30
|
+
Then(/^the following #{capture_plural_factory} should exists?:?$/) do |plural_factory, table|
|
31
|
+
name = plural_factory.singularize
|
32
|
+
table.hashes.each { |hash| find_model!(name, hash)}
|
33
|
+
end
|
34
|
+
|
35
|
+
# find exactly n models
|
36
|
+
Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
|
37
|
+
find_models(plural_factory.singularize, fields).size.should == count.to_i
|
38
|
+
end
|
39
|
+
|
40
|
+
# assert equality of models
|
41
|
+
Then(/^#{capture_model} should be #{capture_model}$/) do |a, b|
|
42
|
+
model!(a).should == model!(b)
|
43
|
+
end
|
44
|
+
|
45
|
+
# assert model is in another model's has_many assoc
|
46
|
+
Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
|
47
|
+
model!(owner).send(association).should include(model!(target))
|
48
|
+
end
|
49
|
+
|
50
|
+
# assert model is not in another model's has_many assoc
|
51
|
+
Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
|
52
|
+
model!(owner).send(association).should_not include(model!(target))
|
53
|
+
end
|
54
|
+
|
55
|
+
# assert model is another model's has_one/belongs_to assoc
|
56
|
+
Then(/^#{capture_model} should be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
|
57
|
+
model!(owner).send(association).should == model!(target)
|
58
|
+
end
|
59
|
+
|
60
|
+
# assert model is not another model's has_one/belongs_to assoc
|
61
|
+
Then(/^#{capture_model} should not be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
|
62
|
+
model!(owner).send(association).should_not == model!(target)
|
63
|
+
end
|
64
|
+
|
65
|
+
# assert model.predicate?
|
66
|
+
Then(/^#{capture_model} should (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
|
67
|
+
model!(name).should send("be_#{predicate.gsub(' ', '_')}")
|
68
|
+
end
|
69
|
+
|
70
|
+
# assert not model.predicate?
|
71
|
+
Then(/^#{capture_model} should not (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
|
72
|
+
model!(name).should_not send("be_#{predicate.gsub(' ', '_')}")
|
73
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Given /^I am signed in as "([^\"]*)"$/ do |email_and_password|
|
2
|
+
email, password = email_and_password.split("/")
|
3
|
+
Given %{I am signed up as "#{email}/#{password}"}
|
4
|
+
When %{I go to the sign in page}
|
5
|
+
And %{I sign in as "#{email}/#{password}"}
|
6
|
+
end
|
7
|
+
|
8
|
+
Then /^I should be logged out$/ do
|
9
|
+
page.should have_css("a[href='#{login_path}']")
|
10
|
+
end
|
11
|
+
|
12
|
+
Then /^I should be logged in$/ do
|
13
|
+
page.should have_css("a[href='#{logout_path}']")
|
14
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
Given /^I am signed up as "([^\"]*)"$/ do |email_and_password|
|
2
|
+
email, password = email_and_password.split("/")
|
3
|
+
@me = Factory(:user,
|
4
|
+
:email => email,
|
5
|
+
:login => email,
|
6
|
+
:password => password,
|
7
|
+
:password_confirmation => password,
|
8
|
+
:bill_address => Factory(:address),
|
9
|
+
:ship_address => Factory(:address))
|
10
|
+
end
|
11
|
+
|
12
|
+
When /^(?:|I )sign in as "([^\"]*)"$/ do |email_and_password|
|
13
|
+
email, password = email_and_password.split("/")
|
14
|
+
|
15
|
+
visit login_path
|
16
|
+
|
17
|
+
fill_in "Email", :with => email
|
18
|
+
fill_in "Password", :with => password
|
19
|
+
|
20
|
+
click_button "Log In"
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
When /^(?:|I )fill (billing|shipping) address with correct data$/ do |address_type|
|
25
|
+
str_addr = address_type[0...4] + "_address"
|
26
|
+
address = @me ? @me.send(str_addr) : Factory(:address)
|
27
|
+
When %{I select "United States" from "Country" within "fieldset##{address_type}"}
|
28
|
+
['firstname', 'lastname', 'address1', 'city', 'state_name', 'zipcode', 'phone'].each do |field|
|
29
|
+
When %{I fill in "checkout_#{str_addr}_attributes_#{field}" with "#{address.send(field)}"}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
When /^(?:|I )add a product with (.*?)? to cart$/ do |captured_fields|
|
34
|
+
fields = {'name' => "RoR Mug", 'count_on_hand' => '10', 'available_on' => "2010-03-06 18:48:21", 'price' => "14.99"}
|
35
|
+
captured_fields.split(/,\s+/).each do |field|
|
36
|
+
(name, value) = field.split(/:\s*/, 2)
|
37
|
+
fields[name] = value.delete('"')
|
38
|
+
end
|
39
|
+
price = fields.delete('price')
|
40
|
+
if Product.master_price_equals(price).count(:conditions => fields) == 0
|
41
|
+
Factory(:product, fields.merge('price' => price))
|
42
|
+
end
|
43
|
+
When %{I go to the products page}
|
44
|
+
Then %{I should see "#{fields['name']}" within "ul.product-listing"}
|
45
|
+
When %{I follow "#{fields['name']}"}
|
46
|
+
Then %{I should see "#{fields['name']}" within "h1"}
|
47
|
+
And %{I should see "$#{price}" within "span.price"}
|
48
|
+
When %{I press "Add To Cart"}
|
49
|
+
end
|
50
|
+
|
51
|
+
When /^I choose "(.*?)" as shipping method and "(.*?)" as payment method$/ do |shiping_method, payment_method|
|
52
|
+
When %{I choose "#{shiping_method}"}
|
53
|
+
And %{press "Save and Continue"}
|
54
|
+
Then %{I should see "Payment Information" within "legend"}
|
55
|
+
|
56
|
+
When %{I choose "#{payment_method}"}
|
57
|
+
And %{press "Save and Continue"}
|
58
|
+
Then %{I should see "Confirm" within "legend"}
|
59
|
+
|
60
|
+
When %{I press "Place Order"}
|
61
|
+
end
|
62
|
+
|
63
|
+
Then /^cart should be empty$/ do
|
64
|
+
Then %{I should not see "Cart: ("}
|
65
|
+
end
|
66
|
+
|
67
|
+
|
@@ -0,0 +1,197 @@
|
|
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
|
+
require 'uri'
|
9
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
10
|
+
|
11
|
+
module WithinHelpers
|
12
|
+
def with_scope(locator)
|
13
|
+
locator ? within(locator) { yield } : yield
|
14
|
+
end
|
15
|
+
end
|
16
|
+
World(WithinHelpers)
|
17
|
+
|
18
|
+
Given /^(?:|I )am on (.+)$/ do |page_name|
|
19
|
+
visit path_to(page_name)
|
20
|
+
end
|
21
|
+
|
22
|
+
When /^(?:|I )go to (.+)$/ do |page_name|
|
23
|
+
visit path_to(page_name)
|
24
|
+
end
|
25
|
+
|
26
|
+
When /^(?:|I )press "([^\"]*)"(?: within "([^\"]*)")?$/ do |button, selector|
|
27
|
+
with_scope(selector) do
|
28
|
+
click_button(button)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
When /^(?:|I )follow "([^\"]*)"(?: within "([^\"]*)")?$/ do |link, selector|
|
33
|
+
with_scope(selector) do
|
34
|
+
click_link(link)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
When /^(?:|I )fill in "([^\"]*)" with "([^\"]*)"(?: within "([^\"]*)")?$/ do |field, value, selector|
|
39
|
+
with_scope(selector) do
|
40
|
+
fill_in(field, :with => value)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
When /^(?:|I )fill in "([^\"]*)" for "([^\"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector|
|
45
|
+
with_scope(selector) do
|
46
|
+
fill_in(field, :with => value)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Use this to fill in an entire form with data from a table. Example:
|
51
|
+
#
|
52
|
+
# When I fill in the following:
|
53
|
+
# | Account Number | 5002 |
|
54
|
+
# | Expiry date | 2009-11-01 |
|
55
|
+
# | Note | Nice guy |
|
56
|
+
# | Wants Email? | |
|
57
|
+
#
|
58
|
+
# TODO: Add support for checkbox, select og option
|
59
|
+
# based on naming conventions.
|
60
|
+
#
|
61
|
+
When /^(?:|I )fill in the following(?: within "([^\"]*)")?:$/ do |selector, fields|
|
62
|
+
with_scope(selector) do
|
63
|
+
fields.rows_hash.each do |name, value|
|
64
|
+
When %{I fill in "#{name}" with "#{value}"}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
When /^(?:|I )select "([^\"]*)" from "([^\"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector|
|
70
|
+
with_scope(selector) do
|
71
|
+
select(value, :from => field)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
When /^(?:|I )check "([^\"]*)"(?: within "([^\"]*)")?$/ do |field, selector|
|
76
|
+
with_scope(selector) do
|
77
|
+
check(field)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
When /^(?:|I )uncheck "([^\"]*)"(?: within "([^\"]*)")?$/ do |field, selector|
|
82
|
+
with_scope(selector) do
|
83
|
+
uncheck(field)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
When /^(?:|I )choose "([^\"]*)"(?: within "([^\"]*)")?$/ do |field, selector|
|
88
|
+
with_scope(selector) do
|
89
|
+
choose(field)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
When /^(?:|I )attach the file "([^\"]*)" to "([^\"]*)"(?: within "([^\"]*)")?$/ do |path, field, selector|
|
94
|
+
with_scope(selector) do
|
95
|
+
attach_file(field, path)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
Then /^(?:|I )should see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, selector|
|
100
|
+
with_scope(selector) do
|
101
|
+
if defined?(Spec::Rails::Matchers)
|
102
|
+
page.should have_content(text)
|
103
|
+
else
|
104
|
+
begin
|
105
|
+
assert page.has_content?(text)
|
106
|
+
rescue Exception => ex
|
107
|
+
puts page.body
|
108
|
+
raise ex
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^\"]*)")?$/ do |regexp, selector|
|
115
|
+
regexp = Regexp.new(regexp)
|
116
|
+
with_scope(selector) do
|
117
|
+
if defined?(Spec::Rails::Matchers)
|
118
|
+
page.should have_xpath('//*', :text => regexp)
|
119
|
+
else
|
120
|
+
assert page.has_xpath?('//*', :text => regexp)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
Then /^(?:|I )should not see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, selector|
|
126
|
+
with_scope(selector) do
|
127
|
+
if defined?(Spec::Rails::Matchers)
|
128
|
+
page.should have_no_content(text)
|
129
|
+
else
|
130
|
+
assert page.has_no_content?(text)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^\"]*)")?$/ do |regexp, selector|
|
136
|
+
regexp = Regexp.new(regexp)
|
137
|
+
with_scope(selector) do
|
138
|
+
if defined?(Spec::Rails::Matchers)
|
139
|
+
page.shoul have_not_xpath('//*', :text => regexp)
|
140
|
+
else
|
141
|
+
assert page.has_not_xpath?('//*', :text => regexp)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
Then /^the "([^\"]*)" field(?: within "([^\"]*)")? should contain "([^\"]*)"$/ do |field, selector, value|
|
147
|
+
with_scope(selector) do
|
148
|
+
if defined?(Spec::Rails::Matchers)
|
149
|
+
find_field(field).value.should =~ /#{value}/
|
150
|
+
else
|
151
|
+
assert_match(/#{value}/, field_labeled(field).value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
Then /^the "([^\"]*)" field(?: within "([^\"]*)")? should not contain "([^\"]*)"$/ do |field, selector, value|
|
157
|
+
with_scope(selector) do
|
158
|
+
if defined?(Spec::Rails::Matchers)
|
159
|
+
find_field(field).value.should_not =~ /#{value}/
|
160
|
+
else
|
161
|
+
assert_no_match(/#{value}/, find_field(field).value)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
Then /^the "([^\"]*)" checkbox(?: within "([^\"]*)")? should be checked$/ do |label, selector|
|
167
|
+
with_scope(selector) do
|
168
|
+
if defined?(Spec::Rails::Matchers)
|
169
|
+
find_field(label)['checked'].should == 'checked'
|
170
|
+
else
|
171
|
+
assert field_labeled(label)['checked'] == 'checked'
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
Then /^the "([^\"]*)" checkbox(?: within "([^\"]*)")? should not be checked$/ do |label, selector|
|
177
|
+
with_scope(selector) do
|
178
|
+
if defined?(Spec::Rails::Matchers)
|
179
|
+
find_field(label)['checked'].should_not == 'checked'
|
180
|
+
else
|
181
|
+
assert field_labeled(label)['checked'] != 'checked'
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
187
|
+
current_path = URI.parse(current_url).select(:path, :query).compact.join('?')
|
188
|
+
if defined?(Spec::Rails::Matchers)
|
189
|
+
current_path.should == path_to(page_name)
|
190
|
+
else
|
191
|
+
assert_equal path_to(page_name), current_path
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
Then /^show me the page$/ do
|
196
|
+
save_and_open_page
|
197
|
+
end
|