From 8ee9c748ec9bff1d90a61a1192e03fa9999c6dfd Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Tue, 8 May 2012 15:36:15 +1000 Subject: [PATCH] initial commit --- .gitignore | 1 + .../screen.css.scssc | Bin 0 -> 112060 bytes Gemfile | 5 + Gemfile.lock | 264 +++ LICENSE | 26 + README.md | 38 + Rakefile | 29 + app/assets/javascripts/admin/spree_auth.js | 1 + app/assets/javascripts/store/spree_auth.js | 1 + app/assets/stylesheets/admin/spree_auth.css | 3 + app/assets/stylesheets/store/spree_auth.css | 3 + .../spree/admin/admin_controller_decorator.rb | 19 + .../admin_orders_controller_decorator.rb | 14 + .../admin_resource_controller_decorator.rb | 3 + .../admin/admin_users_controller_decorator.rb | 21 + .../spree/base_controller_decorator.rb | 10 + .../spree/checkout_controller_decorator.rb | 42 + .../spree/orders_controller_decorator.rb | 15 + .../spree/products_controller_decorator.rb | 13 + .../spree/user_passwords_controller.rb | 40 + .../spree/user_registrations_controller.rb | 58 + .../spree/user_sessions_controller.rb | 51 + app/controllers/spree/users_controller.rb | 51 + app/helpers/spree/users_helper.rb | 15 + app/mailers/spree/user_mailer.rb | 8 + app/models/spree/auth_configuration.rb | 6 + app/models/spree/current_order_decorator.rb | 12 + app/models/spree/order_decorator.rb | 12 + app/models/spree/tokenized_permission.rb | 5 + app/models/spree/user.rb | 89 + app/overrides/admin_payment_methods_index.rb | 7 + .../auth_admin_login_navigation_bar.rb | 5 + app/overrides/auth_admin_user_roles.rb | 6 + app/overrides/auth_shared_login_bar.rb | 7 + app/overrides/auth_user_login_form.rb | 6 + .../spree/admin/banners/_gateway.html.erb | 14 + app/views/spree/admin/users/_roles.html.erb | 12 + .../spree/layouts/admin/_login_nav.html.erb | 8 + app/views/spree/shared/_flashes.html.erb | 9 + app/views/spree/shared/_login.html.erb | 20 + app/views/spree/shared/_login_bar.html.erb | 6 + app/views/spree/shared/_user_form.html.erb | 17 + app/views/spree/shared/unauthorized.html.erb | 0 .../reset_password_instructions.text.erb | 10 + app/views/spree/user_passwords/edit.html.erb | 15 + app/views/spree/user_passwords/new.html.erb | 15 + .../spree/user_registrations/new.html.erb | 22 + .../authorization_failure.html.erb | 4 + app/views/spree/user_sessions/new.html.erb | 13 + app/views/spree/users/edit.html.erb | 11 + app/views/spree/users/show.html.erb | 43 + config.ru | 4 + config/initializers/devise.rb | 141 ++ config/initializers/spree.rb | 1 + config/locales/en.yml | 46 + config/routes.rb | 31 + db/default/users.rb | 76 + ...0101026184950_rename_columns_for_devise.rb | 38 + ...01214150824_convert_user_remember_field.rb | 11 + ...1217012656_create_tokenized_permissions.rb | 13 + ...20101219201531_tokens_for_legacy_orders.rb | 18 + ...07143030_namespace_tokenized_permission.rb | 5 + ...206075712_migrate_tokenized_permissions.rb | 24 + ...d_reset_password_sent_at_to_spree_users.rb | 5 + db/seeds.rb | 5 + lib/spree/auth.rb | 15 + lib/spree/auth/engine.rb | 21 + lib/spree/token_resource.rb | 22 + lib/spree_auth_devise.rb | 1 + lib/tasks/auth.rake | 8 + script/rails | 5 + spec/bar_ability.rb | 17 + .../admin/admin_orders_controller_spec.rb | 56 + .../admin/admin_shipments_controller_spec.rb | 70 + .../admin/admin_users_controller_spec.rb | 45 + spec/controllers/checkout_controller_spec.rb | 171 ++ spec/controllers/orders_controller_spec.rb | 160 ++ spec/controllers/products_controller_spec.rb | 17 + .../user_registrations_controller_spec.rb | 20 + .../user_sessions_controller_spec.rb | 30 + spec/controllers/users_controller_spec.rb | 44 + spec/dummy/README.rdoc | 261 +++ spec/dummy/Rakefile | 7 + .../dummy/app/assets/javascripts/admin/all.js | 10 + .../app/assets/javascripts/application.js | 15 + .../dummy/app/assets/javascripts/store/all.js | 12 + .../app/assets/stylesheets/admin/all.css | 11 + .../app/assets/stylesheets/application.css | 13 + .../app/assets/stylesheets/store/all.css | 11 + .../app/controllers/application_controller.rb | 3 + spec/dummy/app/helpers/application_helper.rb | 2 + spec/dummy/app/mailers/.gitkeep | 0 spec/dummy/app/models/.gitkeep | 0 .../app/views/layouts/application.html.erb | 14 + spec/dummy/config.ru | 4 + spec/dummy/config/application.rb | 71 + spec/dummy/config/boot.rb | 6 + spec/dummy/config/database.yml | 11 + spec/dummy/config/environment.rb | 7 + spec/dummy/config/environments/development.rb | 37 + spec/dummy/config/environments/production.rb | 67 + spec/dummy/config/environments/test.rb | 37 + .../initializers/backtrace_silencers.rb | 7 + spec/dummy/config/initializers/inflections.rb | 15 + spec/dummy/config/initializers/mime_types.rb | 5 + .../dummy/config/initializers/secret_token.rb | 7 + .../config/initializers/session_store.rb | 8 + spec/dummy/config/initializers/spree.rb | 12 + .../config/initializers/wrap_parameters.rb | 14 + spec/dummy/config/locales/en.yml | 5 + spec/dummy/config/routes.rb | 3 + spec/dummy/config/spree.yml | 2 + ...120502190250_spree_zero_nine_zero.spree.rb | 390 ++++ ...reate_indexes_for_inventory_units.spree.rb | 7 + ..._on_hand_to_variants_and_products.spree.rb | 50 + ...90253_change_taxons_to_nested_set.spree.rb | 47 + ...254_move_to_configurable_gateways.spree.rb | 55 + ...add_open_id_authentication_tables.spree.rb | 16 + ...2190256_add_openid_field_to_users.spree.rb | 25 + ...0257_change_preference_value_type.spree.rb | 11 + ...90258_create_billing_integrations.spree.rb | 13 + ...20120502190259_charge_refactoring.spree.rb | 40 + .../20120502190260_add_some_indexes.spree.rb | 12 + ...0502190261_checkout_state_machine.spree.rb | 6 + ...0120502190262_state_for_shipments.spree.rb | 6 + ...263_make_state_events_polymorphic.spree.rb | 13 + ...264_ship_address_id_for_checkouts.spree.rb | 6 + ..._shipping_method_id_for_checkouts.spree.rb | 6 + ...90266_creditcard_last_four_digits.spree.rb | 15 + ...67_populate_legacy_shipment_state.spree.rb | 16 + .../20120502190268_add_cost_price.spree.rb | 6 + ...9_shipment_id_for_inventory_units.spree.rb | 26 + ...190270_cim_fields_for_creditcards.spree.rb | 7 + ...0271_create_return_authorizations.spree.rb | 13 + ..._authorization_to_inventory_units.spree.rb | 6 + .../20120502190273_create_trackers.spree.rb | 11 + ...creditcard_id_for_creditcard_txns.spree.rb | 6 + ...itcard_txn_id_for_creditcard_txns.spree.rb | 6 + ..._test_mode_to_billing_integration.spree.rb | 7 + ...0502190277_create_payment_methods.spree.rb | 17 + ...120502190278_polymorphic_payments.spree.rb | 43 + ...ents_payment_method_to_belongs_to.spree.rb | 12 + ...assign_creditcard_txns_to_payment.spree.rb | 24 + ...120502190281_sti_for_transactions.spree.rb | 16 + ...2190282_drop_billing_integrations.spree.rb | 17 + ...83_deleted_at_for_payment_methods.spree.rb | 15 + ...20502190284_add_adjustments_index.spree.rb | 7 + ...0502190285_add_alt_text_to_images.spree.rb | 6 + ...90286_fix_existing_coupon_credits.spree.rb | 14 + ...87_add_display_to_payment_methods.spree.rb | 6 + ...8_add_addresses_checkouts_indexes.spree.rb | 9 + ...20120502190289_add_icon_to_taxons.spree.rb | 18 + ...2190290_add_description_to_taxons.spree.rb | 12 + ...190291_index_for_shipments_number.spree.rb | 6 + ..._index_on_users_persistence_token.spree.rb | 6 + ...293_add_default_to_tax_categories.spree.rb | 6 + ...4_add_display_to_shipping_methods.spree.rb | 6 + ...295_rename_payment_method_display.spree.rb | 6 + ...02190296_rename_preferences_field.spree.rb | 6 + .../20120502190297_add_guest_flag.spree.rb | 6 + .../20120502190298_drop_order_token.spree.rb | 10 + ..._state_and_assigned_to_order_only.spree.rb | 15 + ...300_create_address_keys_for_order.spree.rb | 7 + ...02190301_payment_total_for_orders.spree.rb | 6 + ...302_shipping_method_id_for_orders.spree.rb | 6 + ...03_add_shipment_and_payment_state.spree.rb | 7 + ...120502190304_refactor_adjustments.spree.rb | 30 + ...ode_and_avs_response_for_payments.spree.rb | 7 + ...06_change_guest_flag_to_anonymous.spree.rb | 6 + .../20120502190307_email_for_orders.spree.rb | 6 + ...0120502190308_create_mail_methods.spree.rb | 11 + ...502190309_rename_frozen_to_locked.spree.rb | 6 + ...ve_special_instructions_to_orders.spree.rb | 11 + ...20120502190311_create_log_entries.spree.rb | 12 + ...ate_transactions_to_payment_state.spree.rb | 99 + ...2190313_delete_in_progress_orders.spree.rb | 20 + ...190314_migrate_checkout_to_orders.spree.rb | 24 + ...120502190315_remove_shipped_state.spree.rb | 13 + ...2190316_prevent_nil_payment_total.spree.rb | 9 + .../20120502190317_prevent_nil_email.spree.rb | 10 + ...02190318_generate_anonymous_users.spree.rb | 21 + ...20120502190319_update_order_state.spree.rb | 13 + ...20502190320_cleanup_legacy_tables.spree.rb | 12 + ...ove_number_and_cvv_from_credicard.spree.rb | 12 + ...322_drop_anonymous_field_for_user.spree.rb | 10 + ...90323_renamed_rma_cancelled_state.spree.rb | 10 + ...90324_fix_problematic_index_names.spree.rb | 14 + ...02190325_add_position_to_variants.spree.rb | 6 + ...26_add_next_state_to_state_events.spree.rb | 6 + ...0327_add_position_to_option_types.spree.rb | 6 + ...iling_slashes_in_taxon_permalinks.spree.rb | 20 + .../20120502190329_create_activators.spree.rb | 15 + ...02190330_eligible_for_adjustments.spree.rb | 6 + ...190331_namespace_top_level_models.spree.rb | 50 + ...ate_namespaced_polymorphic_models.spree.rb | 53 + ...0333_make_adjustments_polymorphic.spree.rb | 10 + ...02190334_add_company_to_addresses.spree.rb | 6 + ...02190335_add_inc_tax_to_tax_rates.spree.rb | 6 + ...190336_rename_inc_price_attribute.spree.rb | 6 + ...120502190337_add_default_tax_zone.spree.rb | 6 + ...g_methods_and_shipping_categories.spree.rb | 8 + ...d_match_rules_to_shipping_methods.spree.rb | 8 + .../20120502190340_new_preferences.spree.rb | 49 + ...ame_state_events_to_state_changes.spree.rb | 10 + ...42_add_deleted_at_to_tax_category.spree.rb | 6 + ..._images_from_products_to_variants.spree.rb | 36 + ...ment_size_to_attachment_file_size.spree.rb | 6 + ...45_rename_columns_for_devise.spree_auth.rb | 39 + ..._convert_user_remember_field.spree_auth.rb | 12 + ...create_tokenized_permissions.spree_auth.rb | 14 + ...348_tokens_for_legacy_orders.spree_auth.rb | 19 + ...mespace_tokenized_permission.spree_auth.rb | 6 + ...igrate_tokenized_permissions.spree_auth.rb | 25 + ...sword_sent_at_to_spree_users.spree_auth.rb | 6 + spec/dummy/db/schema.rb | 543 +++++ spec/dummy/db/seeds.rb | 11 + spec/dummy/db/spree_development.sqlite3 | Bin 0 -> 372736 bytes spec/dummy/db/spree_test.sqlite3 | Bin 0 -> 372736 bytes spec/dummy/lib/assets/.gitkeep | 0 spec/dummy/log/.gitkeep | 0 spec/dummy/log/development.log | 1785 +++++++++++++++++ spec/dummy/log/test.log | 1125 +++++++++++ spec/dummy/public/404.html | 26 + spec/dummy/public/422.html | 26 + spec/dummy/public/500.html | 25 + spec/dummy/public/favicon.ico | 0 spec/dummy/script/rails | 6 + spec/dummy/spec/dummy/script/rails | 6 + spec/lib/token_resource_spec.rb | 32 + spec/models/ability_spec.rb | 251 +++ spec/models/order_spec.rb | 43 + spec/models/user_spec.rb | 66 + spec/requests/account_spec.rb | 52 + spec/requests/admin/products_spec.rb | 9 + spec/requests/admin/users_spec.rb | 21 + spec/requests/admin_permissions_spec.rb | 31 + spec/requests/checkout_spec.rb | 313 +++ spec/requests/order_spec.rb | 8 + spec/requests/password_reset_spec.rb | 18 + spec/requests/sign_in_spec.rb | 41 + spec/requests/sign_out_spec.rb | 26 + spec/requests/sign_up_spec.rb | 27 + spec/requests/user_spec.rb | 35 + spec/spec_helper.rb | 66 + spec/support/authentication_helpers.rb | 13 + spree_auth_devise.gemspec | 22 + 246 files changed, 9456 insertions(+) create mode 100644 .gitignore create mode 100644 .sass-cache/02ac421e5293ed62785f6b25c79d0d54cbcd7332/screen.css.scssc create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 LICENSE create mode 100644 README.md create mode 100644 Rakefile create mode 100644 app/assets/javascripts/admin/spree_auth.js create mode 100644 app/assets/javascripts/store/spree_auth.js create mode 100644 app/assets/stylesheets/admin/spree_auth.css create mode 100644 app/assets/stylesheets/store/spree_auth.css create mode 100644 app/controllers/spree/admin/admin_controller_decorator.rb create mode 100644 app/controllers/spree/admin/admin_orders_controller_decorator.rb create mode 100644 app/controllers/spree/admin/admin_resource_controller_decorator.rb create mode 100644 app/controllers/spree/admin/admin_users_controller_decorator.rb create mode 100644 app/controllers/spree/base_controller_decorator.rb create mode 100644 app/controllers/spree/checkout_controller_decorator.rb create mode 100644 app/controllers/spree/orders_controller_decorator.rb create mode 100644 app/controllers/spree/products_controller_decorator.rb create mode 100644 app/controllers/spree/user_passwords_controller.rb create mode 100644 app/controllers/spree/user_registrations_controller.rb create mode 100644 app/controllers/spree/user_sessions_controller.rb create mode 100644 app/controllers/spree/users_controller.rb create mode 100644 app/helpers/spree/users_helper.rb create mode 100644 app/mailers/spree/user_mailer.rb create mode 100644 app/models/spree/auth_configuration.rb create mode 100644 app/models/spree/current_order_decorator.rb create mode 100644 app/models/spree/order_decorator.rb create mode 100644 app/models/spree/tokenized_permission.rb create mode 100644 app/models/spree/user.rb create mode 100644 app/overrides/admin_payment_methods_index.rb create mode 100644 app/overrides/auth_admin_login_navigation_bar.rb create mode 100644 app/overrides/auth_admin_user_roles.rb create mode 100644 app/overrides/auth_shared_login_bar.rb create mode 100644 app/overrides/auth_user_login_form.rb create mode 100644 app/views/spree/admin/banners/_gateway.html.erb create mode 100644 app/views/spree/admin/users/_roles.html.erb create mode 100644 app/views/spree/layouts/admin/_login_nav.html.erb create mode 100644 app/views/spree/shared/_flashes.html.erb create mode 100644 app/views/spree/shared/_login.html.erb create mode 100644 app/views/spree/shared/_login_bar.html.erb create mode 100644 app/views/spree/shared/_user_form.html.erb create mode 100644 app/views/spree/shared/unauthorized.html.erb create mode 100644 app/views/spree/user_mailer/reset_password_instructions.text.erb create mode 100644 app/views/spree/user_passwords/edit.html.erb create mode 100644 app/views/spree/user_passwords/new.html.erb create mode 100644 app/views/spree/user_registrations/new.html.erb create mode 100644 app/views/spree/user_sessions/authorization_failure.html.erb create mode 100644 app/views/spree/user_sessions/new.html.erb create mode 100644 app/views/spree/users/edit.html.erb create mode 100644 app/views/spree/users/show.html.erb create mode 100644 config.ru create mode 100644 config/initializers/devise.rb create mode 100644 config/initializers/spree.rb create mode 100644 config/locales/en.yml create mode 100644 config/routes.rb create mode 100644 db/default/users.rb create mode 100644 db/migrate/20101026184950_rename_columns_for_devise.rb create mode 100644 db/migrate/20101214150824_convert_user_remember_field.rb create mode 100644 db/migrate/20101217012656_create_tokenized_permissions.rb create mode 100644 db/migrate/20101219201531_tokens_for_legacy_orders.rb create mode 100644 db/migrate/20111007143030_namespace_tokenized_permission.rb create mode 100644 db/migrate/20111206075712_migrate_tokenized_permissions.rb create mode 100644 db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb create mode 100644 db/seeds.rb create mode 100644 lib/spree/auth.rb create mode 100644 lib/spree/auth/engine.rb create mode 100644 lib/spree/token_resource.rb create mode 100644 lib/spree_auth_devise.rb create mode 100644 lib/tasks/auth.rake create mode 100755 script/rails create mode 100644 spec/bar_ability.rb create mode 100644 spec/controllers/admin/admin_orders_controller_spec.rb create mode 100644 spec/controllers/admin/admin_shipments_controller_spec.rb create mode 100644 spec/controllers/admin/admin_users_controller_spec.rb create mode 100644 spec/controllers/checkout_controller_spec.rb create mode 100644 spec/controllers/orders_controller_spec.rb create mode 100644 spec/controllers/products_controller_spec.rb create mode 100644 spec/controllers/user_registrations_controller_spec.rb create mode 100644 spec/controllers/user_sessions_controller_spec.rb create mode 100644 spec/controllers/users_controller_spec.rb create mode 100644 spec/dummy/README.rdoc create mode 100644 spec/dummy/Rakefile create mode 100644 spec/dummy/app/assets/javascripts/admin/all.js create mode 100644 spec/dummy/app/assets/javascripts/application.js create mode 100644 spec/dummy/app/assets/javascripts/store/all.js create mode 100644 spec/dummy/app/assets/stylesheets/admin/all.css create mode 100644 spec/dummy/app/assets/stylesheets/application.css create mode 100644 spec/dummy/app/assets/stylesheets/store/all.css create mode 100644 spec/dummy/app/controllers/application_controller.rb create mode 100644 spec/dummy/app/helpers/application_helper.rb create mode 100644 spec/dummy/app/mailers/.gitkeep create mode 100644 spec/dummy/app/models/.gitkeep create mode 100644 spec/dummy/app/views/layouts/application.html.erb create mode 100644 spec/dummy/config.ru create mode 100644 spec/dummy/config/application.rb create mode 100644 spec/dummy/config/boot.rb create mode 100644 spec/dummy/config/database.yml create mode 100644 spec/dummy/config/environment.rb create mode 100644 spec/dummy/config/environments/development.rb create mode 100644 spec/dummy/config/environments/production.rb create mode 100644 spec/dummy/config/environments/test.rb create mode 100644 spec/dummy/config/initializers/backtrace_silencers.rb create mode 100644 spec/dummy/config/initializers/inflections.rb create mode 100644 spec/dummy/config/initializers/mime_types.rb create mode 100644 spec/dummy/config/initializers/secret_token.rb create mode 100644 spec/dummy/config/initializers/session_store.rb create mode 100644 spec/dummy/config/initializers/spree.rb create mode 100644 spec/dummy/config/initializers/wrap_parameters.rb create mode 100644 spec/dummy/config/locales/en.yml create mode 100644 spec/dummy/config/routes.rb create mode 100644 spec/dummy/config/spree.yml create mode 100644 spec/dummy/db/migrate/20120502190250_spree_zero_nine_zero.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190251_create_indexes_for_inventory_units.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190252_add_count_on_hand_to_variants_and_products.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190253_change_taxons_to_nested_set.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190254_move_to_configurable_gateways.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190255_add_open_id_authentication_tables.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190256_add_openid_field_to_users.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190257_change_preference_value_type.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190258_create_billing_integrations.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190259_charge_refactoring.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190260_add_some_indexes.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190261_checkout_state_machine.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190262_state_for_shipments.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190263_make_state_events_polymorphic.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190264_ship_address_id_for_checkouts.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190265_shipping_method_id_for_checkouts.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190266_creditcard_last_four_digits.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190267_populate_legacy_shipment_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190268_add_cost_price.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190269_shipment_id_for_inventory_units.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190270_cim_fields_for_creditcards.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190271_create_return_authorizations.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190272_add_return_authorization_to_inventory_units.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190273_create_trackers.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190274_creditcard_id_for_creditcard_txns.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190275_original_creditcard_txn_id_for_creditcard_txns.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190276_add_test_mode_to_billing_integration.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190277_create_payment_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190278_polymorphic_payments.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190279_change_payments_payment_method_to_belongs_to.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190280_assign_creditcard_txns_to_payment.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190281_sti_for_transactions.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190282_drop_billing_integrations.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190283_deleted_at_for_payment_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190284_add_adjustments_index.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190285_add_alt_text_to_images.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190286_fix_existing_coupon_credits.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190287_add_display_to_payment_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190288_add_addresses_checkouts_indexes.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190289_add_icon_to_taxons.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190290_add_description_to_taxons.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190291_index_for_shipments_number.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190292_add_index_on_users_persistence_token.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190293_add_default_to_tax_categories.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190294_add_display_to_shipping_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190295_rename_payment_method_display.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190296_rename_preferences_field.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190297_add_guest_flag.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190298_drop_order_token.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190299_payments_state_and_assigned_to_order_only.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190300_create_address_keys_for_order.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190301_payment_total_for_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190302_shipping_method_id_for_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190303_add_shipment_and_payment_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190304_refactor_adjustments.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190305_response_code_and_avs_response_for_payments.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190306_change_guest_flag_to_anonymous.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190307_email_for_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190308_create_mail_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190309_rename_frozen_to_locked.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190310_move_special_instructions_to_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190311_create_log_entries.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190312_migrate_transactions_to_payment_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190313_delete_in_progress_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190314_migrate_checkout_to_orders.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190315_remove_shipped_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190316_prevent_nil_payment_total.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190317_prevent_nil_email.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190318_generate_anonymous_users.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190319_update_order_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190320_cleanup_legacy_tables.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190321_remove_number_and_cvv_from_credicard.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190322_drop_anonymous_field_for_user.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190323_renamed_rma_cancelled_state.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190324_fix_problematic_index_names.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190325_add_position_to_variants.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190326_add_next_state_to_state_events.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190327_add_position_to_option_types.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190328_remove_trailing_slashes_in_taxon_permalinks.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190329_create_activators.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190330_eligible_for_adjustments.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190331_namespace_top_level_models.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190332_migrate_namespaced_polymorphic_models.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190333_make_adjustments_polymorphic.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190334_add_company_to_addresses.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190335_add_inc_tax_to_tax_rates.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190336_rename_inc_price_attribute.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190337_add_default_tax_zone.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190338_associate_shipping_methods_and_shipping_categories.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190339_add_match_rules_to_shipping_methods.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190340_new_preferences.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190341_rename_state_events_to_state_changes.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190342_add_deleted_at_to_tax_category.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190343_migrate_images_from_products_to_variants.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190344_rename_attachment_size_to_attachment_file_size.spree.rb create mode 100644 spec/dummy/db/migrate/20120502190345_rename_columns_for_devise.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190346_convert_user_remember_field.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190347_create_tokenized_permissions.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190348_tokens_for_legacy_orders.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190349_namespace_tokenized_permission.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190350_migrate_tokenized_permissions.spree_auth.rb create mode 100644 spec/dummy/db/migrate/20120502190351_add_reset_password_sent_at_to_spree_users.spree_auth.rb create mode 100644 spec/dummy/db/schema.rb create mode 100644 spec/dummy/db/seeds.rb create mode 100644 spec/dummy/db/spree_development.sqlite3 create mode 100644 spec/dummy/db/spree_test.sqlite3 create mode 100644 spec/dummy/lib/assets/.gitkeep create mode 100644 spec/dummy/log/.gitkeep create mode 100644 spec/dummy/log/development.log create mode 100644 spec/dummy/log/test.log create mode 100644 spec/dummy/public/404.html create mode 100644 spec/dummy/public/422.html create mode 100644 spec/dummy/public/500.html create mode 100644 spec/dummy/public/favicon.ico create mode 100755 spec/dummy/script/rails create mode 100644 spec/dummy/spec/dummy/script/rails create mode 100644 spec/lib/token_resource_spec.rb create mode 100644 spec/models/ability_spec.rb create mode 100644 spec/models/order_spec.rb create mode 100644 spec/models/user_spec.rb create mode 100644 spec/requests/account_spec.rb create mode 100644 spec/requests/admin/products_spec.rb create mode 100644 spec/requests/admin/users_spec.rb create mode 100644 spec/requests/admin_permissions_spec.rb create mode 100644 spec/requests/checkout_spec.rb create mode 100644 spec/requests/order_spec.rb create mode 100644 spec/requests/password_reset_spec.rb create mode 100644 spec/requests/sign_in_spec.rb create mode 100644 spec/requests/sign_out_spec.rb create mode 100644 spec/requests/sign_up_spec.rb create mode 100644 spec/requests/user_spec.rb create mode 100644 spec/spec_helper.rb create mode 100644 spec/support/authentication_helpers.rb create mode 100644 spree_auth_devise.gemspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b04600ab --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +sandbox diff --git a/.sass-cache/02ac421e5293ed62785f6b25c79d0d54cbcd7332/screen.css.scssc b/.sass-cache/02ac421e5293ed62785f6b25c79d0d54cbcd7332/screen.css.scssc new file mode 100644 index 0000000000000000000000000000000000000000..24556c5772b3944078306d84d2a389fdda1a0479 GIT binary patch literal 112060 zcmd_T37n-#RVUi{fmM}D?Oj#fO}Bl?Y^t}qSy_8^CJkS&EOtXfHQ3k>lUsSe%DmLg zyve;cYoTdZ6q@~s;<&+xJ{eITF6cNS?i--sh8qr`!;?`F$A$M39C7|9PMq^aeDTHI zvT%IAm;LMR%o7nOBF+{kPMnDE*zA$nBPS}i+}*A<)-G4>&br;pw@%z~_E_z7y?*qL zrDMmAoH~B;#HrfR+PQPJ<3~>&J3e>r=*jHJsrrf9@rfsIYt3JKrq=1q&p+JGvibQJ zwp!iiwd&c#{6yMptYwWY^V`$bdbiP9>pXVV{EoDnt*$p~-E2Df%+lf8sssJpc6j3O zZIydk%~rdE-v(+^MWczEmKK*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Zu!>pqhgJ9vqQ*&|2qa=ec)Ppe1526~E6m`c**b)JeU zOysU4M-L>9V5Aac{dqi781bwmNAGc_#GYEGQO{=RKmOe!T^7D3PLKhK{&n0{#}Td=#%*a9{7P(DoK-nw*29{x&o7Lp2^?lqV5hI z^`=ox@SI&C2je1wL?w8?x#But3KOv`2sxxBf{jY>WHVt?u~e8~%M(qth-5NIH2rqw u==K?UtO3FIGPnFc#JSkVo_UN!SCJV}NtztC^x+j$VMdi?bfEX4hyNFG5+lw4 literal 0 HcmV?d00001 diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..af51fbf0 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb')) + +gem 'spree_core', :path => '../core' + +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..da801eff --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,264 @@ +PATH + remote: . + specs: + spree_auth (1.1.0) + cancan (= 1.6.7) + devise (~> 2.0) + spree_core (= 1.1.0) + +PATH + remote: ../core + specs: + spree_core (1.1.0) + activemerchant (= 1.20.4) + acts_as_list (= 0.1.4) + aws-sdk (~> 1.3.4) + deface (>= 0.8.0) + ffaker (~> 1.12.0) + highline (= 1.6.11) + jquery-rails (~> 2.0.0) + kaminari (>= 0.13.0) + nested_set (= 1.7.0) + paperclip (~> 2.7) + rails (>= 3.2.2, <= 3.2.3) + ransack (~> 0.6.0) + state_machine (= 1.1.2) + stringex (~> 1.3.2) + +GEM + remote: http://rubygems.org/ + specs: + actionmailer (3.2.3) + actionpack (= 3.2.3) + mail (~> 2.4.4) + actionpack (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.1) + rack (~> 1.4.0) + rack-cache (~> 1.2) + rack-test (~> 0.6.1) + sprockets (~> 2.1.2) + active_utils (1.0.3) + activesupport (>= 2.3.11) + i18n + activemerchant (1.20.4) + active_utils (>= 1.0.2) + activesupport (>= 2.3.11) + braintree (>= 2.0.0) + builder (>= 2.0.0) + i18n + json (>= 1.5.1) + money (<= 3.7.1) + activemodel (3.2.3) + activesupport (= 3.2.3) + builder (~> 3.0.0) + activerecord (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) + arel (~> 3.0.2) + tzinfo (~> 0.3.29) + activeresource (3.2.3) + activemodel (= 3.2.3) + activesupport (= 3.2.3) + activesupport (3.2.3) + i18n (~> 0.6) + multi_json (~> 1.0) + acts_as_list (0.1.4) + addressable (2.2.7) + arel (3.0.2) + aws-sdk (1.3.9) + httparty (~> 0.7) + json (~> 1.4) + nokogiri (>= 1.4.4) + uuidtools (~> 2.1) + bcrypt-ruby (3.0.1) + braintree (2.16.0) + builder (>= 2.0.0) + builder (3.0.0) + cancan (1.6.7) + capybara (1.1.2) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (~> 2.0) + xpath (~> 0.1.4) + childprocess (0.3.1) + ffi (~> 1.0.6) + cocaine (0.2.1) + coffee-rails (3.2.2) + coffee-script (>= 2.2.0) + railties (~> 3.2.0) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.2.0) + database_cleaner (0.7.1) + deface (0.8.0) + nokogiri (~> 1.5.0) + rails (>= 3.0.9) + devise (2.0.4) + bcrypt-ruby (~> 3.0) + orm_adapter (~> 0.0.3) + railties (~> 3.1) + warden (~> 1.1.1) + diff-lcs (1.1.3) + email_spec (1.2.1) + mail (~> 2.2) + rspec (~> 2.0) + erubis (2.7.0) + execjs (1.3.0) + multi_json (~> 1.0) + factory_girl (2.6.4) + activesupport (>= 2.3.9) + factory_girl_rails (1.7.0) + factory_girl (~> 2.6.0) + railties (>= 3.0.0) + ffaker (1.12.1) + ffi (1.0.11) + guard (1.0.1) + ffi (>= 0.5.0) + thor (~> 0.14.6) + guard-rspec (0.5.11) + guard (>= 0.8.4) + highline (1.6.11) + hike (1.2.1) + httparty (0.8.3) + multi_json (~> 1.0) + multi_xml + i18n (0.6.0) + journey (1.0.3) + jquery-rails (2.0.2) + railties (>= 3.2.0, < 5.0) + thor (~> 0.14) + json (1.6.6) + kaminari (0.13.0) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + railties (>= 3.0.0) + launchy (2.1.0) + addressable (~> 2.2.6) + mail (2.4.4) + i18n (>= 0.4.0) + mime-types (~> 1.16) + treetop (~> 1.4.8) + mime-types (1.18) + money (3.7.1) + i18n (~> 0.4) + multi_json (1.2.0) + multi_xml (0.4.4) + mysql2 (0.3.11) + nested_set (1.7.0) + activerecord (>= 3.0.0) + railties (>= 3.0.0) + nokogiri (1.5.2) + orm_adapter (0.0.7) + paperclip (2.7.0) + activerecord (>= 2.3.0) + activesupport (>= 2.3.2) + cocaine (>= 0.0.2) + mime-types + pg (0.13.2) + polyamorous (0.5.0) + activerecord (~> 3.0) + polyglot (0.3.3) + rack (1.4.1) + rack-cache (1.2) + rack (>= 0.4) + rack-ssl (1.3.2) + rack + rack-test (0.6.1) + rack (>= 1.0) + rails (3.2.3) + actionmailer (= 3.2.3) + actionpack (= 3.2.3) + activerecord (= 3.2.3) + activeresource (= 3.2.3) + activesupport (= 3.2.3) + bundler (~> 1.0) + railties (= 3.2.3) + railties (3.2.3) + actionpack (= 3.2.3) + activesupport (= 3.2.3) + rack-ssl (~> 1.3.2) + rake (>= 0.8.7) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + ransack (0.6.0) + actionpack (~> 3.0) + activerecord (~> 3.0) + polyamorous (~> 0.5.0) + rdoc (3.12) + json (~> 1.4) + rspec (2.9.0) + rspec-core (~> 2.9.0) + rspec-expectations (~> 2.9.0) + rspec-mocks (~> 2.9.0) + rspec-core (2.9.0) + rspec-expectations (2.9.1) + diff-lcs (~> 1.1.3) + rspec-mocks (2.9.0) + rspec-rails (2.9.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec (~> 2.9.0) + rubyzip (0.9.6.1) + sass (3.1.15) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + selenium-webdriver (2.20.0) + childprocess (>= 0.2.5) + ffi (~> 1.0) + multi_json (~> 1.0) + rubyzip + shoulda-matchers (1.0.0) + sprockets (2.1.2) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.5) + state_machine (1.1.2) + stringex (1.3.3) + thor (0.14.6) + tilt (1.3.3) + treetop (1.4.10) + polyglot + polyglot (>= 0.3.1) + tzinfo (0.3.33) + uuidtools (2.1.2) + warden (1.1.1) + rack (>= 1.0) + xpath (0.1.4) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + capybara + coffee-rails (~> 3.2) + database_cleaner (= 0.7.1) + email_spec (~> 1.2.1) + factory_girl_rails (~> 1.7.0) + ffaker + guard + guard-rspec (~> 0.5.0) + json + launchy + multi_json (= 1.2.0) + mysql2 + pg + rspec-rails (~> 2.9.0) + sass-rails (~> 3.2) + selenium-webdriver (= 2.20.0) + shoulda-matchers (~> 1.0.0) + spree_auth! + spree_core! + sqlite3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..74f73e35 --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2007-2012, Spree Commerce, Inc. and other contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Spree nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..6c6ffc49 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Authentication +============== + +Provides authentication and authorization services for use with Spree + + +Overview +-------- + +This gem provides the so-called "core" functionality of Spree and is a requirement for any Spree application or +store. The basic data models as well as product catalog and admin functionality are all provided by this gem. + + +Security Warning +---------------- + +*This gem provides absolutely no authentication and authorization. You are strongly encouraged to install +and use the spree-auth gem in addition to spree-core in order to restrict access to orders and other admin +functionality.* + + +Testing +------- + +You need to do a quick one-time creation of a test application and then you can use it to run the tests. + + bundle exec rake test_app + +Then run the rspec tests + + bundle exec rake spec + +Misc +---- + +authentication by token example + + http://localhost:3000/?auth_token=oWBSN16k6dWx46TtSGcp diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..649c8389 --- /dev/null +++ b/Rakefile @@ -0,0 +1,29 @@ +require 'rubygems' +require 'rake' +require 'rake/testtask' +require 'rake/packagetask' +require 'rubygems/package_task' +require 'rspec/core/rake_task' +require 'spree/core/testing_support/common_rake' + +RSpec::Core::RakeTask.new + +task :default => :spec + +spec = eval(File.read('spree_auth.gemspec')) + +Gem::PackageTask.new(spec) do |p| + p.gem_spec = spec +end + +desc 'Release to gemcutter' +task :release do + version = File.read(File.expand_path('../../SPREE_VERSION', __FILE__)).strip + cmd = "cd pkg && gem push spree_auth-#{version}.gem"; puts cmd; system cmd +end + +desc 'Generates a dummy app for testing' +task :test_app do + ENV['LIB_NAME'] = 'spree/auth' + Rake::Task['common:test_app'].invoke +end diff --git a/app/assets/javascripts/admin/spree_auth.js b/app/assets/javascripts/admin/spree_auth.js new file mode 100644 index 00000000..a3b2c532 --- /dev/null +++ b/app/assets/javascripts/admin/spree_auth.js @@ -0,0 +1 @@ +//= require admin/spree_core diff --git a/app/assets/javascripts/store/spree_auth.js b/app/assets/javascripts/store/spree_auth.js new file mode 100644 index 00000000..d5cb5c75 --- /dev/null +++ b/app/assets/javascripts/store/spree_auth.js @@ -0,0 +1 @@ +//= require store/spree_core diff --git a/app/assets/stylesheets/admin/spree_auth.css b/app/assets/stylesheets/admin/spree_auth.css new file mode 100644 index 00000000..21ef02a6 --- /dev/null +++ b/app/assets/stylesheets/admin/spree_auth.css @@ -0,0 +1,3 @@ +/* + *= require admin/spree_core +*/ diff --git a/app/assets/stylesheets/store/spree_auth.css b/app/assets/stylesheets/store/spree_auth.css new file mode 100644 index 00000000..94dbe33a --- /dev/null +++ b/app/assets/stylesheets/store/spree_auth.css @@ -0,0 +1,3 @@ +/* + *= require store/spree_core +*/ diff --git a/app/controllers/spree/admin/admin_controller_decorator.rb b/app/controllers/spree/admin/admin_controller_decorator.rb new file mode 100644 index 00000000..489c8a74 --- /dev/null +++ b/app/controllers/spree/admin/admin_controller_decorator.rb @@ -0,0 +1,19 @@ +require File.expand_path('../../base_controller_decorator', __FILE__) +Spree::Admin::BaseController.class_eval do + before_filter :authorize_admin + + def authorize_admin + begin + record = model_class.new + rescue + record = Object.new + end + authorize! :admin, record + authorize! params[:action].to_sym, record + end + + protected + def model_class + "Spree::#{controller_name.classify}".constantize + end +end diff --git a/app/controllers/spree/admin/admin_orders_controller_decorator.rb b/app/controllers/spree/admin/admin_orders_controller_decorator.rb new file mode 100644 index 00000000..c506ecfd --- /dev/null +++ b/app/controllers/spree/admin/admin_orders_controller_decorator.rb @@ -0,0 +1,14 @@ +Spree::Admin::OrdersController.class_eval do + before_filter :check_authorization + + private + def check_authorization + load_order + session[:access_token] ||= params[:token] + + resource = @order || Spree::Order.new + action = params[:action].to_sym + + authorize! action, resource, session[:access_token] + end +end diff --git a/app/controllers/spree/admin/admin_resource_controller_decorator.rb b/app/controllers/spree/admin/admin_resource_controller_decorator.rb new file mode 100644 index 00000000..03490679 --- /dev/null +++ b/app/controllers/spree/admin/admin_resource_controller_decorator.rb @@ -0,0 +1,3 @@ +Spree::Admin::ResourceController.class_eval do + rescue_from CanCan::AccessDenied, :with => :unauthorized +end diff --git a/app/controllers/spree/admin/admin_users_controller_decorator.rb b/app/controllers/spree/admin/admin_users_controller_decorator.rb new file mode 100644 index 00000000..aadfcf14 --- /dev/null +++ b/app/controllers/spree/admin/admin_users_controller_decorator.rb @@ -0,0 +1,21 @@ +require File.expand_path('../../base_controller_decorator', __FILE__) +Spree::Admin::UsersController.class_eval do + rescue_from Spree::User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error + + update.after :sign_in_if_change_own_password + + before_filter :load_roles, :only => [:edit, :new, :update, :create] + + private + + def sign_in_if_change_own_password + if current_user == @user && @user.password.present? + sign_in(@user, :event => :authentication, :bypass => true) + end + end + + def load_roles + @roles = Spree::Role.scoped + end +end + diff --git a/app/controllers/spree/base_controller_decorator.rb b/app/controllers/spree/base_controller_decorator.rb new file mode 100644 index 00000000..dc413791 --- /dev/null +++ b/app/controllers/spree/base_controller_decorator.rb @@ -0,0 +1,10 @@ +Spree::BaseController.class_eval do + def store_location + # disallow return to login, logout, signup pages + disallowed_urls = [spree.signup_url, spree.login_url, spree.destroy_user_session_path] + disallowed_urls.map!{ |url| url[/\/\w+$/] } + unless disallowed_urls.include?(request.fullpath) + session['user_return_to'] = request.fullpath.gsub('//', '/') + end + end +end diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb new file mode 100644 index 00000000..1c4e52f7 --- /dev/null +++ b/app/controllers/spree/checkout_controller_decorator.rb @@ -0,0 +1,42 @@ +Spree::CheckoutController.class_eval do + before_filter :check_authorization + before_filter :check_registration, :except => [:registration, :update_registration] + + helper 'spree/users' + + def registration + @user = Spree::User.new + end + + def update_registration + fire_event("spree.user.signup", :order => current_order) + # hack - temporarily change the state to something other than cart so we can validate the order email address + current_order.state = 'address' + if current_order.update_attributes(params[:order]) + redirect_to checkout_path + else + @user = Spree::User.new + render 'registration' + end + end + + private + def check_authorization + authorize!(:edit, current_order, session[:access_token]) + end + + # Introduces a registration step whenever the +registration_step+ preference is true. + def check_registration + return unless Spree::Auth::Config[:registration_step] + return if current_user or current_order.email + store_location + redirect_to spree.checkout_registration_path + end + + # Overrides the equivalent method defined in Spree::Core. This variation of the method will ensure that users + # are redirected to the tokenized order url unless authenticated as a registered user. + def completion_route + return order_path(@order) if current_user + spree.token_order_path(@order, @order.token) + end +end diff --git a/app/controllers/spree/orders_controller_decorator.rb b/app/controllers/spree/orders_controller_decorator.rb new file mode 100644 index 00000000..5030df61 --- /dev/null +++ b/app/controllers/spree/orders_controller_decorator.rb @@ -0,0 +1,15 @@ +Spree::OrdersController.class_eval do + before_filter :check_authorization + + private + def check_authorization + session[:access_token] ||= params[:token] + order = Spree::Order.find_by_number(params[:id]) || current_order + + if order + authorize! :edit, order, session[:access_token] + else + authorize! :create, Spree::Order.new + end + end +end diff --git a/app/controllers/spree/products_controller_decorator.rb b/app/controllers/spree/products_controller_decorator.rb new file mode 100644 index 00000000..c7becf3a --- /dev/null +++ b/app/controllers/spree/products_controller_decorator.rb @@ -0,0 +1,13 @@ +Spree::ProductsController.class_eval do + rescue_from CanCan::AccessDenied, :with => :render_404 + + private + def load_product + @product = Spree::Product.find_by_permalink!(params[:id]) + if !@product.deleted? && (@product.available_on.nil? || @product.available_on.future?) + # Allow admins to view any yet to be available products + raise CanCan::AccessDenied unless current_user && current_user.admin? + end + end +end + diff --git a/app/controllers/spree/user_passwords_controller.rb b/app/controllers/spree/user_passwords_controller.rb new file mode 100644 index 00000000..e56584cb --- /dev/null +++ b/app/controllers/spree/user_passwords_controller.rb @@ -0,0 +1,40 @@ +class Spree::UserPasswordsController < Devise::PasswordsController + include Spree::Core::ControllerHelpers + helper 'spree/users', 'spree/base' + + ssl_required + + after_filter :associate_user + + def new + super + end + + # Temporary Override until next Devise release (i.e after v1.3.4) + # line: + # respond_with resource, :location => new_session_path(resource_name) + # is generating bad url /session/new.user + # + # overridden to: + # respond_with resource, :location => login_path + # + def create + self.resource = resource_class.send_reset_password_instructions(params[resource_name]) + + if resource.errors.empty? + set_flash_message(:notice, :send_instructions) if is_navigational_format? + respond_with resource, :location => spree.login_path + else + respond_with_navigational(resource) { render :new } + end + end + + def edit + super + end + + def update + super + end + +end diff --git a/app/controllers/spree/user_registrations_controller.rb b/app/controllers/spree/user_registrations_controller.rb new file mode 100644 index 00000000..0347a0bb --- /dev/null +++ b/app/controllers/spree/user_registrations_controller.rb @@ -0,0 +1,58 @@ +class Spree::UserRegistrationsController < Devise::RegistrationsController + include Spree::Core::ControllerHelpers + helper 'spree/users', 'spree/base' + + ssl_required + after_filter :associate_user, :only => :create + before_filter :check_permissions, :only => [:edit, :update] + skip_before_filter :require_no_authentication + + # GET /resource/sign_up + def new + super + end + + # POST /resource/sign_up + def create + @user = build_resource(params[:user]) + if resource.save + set_flash_message(:notice, :signed_up) + sign_in(:user, @user) + fire_event('spree.user.signup', :user => @user, :order => current_order(true)) + sign_in_and_redirect(:user, @user) + else + clean_up_passwords(resource) + render :new + end + end + + # GET /resource/edit + def edit + super + end + + # PUT /resource + def update + super + end + + # DELETE /resource + def destroy + super + end + + # GET /resource/cancel + # Forces the session data which is usually expired after sign + # in to be expired now. This is useful if the user wants to + # cancel oauth signing in/up in the middle of the process, + # removing all OAuth session data. + def cancel + super + end + + protected + def check_permissions + authorize!(:create, resource) + end + +end diff --git a/app/controllers/spree/user_sessions_controller.rb b/app/controllers/spree/user_sessions_controller.rb new file mode 100644 index 00000000..eb6f0910 --- /dev/null +++ b/app/controllers/spree/user_sessions_controller.rb @@ -0,0 +1,51 @@ +class Spree::UserSessionsController < Devise::SessionsController + include Spree::Core::ControllerHelpers + helper 'spree/users', 'spree/base' + + include Spree::Core::CurrentOrder + + after_filter :associate_user, :only => :create + + ssl_required :new, :create, :destroy, :update + ssl_allowed :login_bar + + # GET /resource/sign_in + def new + super + end + + def create + authenticate_user! + + if user_signed_in? + respond_to do |format| + format.html { + flash.notice = t(:logged_in_succesfully) + redirect_back_or_default(products_path) + } + format.js { + user = resource.record + render :json => {:ship_address => user.ship_address, :bill_address => user.bill_address}.to_json + } + end + else + flash.now[:error] = t('devise.failure.invalid') + render :new + end + end + + def destroy + cookies.clear + session.clear + super + end + + def nav_bar + render :partial => 'spree/shared/nav_bar' + end + + private + def accurate_title + t(:login) + end +end diff --git a/app/controllers/spree/users_controller.rb b/app/controllers/spree/users_controller.rb new file mode 100644 index 00000000..a99d23f8 --- /dev/null +++ b/app/controllers/spree/users_controller.rb @@ -0,0 +1,51 @@ +class Spree::UsersController < Spree::BaseController + ssl_required + prepend_before_filter :load_object, :only => [:show, :edit, :update] + prepend_before_filter :authorize_actions, :only => :new + + def show + @orders = @user.orders.complete + end + + def create + @user = Spree::User.new(params[:user]) + if @user.save + + if current_order + current_order.associate_user!(@user) + session[:guest_token] = nil + end + + redirect_back_or_default(root_url) + else + render :new + end + end + + def update + if @user.update_attributes(params[:user]) + if params[:user][:password].present? + # this logic needed b/c devise wants to log us out after password changes + user = Spree::User.reset_password_by_token(params[:user]) + sign_in(@user, :event => :authentication, :bypass => !Spree::Auth::Config[:signout_after_password_change]) + end + redirect_to spree.account_url, :notice => t(:account_updated) + else + render :edit + end + end + + private + def load_object + @user ||= current_user + authorize! params[:action].to_sym, @user + end + + def authorize_actions + authorize! params[:action].to_sym, Spree::User.new + end + + def accurate_title + t(:my_account) + end +end diff --git a/app/helpers/spree/users_helper.rb b/app/helpers/spree/users_helper.rb new file mode 100644 index 00000000..553ad427 --- /dev/null +++ b/app/helpers/spree/users_helper.rb @@ -0,0 +1,15 @@ +module Spree + module UsersHelper + def password_style(user) + ActiveSupport::Deprecation.warn '[SPREE] Password style has be depreciated due to the removal of OpenID from the Auth Gem. ' + 'Please install the spree_social gem to regain this functionality and more.' + '' + end + + def openid_style(user) + ActiveSupport::Deprecation.warn '[SPREE] Password style has be depreciated due to the removal of OpenID from the Auth Gem. ' + 'Please install the spree_social gem to regain this functionality and more.' + 'display:none' + end + end +end \ No newline at end of file diff --git a/app/mailers/spree/user_mailer.rb b/app/mailers/spree/user_mailer.rb new file mode 100644 index 00000000..feaf5745 --- /dev/null +++ b/app/mailers/spree/user_mailer.rb @@ -0,0 +1,8 @@ +class Spree::UserMailer < ActionMailer::Base + def reset_password_instructions(user) + @edit_password_reset_url = spree.edit_user_password_url(:reset_password_token => user.reset_password_token) + + mail(:to => user.email, + :subject => Spree::Config[:site_name] + ' ' + I18n.t(:password_reset_instructions)) + end +end diff --git a/app/models/spree/auth_configuration.rb b/app/models/spree/auth_configuration.rb new file mode 100644 index 00000000..f4ccc91f --- /dev/null +++ b/app/models/spree/auth_configuration.rb @@ -0,0 +1,6 @@ +module Spree + class AuthConfiguration < Preferences::Configuration + preference :registration_step, :boolean, :default => true + preference :signout_after_password_change, :boolean, :default => true + end +end diff --git a/app/models/spree/current_order_decorator.rb b/app/models/spree/current_order_decorator.rb new file mode 100644 index 00000000..60df66ab --- /dev/null +++ b/app/models/spree/current_order_decorator.rb @@ -0,0 +1,12 @@ +Spree::Core::CurrentOrder.module_eval do + # Associate the new order with the currently authenticated user before saving + def before_save_new_order + @current_order.user ||= current_user + end + + def after_save_new_order + # make sure the user has permission to access the order (if they are a guest) + return if current_user + session[:access_token] = @current_order.token + end +end diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb new file mode 100644 index 00000000..4ba963d9 --- /dev/null +++ b/app/models/spree/order_decorator.rb @@ -0,0 +1,12 @@ +Spree::Order.class_eval do + token_resource + + # Associates the specified user with the order and destroys any previous association with guest user if + # necessary. + def associate_user!(user) + self.user = user + self.email = user.email + # disable validations since this can cause issues when associating an incomplete address during the address step + save(:validate => false) + end +end diff --git a/app/models/spree/tokenized_permission.rb b/app/models/spree/tokenized_permission.rb new file mode 100644 index 00000000..8c2411f4 --- /dev/null +++ b/app/models/spree/tokenized_permission.rb @@ -0,0 +1,5 @@ +module Spree + class TokenizedPermission < ActiveRecord::Base + belongs_to :permissable, :polymorphic => true + end +end diff --git a/app/models/spree/user.rb b/app/models/spree/user.rb new file mode 100644 index 00000000..95aa2b19 --- /dev/null +++ b/app/models/spree/user.rb @@ -0,0 +1,89 @@ +module Spree + class User < ActiveRecord::Base + include Core::UserBanners + + devise :database_authenticatable, :token_authenticatable, :registerable, :recoverable, + :rememberable, :trackable, :validatable, :encryptable, :encryptor => 'authlogic_sha512' + + has_many :orders + has_and_belongs_to_many :roles, :join_table => 'spree_roles_users' + belongs_to :ship_address, :foreign_key => 'ship_address_id', :class_name => 'Spree::Address' + belongs_to :bill_address, :foreign_key => 'bill_address_id', :class_name => 'Spree::Address' + + before_save :check_admin + before_validation :set_login + before_destroy :check_completed_orders + + # Setup accessible (or protected) attributes for your model + attr_accessible :email, :password, :password_confirmation, :remember_me, :persistence_token, :login, :role_ids + + users_table_name = User.table_name + roles_table_name = Role.table_name + + scope :admin, lambda { includes(:roles).where("#{roles_table_name}.name" => "admin") } + scope :registered, where("#{users_table_name}.email NOT LIKE ?", "%@example.net") + + class DestroyWithOrdersError < StandardError; end + + # has_role? simply needs to return true or false whether a user has a role or not. + def has_role?(role_in_question) + roles.any? { |role| role.name == role_in_question.to_s } + end + + # Creates an anonymous user. An anonymous user is basically an auto-generated +User+ account that is created for the customer + # behind the scenes and its completely transparently to the customer. All +Orders+ must have a +User+ so this is necessary + # when adding to the "cart" (which is really an order) and before the customer has a chance to provide an email or to register. + def self.anonymous! + token = User.generate_token(:persistence_token) + User.create(:email => "#{token}@example.net", :password => token, :password_confirmation => token, :persistence_token => token) + end + + def self.admin_created? + User.admin.count > 0 + end + + def anonymous? + email =~ /@example.net$/ + end + + def send_reset_password_instructions + generate_reset_password_token! + UserMailer.reset_password_instructions(self).deliver + end + + protected + def password_required? + !persisted? || password.present? || password_confirmation.present? + end + + private + + def check_completed_orders + raise DestroyWithOrdersError if orders.complete.present? + end + + def check_admin + return if self.class.admin_created? + admin_role = Role.find_or_create_by_name 'admin' + self.roles << admin_role + end + + def set_login + # for now force login to be same as email, eventually we will make this configurable, etc. + self.login ||= self.email if self.email + end + + # Generate a friendly string randomically to be used as token. + def self.friendly_token + SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n") + end + + # Generate a token by looping and ensuring does not already exist. + def self.generate_token(column) + loop do + token = friendly_token + break token unless find(:first, :conditions => { column => token }) + end + end + end +end diff --git a/app/overrides/admin_payment_methods_index.rb b/app/overrides/admin_payment_methods_index.rb new file mode 100644 index 00000000..7fccbb8e --- /dev/null +++ b/app/overrides/admin_payment_methods_index.rb @@ -0,0 +1,7 @@ +Deface::Override.new(:virtual_path => "spree/admin/payment_methods/index", + :name => "gateway_banner", + :insert_after => "#listing_payment_methods", + :partial => "spree/admin/banners/gateway", + :original => '93c6a827573cd5b5410992477389e178b9965630' ) + + diff --git a/app/overrides/auth_admin_login_navigation_bar.rb b/app/overrides/auth_admin_login_navigation_bar.rb new file mode 100644 index 00000000..93106f3b --- /dev/null +++ b/app/overrides/auth_admin_login_navigation_bar.rb @@ -0,0 +1,5 @@ +Deface::Override.new(:virtual_path => "spree/layouts/admin", + :name => "auth_admin_login_navigation_bar", + :replace => "[data-hook='admin_login_navigation_bar'], #admin_login_navigation_bar[data-hook]", + :partial => "spree/layouts/admin/login_nav", + :original => '0a5476d4d5db90ec8dd200ebaa0109a6a54ec6bc' ) diff --git a/app/overrides/auth_admin_user_roles.rb b/app/overrides/auth_admin_user_roles.rb new file mode 100644 index 00000000..5ee65875 --- /dev/null +++ b/app/overrides/auth_admin_user_roles.rb @@ -0,0 +1,6 @@ +Deface::Override.new(:virtual_path => "spree/admin/users/_form", + :name => "auth_admin_user_roles", + :insert_after => "[data-hook='admin_user_form_fields']", + :partial => "spree/admin/users/roles", + :disabled => false, + :original => '0e121156115799a53f5c5dddfb65c1ec80cb5f09') diff --git a/app/overrides/auth_shared_login_bar.rb b/app/overrides/auth_shared_login_bar.rb new file mode 100644 index 00000000..54a539a2 --- /dev/null +++ b/app/overrides/auth_shared_login_bar.rb @@ -0,0 +1,7 @@ +Deface::Override.new(:virtual_path => "spree/shared/_nav_bar", + :name => "auth_shared_login_bar", + :insert_before => "li#search-bar", + :partial => "spree/shared/login_bar", + :disabled => false, + :original => 'eb3fa668cd98b6a1c75c36420ef1b238a1fc55ac') + diff --git a/app/overrides/auth_user_login_form.rb b/app/overrides/auth_user_login_form.rb new file mode 100644 index 00000000..848766a1 --- /dev/null +++ b/app/overrides/auth_user_login_form.rb @@ -0,0 +1,6 @@ +Deface::Override.new(:virtual_path => "spree/checkout/registration", + :name => "auth_user_login_form", + :replace_contents => "[data-hook='registration'] #account, #registration[data-hook] #account", + :template => "spree/user_sessions/new", + :disabled => false, + :original => 'ab20ac9e90baa11b847b30040aef863d2e1af17a') diff --git a/app/views/spree/admin/banners/_gateway.html.erb b/app/views/spree/admin/banners/_gateway.html.erb new file mode 100644 index 00000000..57495d03 --- /dev/null +++ b/app/views/spree/admin/banners/_gateway.html.erb @@ -0,0 +1,14 @@ +<% if !current_user.dismissed_banner?(:gateway) && + Spree::PaymentMethod.production.where("type != 'Spree::Gateway::Bogus'").empty? %> + + + +<% end %> \ No newline at end of file diff --git a/app/views/spree/admin/users/_roles.html.erb b/app/views/spree/admin/users/_roles.html.erb new file mode 100644 index 00000000..98b3657f --- /dev/null +++ b/app/views/spree/admin/users/_roles.html.erb @@ -0,0 +1,12 @@ +
+

+ <%= label_tag nil, t(:roles) %>
+ <% @roles.each do |role| %> +   + <% end %> + <%= hidden_field_tag 'user[role_ids][]', '' %> +

+
\ No newline at end of file diff --git a/app/views/spree/layouts/admin/_login_nav.html.erb b/app/views/spree/layouts/admin/_login_nav.html.erb new file mode 100644 index 00000000..6957698a --- /dev/null +++ b/app/views/spree/layouts/admin/_login_nav.html.erb @@ -0,0 +1,8 @@ +<% if current_user %> +
    +
  • <%= t(:logged_in_as) %>: <%= current_user.email %>
  • +
  • <%= link_to t(:account), spree.edit_user_path(current_user) %>
  • +
  • <%= link_to t(:logout), spree.destroy_user_session_path %>
  • +
  • <%= link_to t(:store), spree.products_path %>
  • +
+<% end %> diff --git a/app/views/spree/shared/_flashes.html.erb b/app/views/spree/shared/_flashes.html.erb new file mode 100644 index 00000000..fd03a74a --- /dev/null +++ b/app/views/spree/shared/_flashes.html.erb @@ -0,0 +1,9 @@ +<% if flash.any? %> +
+ <% flash.each do |key, value| %> +

+ <%= value %> +

+ <% end %> +
+<% end%> \ No newline at end of file diff --git a/app/views/spree/shared/_login.html.erb b/app/views/spree/shared/_login.html.erb new file mode 100644 index 00000000..d0380df2 --- /dev/null +++ b/app/views/spree/shared/_login.html.erb @@ -0,0 +1,20 @@ +<%= form_for :user, :url => spree.user_session_path do |f| %> +
+

+ <%= f.label :email, t(:email) %>
+ <%= f.email_field :email, :class => 'title', :tabindex => 1 %> +

+

+ <%= f.label :password, t(:password) %>
+ <%= f.password_field :password, :class => 'title', :tabindex => 2 %> +

+
+

+ +

+ +

<%= f.submit t(:login), :class => 'button primary' %>

+<% end %> \ No newline at end of file diff --git a/app/views/spree/shared/_login_bar.html.erb b/app/views/spree/shared/_login_bar.html.erb new file mode 100644 index 00000000..3de10fb8 --- /dev/null +++ b/app/views/spree/shared/_login_bar.html.erb @@ -0,0 +1,6 @@ +<% if current_user %> +
  • <%= link_to t(:my_account), spree.account_path %>
  • +
  • <%= link_to t(:logout), spree.destroy_user_session_path %>
  • +<% else %> + +<% end %> diff --git a/app/views/spree/shared/_user_form.html.erb b/app/views/spree/shared/_user_form.html.erb new file mode 100644 index 00000000..01102449 --- /dev/null +++ b/app/views/spree/shared/_user_form.html.erb @@ -0,0 +1,17 @@ +

    + <%= f.label :email, t(:email) %>
    + <%= f.email_field :email, :class => 'title' %> +

    +
    +

    + <%= f.label :password, t(:password) %>
    + <%= f.password_field :password, :class => 'title' %> +

    + +

    + <%= f.label :password_confirmation, t(:confirm_password) %>
    + <%= f.password_field :password_confirmation, :class => 'title' %> +

    +
    + +
    diff --git a/app/views/spree/shared/unauthorized.html.erb b/app/views/spree/shared/unauthorized.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/spree/user_mailer/reset_password_instructions.text.erb b/app/views/spree/user_mailer/reset_password_instructions.text.erb new file mode 100644 index 00000000..712d9440 --- /dev/null +++ b/app/views/spree/user_mailer/reset_password_instructions.text.erb @@ -0,0 +1,10 @@ +A request to reset your password has been made. +If you did not make this request, simply ignore this email. + +If you did make this request just click the link below: + +<%= @edit_password_reset_url %> + +If the above URL does not work try copying and pasting it into your browser. +If you continue to have problem please feel free to contact us. + diff --git a/app/views/spree/user_passwords/edit.html.erb b/app/views/spree/user_passwords/edit.html.erb new file mode 100644 index 00000000..c2281830 --- /dev/null +++ b/app/views/spree/user_passwords/edit.html.erb @@ -0,0 +1,15 @@ +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %> +

    <%= t(:change_my_password) %>

    + +<%= form_for @user, :url => spree.user_password_path, :method => :put do |f| %> +

    + <%= f.label :password, t(:password) %>
    + <%= f.password_field :password %>
    +

    +

    + <%= f.label :password_confirmation, t(:password_confirmation) %>
    + <%= f.password_field :password_confirmation %>
    +

    + <%= f.hidden_field :reset_password_token %> + <%= f.submit t(:update_password), :class => 'button primary' %> +<% end %> \ No newline at end of file diff --git a/app/views/spree/user_passwords/new.html.erb b/app/views/spree/user_passwords/new.html.erb new file mode 100644 index 00000000..6ff66592 --- /dev/null +++ b/app/views/spree/user_passwords/new.html.erb @@ -0,0 +1,15 @@ +
    +
    <%= t(:forgot_password) %>
    + +

    <%= t(:instructions_to_reset_password) %>

    + + <%= form_for Spree::User.new, :as => :user, :url => spree.user_password_path do |f| %> +

    + <%= f.label :email, t(:email) %>
    + <%= f.email_field :email %> +

    +

    + <%= f.submit t(:reset_password), :class => 'button primary' %> +

    + <% end %> +
    diff --git a/app/views/spree/user_registrations/new.html.erb b/app/views/spree/user_registrations/new.html.erb new file mode 100644 index 00000000..776e94b3 --- /dev/null +++ b/app/views/spree/user_registrations/new.html.erb @@ -0,0 +1,22 @@ +<% @body_id = 'signup' %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %> + +
    +
    <%= t(:new_customer) %>
    + +
    + + <%= form_for :user, :url => spree.user_registration_path(@user) do |f| %> +
    + <%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %> +

    <%= f.submit t(:create), :class => 'button primary' %>

    +
    + <% end %> + <%= t(:or) %> <%= link_to t(:login_as_existing), spree.login_path %> + +
    + +
    + +
    diff --git a/app/views/spree/user_sessions/authorization_failure.html.erb b/app/views/spree/user_sessions/authorization_failure.html.erb new file mode 100644 index 00000000..50c31f25 --- /dev/null +++ b/app/views/spree/user_sessions/authorization_failure.html.erb @@ -0,0 +1,4 @@ +
    + <%= t(:authorization_failure) %> +
    + diff --git a/app/views/spree/user_sessions/new.html.erb b/app/views/spree/user_sessions/new.html.erb new file mode 100644 index 00000000..b62af246 --- /dev/null +++ b/app/views/spree/user_sessions/new.html.erb @@ -0,0 +1,13 @@ +<% if flash[:alert] %> +
    <%= flash[:alert] %>
    +<% end %> + +<% @body_id = 'login' %> +
    +
    <%= t(:login_as_existing) %>
    +
    + <%= render :partial => 'spree/shared/login' %> + <%= t(:or) %> <%= link_to t(:create_a_new_account), spree.signup_path %> | <%= link_to t(:forgot_password), spree.new_user_password_path %> +
    +
    +
    diff --git a/app/views/spree/users/edit.html.erb b/app/views/spree/users/edit.html.erb new file mode 100644 index 00000000..4459232f --- /dev/null +++ b/app/views/spree/users/edit.html.erb @@ -0,0 +1,11 @@ +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %> + +

    <%= t(:editing_user) %>

    + +<%= form_for @user, :url => spree.user_path(@user), :method => :put do |f| %> + <%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %> +

    + <%= f.submit t(:update) %> +

    +<% end %> + diff --git a/app/views/spree/users/show.html.erb b/app/views/spree/users/show.html.erb new file mode 100644 index 00000000..b6e2fd14 --- /dev/null +++ b/app/views/spree/users/show.html.erb @@ -0,0 +1,43 @@ +

    <%= accurate_title %>

    + +
    +
    +
    <%= t(:email) %>
    +
    <%= @user.email %> (<%= link_to t(:edit), spree.edit_account_path %>)
    +
    +
    + +
    + +

    <%= t(:my_orders) %>

    + <% if @orders.present? %> + + + + + + + + + + + + + <% @orders.each do |order| %> + + + + + + + + + <% end %> + +
    <%= t(:order_number) %><%= t(:order_date) %><%= t(:status) %><%= t(:payment_state) %><%= t(:shipment_state) %><%= t(:total) %>
    <%= link_to order.number, order_url(order) %><%= l order.created_at.to_date %><%= t(order.state).titleize %><%= t("payment_states.#{order.payment_state}") if order.payment_state %><%= t("shipment_states.#{order.shipment_state}") if order.shipment_state %><%= number_to_currency order.total %>
    + <% else %> +

    <%= t(:you_have_no_orders_yet) %>

    + <% end %> +
    + +
    diff --git a/config.ru b/config.ru new file mode 100644 index 00000000..03481254 --- /dev/null +++ b/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../spec/dummy/config/environment', __FILE__) +run Dummy::Application diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb new file mode 100644 index 00000000..d22a92e7 --- /dev/null +++ b/config/initializers/devise.rb @@ -0,0 +1,141 @@ +# Use this hook to configure devise mailer, warden hooks and so forth. The first +# four configuration values can also be set straight in your models. +Devise.setup do |config| + # ==> Mailer Configuration + # Configure the e-mail address which will be shown in DeviseMailer. + config.mailer_sender = 'please-change-me@config-initializers-devise.com' + + # Configure the class responsible to send e-mails. + config.mailer = 'Spree::UserMailer' + + # ==> ORM configuration + # Load and configure the ORM. Supports :active_record (default) and + # :mongoid (bson_ext recommended) by default. Other ORMs may be + # available as additional gems. + require 'devise/orm/active_record' + + # ==> Configuration for any authentication mechanism + # Configure which keys are used when authenticating an user. By default is + # just :email. You can configure it to use [:username, :subdomain], so for + # authenticating an user, both parameters are required. Remember that those + # parameters are used only when authenticating and not when retrieving from + # session. If you need permissions, you should implement that in a before filter. + # config.authentication_keys = [ :email ] + + # Tell if authentication through request.params is enabled. True by default. + # config.params_authenticatable = true + + # Tell if authentication through HTTP Basic Auth is enabled. False by default. + config.http_authenticatable = true + + # Set this to true to use Basic Auth for AJAX requests. True by default. + #config.http_authenticatable_on_xhr = false + + # The realm used in Http Basic Authentication + config.http_authentication_realm = 'Spree Application' + + # ==> Configuration for :database_authenticatable + # For bcrypt, this is the cost for hashing the password and defaults to 10. If + # using other encryptors, it sets how many times you want the password re-encrypted. + config.stretches = 20 + + # Setup a pepper to generate the encrypted password. + config.pepper = '0bfa9e2cb4a5efd0d976518a3d82e345060547913d2fd1dd2f32b0c8dbbbb5d3dc20b86d0fed31aca9513bccdf51643700ea277d9c64d9ce8ef886bf39293453' + + # ==> Configuration for :confirmable + # The time you want to give your user to confirm his account. During this time + # he will be able to access your application without confirming. Default is nil. + # When confirm_within is zero, the user won't be able to sign in without confirming. + # You can use this to let your user access some features of your application + # without confirming the account, but blocking it after a certain period + # (ie 2 days). + # config.confirm_within = 2.days + + # ==> Configuration for :rememberable + # The time the user will be remembered without asking for credentials again. + # config.remember_for = 2.weeks + + # If true, a valid remember token can be re-used between multiple browsers. + # config.remember_across_browsers = true + + # If true, extends the user's remember period when remembered via cookie. + # config.extend_remember_period = false + + # ==> Configuration for :validatable + # Range for password length + # config.password_length = 6..20 + + # Regex to use to validate the email address + config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i + + # ==> Configuration for :timeoutable + # The time you want to timeout the user session without activity. After this + # time the user will be asked for credentials again. + # config.timeout_in = 10.minutes + + # ==> Configuration for :lockable + # Defines which strategy will be used to lock an account. + # :failed_attempts = Locks an account after a number of failed attempts to sign in. + # :none = No lock strategy. You should handle locking by yourself. + # config.lock_strategy = :failed_attempts + + # Defines which strategy will be used to unlock an account. + # :email = Sends an unlock link to the user email + # :time = Re-enables login after a certain amount of time (see :unlock_in below) + # :both = Enables both strategies + # :none = No unlock strategy. You should handle unlocking by yourself. + # config.unlock_strategy = :both + + # Number of authentication tries before locking an account if lock_strategy + # is failed attempts. + # config.maximum_attempts = 20 + + # Time interval to unlock the account if :time is enabled as unlock_strategy. + # config.unlock_in = 1.hour + + # ==> Configuration for :token_authenticatable + # Defines name of the authentication token params key + config.token_authentication_key = :auth_token + + # ==> Scopes configuration + # Turn scoped views on. Before rendering 'sessions/new', it will first check for + # 'users/sessions/new'. It's turned off by default because it's slower if you + # are using only default views. + # config.scoped_views = true + + # Configure the default scope given to Warden. By default it's the first + # devise role declared in your routes. + # config.default_scope = :user + + # Configure sign_out behavior. + # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope). + # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes. + # config.sign_out_all_scopes = false + + # ==> Navigation configuration + # Lists the formats that should be treated as navigational. Formats like + # :html, should redirect to the sign in page when the user does not have + # access, but formats like :xml or :json, should return 401. + # If you have any extra navigational formats, like :iphone or :mobile, you + # should add them to the navigational formats lists. Default is [:html] + config.navigational_formats = [:html, :json, :xml] + + # ==> Warden configuration + # If you want to use other strategies, that are not (yet) supported by Devise, + # you can configure them inside the config.warden block. The example below + # allows you to setup OAuth, using http://github.com/roman/warden_oauth + # + # config.warden do |manager| + # manager.oauth(:twitter) do |twitter| + # twitter.consumer_secret = + # twitter.consumer_key = + # twitter.options :site => 'http://twitter.com' + # end + # manager.default_strategies(:scope => :user).unshift :twitter_oauth + # end + # + # Time interval you can reset your password with a reset password key. + # Don't put a too small interval or your users won't have the time to + # change their passwords. + config.reset_password_within = 6.hours +end diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb new file mode 100644 index 00000000..69e0d5ac --- /dev/null +++ b/config/initializers/spree.rb @@ -0,0 +1 @@ +Spree.user_class = "Spree::User" diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 00000000..099214af --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,46 @@ +en: + errors: + messages: + not_found: 'not found' + already_confirmed: 'was already confirmed' + not_locked: 'was not locked' + not_saved: + one: '1 error prohibited this %{resource} from being saved:' + other: '%{count} errors prohibited this %{resource} from being saved:' + devise: + failure: + unauthenticated: 'You need to sign in or sign up before continuing.' + unconfirmed: 'You have to confirm your account before continuing.' + locked: 'Your account is locked.' + invalid: 'Invalid email or password.' + invalid_token: 'Invalid authentication token.' + timeout: 'Your session expired, please sign in again to continue.' + inactive: 'Your account was not activated yet.' + user_passwords: + user: + send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' + updated: 'Your password was changed successfully. You are now signed in.' + confirmations: + send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' + confirmed: 'Your account was successfully confirmed. You are now signed in.' + user_registrations: + signed_up: 'Welcome! You have signed up successfully.' + inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.' + updated: 'You updated your account successfully.' + destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' + user_sessions: + signed_in: 'Signed in successfully.' + signed_out: 'Signed out successfully.' + unlocks: + send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' + unlocked: 'Your account was successfully unlocked. You are now signed in.' + oauth_callbacks: + success: 'Successfully authorized from %{kind} account.' + failure: 'Could not authorize you from %{kind} because "%{reason}".' + mailer: + confirmation_instructions: + subject: 'Confirmation instructions' + reset_password_instructions: + subject: 'Reset password instructions' + unlock_instructions: + subject: 'Unlock Instructions' \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 00000000..56f7d8f2 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,31 @@ +Spree::Core::Engine.routes.draw do + devise_for :user, + :class_name => 'Spree::User', + :controllers => { :sessions => 'spree/user_sessions', + :registrations => 'spree/user_registrations', + :passwords => 'spree/user_passwords' }, + :skip => [:unlocks, :omniauth_callbacks], + :path_names => { :sign_out => 'logout' } +end + +Spree::Core::Engine.routes.prepend do + resources :users, :only => [:edit, :update] + + devise_scope :user do + get '/login' => 'user_sessions#new', :as => :login + get '/signup' => 'user_registrations#new', :as => :signup + end + + match '/checkout/registration' => 'checkout#registration', :via => :get, :as => :checkout_registration + match '/checkout/registration' => 'checkout#update_registration', :via => :put, :as => :update_checkout_registration + + match '/orders/:id/token/:token' => 'orders#show', :via => :get, :as => :token_order + + resource :session do + member do + get :nav_bar + end + end + + resource :account, :controller => 'users' +end diff --git a/db/default/users.rb b/db/default/users.rb new file mode 100644 index 00000000..b262fb08 --- /dev/null +++ b/db/default/users.rb @@ -0,0 +1,76 @@ +require 'highline/import' + +# see last line where we create an admin if there is none, asking for email and password +def prompt_for_admin_password + if ENV['ADMIN_PASSWORD'] + password = ENV['ADMIN_PASSWORD'].dup + say "Admin Password #{password}" + else + password = ask('Password [spree123]: ') do |q| + q.echo = false + q.validate = /^(|.{5,40})$/ + q.responses[:not_valid] = 'Invalid password. Must be at least 5 characters long.' + q.whitespace = :strip + end + password = 'spree123' if password.blank? + end + + password +end + +def prompt_for_admin_email + if ENV['ADMIN_EMAIL'] + email = ENV['ADMIN_EMAIL'].dup + say "Admin User #{email}" + else + email = ask('Email [spree@example.com]: ') do |q| + q.echo = true + q.whitespace = :strip + end + email = 'spree@example.com' if email.blank? + end + + email +end + +def create_admin_user + if ENV['AUTO_ACCEPT'] + password = 'spree123' + email = 'spree@example.com' + else + puts 'Create the admin user (press enter for defaults).' + #name = prompt_for_admin_name unless name + email = prompt_for_admin_email + password = prompt_for_admin_password + end + attributes = { + :password => password, + :password_confirmation => password, + :email => email, + :login => email + } + + load 'spree/user.rb' + + if Spree::User.find_by_email(email) + say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake db:admin:create again with a different email.\n\n" + else + admin = Spree::User.create(attributes) + # create an admin role and and assign the admin user to that role + role = Spree::Role.find_or_create_by_name 'admin' + admin.roles << role + admin.save + end +end + +if Spree::User.admin.empty? + create_admin_user +else + puts 'Admin user has already been previously created.' + if agree('Would you like to create a new admin user? (yes/no)') + create_admin_user + else + puts 'No admin user created.' + end +end + diff --git a/db/migrate/20101026184950_rename_columns_for_devise.rb b/db/migrate/20101026184950_rename_columns_for_devise.rb new file mode 100644 index 00000000..3b50b79b --- /dev/null +++ b/db/migrate/20101026184950_rename_columns_for_devise.rb @@ -0,0 +1,38 @@ +class RenameColumnsForDevise < ActiveRecord::Migration + def up + return if column_exists?(:spree_users, :password_salt) + rename_column :spree_users, :crypted_password, :encrypted_password + rename_column :spree_users, :salt, :password_salt + rename_column :spree_users, :remember_token_expires_at, :remember_created_at + rename_column :spree_users, :login_count, :sign_in_count + rename_column :spree_users, :failed_login_count, :failed_attempts + rename_column :spree_users, :single_access_token, :reset_password_token + rename_column :spree_users, :current_login_at, :current_sign_in_at + rename_column :spree_users, :last_login_at, :last_sign_in_at + rename_column :spree_users, :current_login_ip, :current_sign_in_ip + rename_column :spree_users, :last_login_ip, :last_sign_in_ip + add_column :spree_users, :authentication_token, :string + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :locked_at, :datetime + remove_column :spree_users, :api_key if column_exists?(:spree_users, :api_key) + remove_column :spree_users, :openid_identifier + end + + def down + remove_column :spree_users, :authentication_token + remove_column :spree_users, :locked_at + remove_column :spree_users, :unlock_token + rename_column :spree_users, :last_sign_in_ip, :last_login_ip + rename_column :spree_users, :current_sign_in_ip, :current_login_ip + rename_column :spree_users, :last_sign_in_at, :last_login_at + rename_column :spree_users, :current_sign_in_at, :current_login_at + rename_column :spree_users, :reset_password_token, :single_access_token + rename_column :spree_users, :failed_attempts, :failed_login_count + rename_column :spree_users, :sign_in_count, :login_count + rename_column :spree_users, :remember_created_at, :remember_token_expires_at + rename_column :spree_users, :password_salt, :salt + rename_column :spree_users, :encrypted_password, :crypted_password + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :openid_identifier, :string + end +end diff --git a/db/migrate/20101214150824_convert_user_remember_field.rb b/db/migrate/20101214150824_convert_user_remember_field.rb new file mode 100644 index 00000000..4514fc5b --- /dev/null +++ b/db/migrate/20101214150824_convert_user_remember_field.rb @@ -0,0 +1,11 @@ +class ConvertUserRememberField < ActiveRecord::Migration + def up + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :datetime + end + + def down + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :string + end +end diff --git a/db/migrate/20101217012656_create_tokenized_permissions.rb b/db/migrate/20101217012656_create_tokenized_permissions.rb new file mode 100644 index 00000000..e7d8df4d --- /dev/null +++ b/db/migrate/20101217012656_create_tokenized_permissions.rb @@ -0,0 +1,13 @@ +class CreateTokenizedPermissions < ActiveRecord::Migration + def change + create_table :tokenized_permissions do |t| + t.integer :permissable_id + t.string :permissable_type + t.string :token + + t.timestamps + end + + add_index :tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type' + end +end diff --git a/db/migrate/20101219201531_tokens_for_legacy_orders.rb b/db/migrate/20101219201531_tokens_for_legacy_orders.rb new file mode 100644 index 00000000..1e51c00b --- /dev/null +++ b/db/migrate/20101219201531_tokens_for_legacy_orders.rb @@ -0,0 +1,18 @@ +class TokensForLegacyOrders < ActiveRecord::Migration + def up + Spree::TokenizedPermission.table_name = 'tokenized_permissions' + + # add token permissions for legacy orders (stop relying on user persistence token) + Spree::Order.all.each do |order| + next unless order.user + permission = order.build_tokenized_permission + permission.token = order.user.persistence_token + permission.save! + end + + Spree::TokenizedPermission.table_name = 'spree_tokenized_permissions' + end + + def down + end +end diff --git a/db/migrate/20111007143030_namespace_tokenized_permission.rb b/db/migrate/20111007143030_namespace_tokenized_permission.rb new file mode 100644 index 00000000..3eb8baa7 --- /dev/null +++ b/db/migrate/20111007143030_namespace_tokenized_permission.rb @@ -0,0 +1,5 @@ +class NamespaceTokenizedPermission < ActiveRecord::Migration + def change + rename_table :tokenized_permissions, :spree_tokenized_permissions + end +end diff --git a/db/migrate/20111206075712_migrate_tokenized_permissions.rb b/db/migrate/20111206075712_migrate_tokenized_permissions.rb new file mode 100644 index 00000000..2fb4e6e1 --- /dev/null +++ b/db/migrate/20111206075712_migrate_tokenized_permissions.rb @@ -0,0 +1,24 @@ +class MigrateTokenizedPermissions < ActiveRecord::Migration + def concat(str1, str2) + dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym + + case dbtype + when :mysql, :mysql2 + "CONCAT(#{str1}, #{str2})" + when :sqlserver + "(#{str1} + #{str2})" + else + "(#{str1} || #{str2})" + end + end + + def up + execute "UPDATE spree_tokenized_permissions SET permissable_type = #{concat("'Spree::'", "permissable_type")}" + + " WHERE permissable_type NOT LIKE 'Spree::%' AND permissable_type IS NOT NULL" + end + + def down + execute "UPDATE spree_tokenized_permissions SET permissable_type = REPLACE(permissable_type, 'Spree::', '')" + + " WHERE permissable_type LIKE 'Spree::%'" + end +end diff --git a/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb b/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb new file mode 100644 index 00000000..6c154ece --- /dev/null +++ b/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb @@ -0,0 +1,5 @@ +class AddResetPasswordSentAtToSpreeUsers < ActiveRecord::Migration + def change + add_column :spree_users, :reset_password_sent_at, :datetime + end +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 00000000..456e8cad --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,5 @@ +# Loads seed data out of default dir +default_path = File.join(File.dirname(__FILE__), 'default') + +Rake::Task['db:load_dir'].reenable +Rake::Task['db:load_dir'].invoke(default_path) diff --git a/lib/spree/auth.rb b/lib/spree/auth.rb new file mode 100644 index 00000000..41566b24 --- /dev/null +++ b/lib/spree/auth.rb @@ -0,0 +1,15 @@ +require 'spree_core' +require 'devise' +require 'cancan' + +require 'spree/token_resource' + +module Spree + module Auth + def self.config(&block) + yield(Spree::Auth::Config) + end + end +end + +require 'spree/auth/engine' diff --git a/lib/spree/auth/engine.rb b/lib/spree/auth/engine.rb new file mode 100644 index 00000000..c0d07306 --- /dev/null +++ b/lib/spree/auth/engine.rb @@ -0,0 +1,21 @@ +module Spree + module Auth + class Engine < Rails::Engine + isolate_namespace Spree + engine_name 'spree_auth' + + initializer "spree.auth.environment", :before => :load_config_initializers do |app| + Spree::Auth::Config = Spree::AuthConfiguration.new + end + + def self.activate + Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + + config.to_prepare &method(:activate).to_proc + ActiveRecord::Base.class_eval { include Spree::TokenResource } + end + end +end diff --git a/lib/spree/token_resource.rb b/lib/spree/token_resource.rb new file mode 100644 index 00000000..f2999fba --- /dev/null +++ b/lib/spree/token_resource.rb @@ -0,0 +1,22 @@ +module Spree + module TokenResource + module ClassMethods + def token_resource + has_one :tokenized_permission, :as => :permissable + delegate :token, :to => :tokenized_permission, :allow_nil => true + after_create :create_token + end + end + + def create_token + permission = build_tokenized_permission + permission.token = token = ::SecureRandom::hex(8) + permission.save! + token + end + + def self.included(receiver) + receiver.extend ClassMethods + end + end +end diff --git a/lib/spree_auth_devise.rb b/lib/spree_auth_devise.rb new file mode 100644 index 00000000..68fb286c --- /dev/null +++ b/lib/spree_auth_devise.rb @@ -0,0 +1 @@ +require 'spree/auth' diff --git a/lib/tasks/auth.rake b/lib/tasks/auth.rake new file mode 100644 index 00000000..949a9ad4 --- /dev/null +++ b/lib/tasks/auth.rake @@ -0,0 +1,8 @@ +namespace :db do + namespace :admin do + desc "Create admin username and password" + task :create => :environment do + require File.join(File.dirname(__FILE__), '..', '..', 'db', 'default', 'users.rb') + end + end +end \ No newline at end of file diff --git a/script/rails b/script/rails new file mode 100755 index 00000000..0b5d05e6 --- /dev/null +++ b/script/rails @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENGINE_PATH = File.expand_path('../..', __FILE__) +load File.expand_path('../../spec/dummy/script/rails', __FILE__) diff --git a/spec/bar_ability.rb b/spec/bar_ability.rb new file mode 100644 index 00000000..4b32487b --- /dev/null +++ b/spec/bar_ability.rb @@ -0,0 +1,17 @@ +# Fake ability for testing administration +class BarAbility + include CanCan::Ability + + def initialize(user) + user ||= Spree::User.new + if user.has_role? 'bar' + # allow dispatch to :index and :show orders on the admin + can :index, Spree::Order + can :show, Spree::Order + can :admin, Spree::Order + # allow dispatch to :index, :show, :create and :update shipments on the admin + can :manage, Spree::Shipment + can :admin, Spree::Shipment + end + end +end \ No newline at end of file diff --git a/spec/controllers/admin/admin_orders_controller_spec.rb b/spec/controllers/admin/admin_orders_controller_spec.rb new file mode 100644 index 00000000..d9e44086 --- /dev/null +++ b/spec/controllers/admin/admin_orders_controller_spec.rb @@ -0,0 +1,56 @@ +require 'spec_helper' +require 'bar_ability' +require 'cancan' + +describe Spree::Admin::OrdersController do + + let(:order) { mock_model(Spree::Order, :number => 'R123', :reload => nil, :save! => true) } + before do + Spree::Order.stub :find_by_number => order + #ensure no respond_overrides are in effect + if Spree::BaseController.spree_responders[:OrdersController].present? + Spree::BaseController.spree_responders[:OrdersController].clear + end + end + + context '#authorize_admin' do + let(:user) { Spree::User.new } + + before do + controller.stub :current_user => user + Spree::Order.stub(:new).and_return(order) + end + + after(:each) { user.roles = [] } + + it 'should grant access to users with an admin role' do + #user.stub :has_role? => true + user.roles = [Spree::Role.find_or_create_by_name('admin')] + post :index + response.should render_template :index + end + + it 'should grant access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :index + response.should render_template :index + end + + it 'should deny access to users with an bar role' do + order.stub(:update_attributes).and_return true + order.stub(:user).and_return Spree::User.new + order.stub(:token).and_return nil + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :update, { :id => 'R123' } + response.should render_template 'spree/shared/unauthorized' + end + + it 'should deny access to users without an admin role' do + user.stub :has_role? => false + post :index + response.should render_template 'spree/shared/unauthorized' + end + end +end diff --git a/spec/controllers/admin/admin_shipments_controller_spec.rb b/spec/controllers/admin/admin_shipments_controller_spec.rb new file mode 100644 index 00000000..7af7640f --- /dev/null +++ b/spec/controllers/admin/admin_shipments_controller_spec.rb @@ -0,0 +1,70 @@ +require 'spec_helper' +require 'bar_ability' +require 'cancan' + +describe Spree::Admin::ShipmentsController do + context '#authorize_admin' do + let(:user) { Spree::User.new } + let(:shipment) { mock_model Spree::Shipment } + let(:shipping_method) { mock_model Spree::ShippingMethod } + let(:order) { mock_model(Spree::Order, :number => 'R123', :reload => nil, :save! => true) } + + before do + controller.stub :current_user => user + Spree::Shipment.stub(:find).with(9).and_return(shipment) + Spree::Shipment.stub :find_by_number => shipment + Spree::Order.stub :find_by_number => order + Spree::Shipment.stub(:new).and_return(shipment) + shipment.stub(:order).and_return order + shipment.stub(:shipping_method).and_return shipping_method + shipment.stub(:special_instructions=).and_return 'none' + shipment.stub(:update_attributes).and_return true + order.stub(:update_attributes).and_return true + order.stub(:shipments).and_return [shipment] + order.stub(:shipment).and_return shipment + order.stub(:shipping_method=).and_return shipping_method + order.stub(:special_instructions).and_return 'none' + order.stub(:save).and_return true + order.stub(:completed?).and_return false + if Spree::BaseController.spree_responders[:OrdersController].present? + Spree::BaseController.spree_responders[:OrdersController].clear + end + end + + after(:each) { user.roles = [] } + + it 'should grant access to users with an admin role' do + #user.stub :has_role? => true + user.roles = [Spree::Role.find_or_create_by_name('admin')] + post :index + response.should render_template :index + end + + it 'should grant access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :index + response.should render_template :index + end + + it 'should grant access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :edit, { :order_id => 'R123', :id => 9 } + response.should_not render_template 'shared/unauthorized' + end + + it 'should grant access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :update, { :order_id => 'R123', :id => 9 } + response.should_not render_template 'shared/unauthorized' + end + + it 'should deny access to users without an admin role' do + user.stub :has_role? => false + post :index + response.should render_template 'shared/unauthorized' + end + end +end \ No newline at end of file diff --git a/spec/controllers/admin/admin_users_controller_spec.rb b/spec/controllers/admin/admin_users_controller_spec.rb new file mode 100644 index 00000000..8ee83ac9 --- /dev/null +++ b/spec/controllers/admin/admin_users_controller_spec.rb @@ -0,0 +1,45 @@ +require 'spec_helper' +require 'bar_ability' +require 'cancan' + +describe Spree::Admin::UsersController do + context '#authorize_admin' do + let(:user) { Spree::User.new } + let(:mock_user) { mock_model Spree::User } + + before do + controller.stub :current_user => user + Spree::User.stub(:find).with('9').and_return(mock_user) + Spree::User.stub(:new).and_return(mock_user) + end + + after(:each) { user.roles = [] } + + it 'should grant access to users with an admin role' do + #user.stub :has_role? => true + user.roles = [Spree::Role.find_or_create_by_name('admin')] + post :index + response.should render_template :index + end + + it 'should deny access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :index + response.should render_template 'spree/shared/unauthorized' + end + + it 'should deny access to users with an bar role' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + Spree::Ability.register_ability(BarAbility) + post :update, { :id => '9' } + response.should render_template 'spree/shared/unauthorized' + end + + it 'should deny access to users without an admin role' do + user.stub :has_role? => false + post :index + response.should render_template 'spree/shared/unauthorized' + end + end +end diff --git a/spec/controllers/checkout_controller_spec.rb b/spec/controllers/checkout_controller_spec.rb new file mode 100644 index 00000000..c44a4e32 --- /dev/null +++ b/spec/controllers/checkout_controller_spec.rb @@ -0,0 +1,171 @@ +require 'spec_helper' + +describe Spree::CheckoutController do + let(:order) { Spree::Order.new } + let(:user) { mock_model Spree::User } + let(:token) { 'some_token' } + + before do + order.stub :checkout_allowed? => true, :user => user, :new_record? => false + controller.stub :current_order => order + # TODO: Really, this shouldn't be in effect here. + # We should only be testing for auth's decorations + controller.stub :apply_pending_promotions + controller.stub :current_user => nil + end + + context '#edit' do + context 'when registration step enabled' do + before do + controller.stub :check_authorization + Spree::Auth::Config.set(:registration_step => true) + end + + context 'when authenticated as registered user' do + before { controller.stub :current_user => user } + + it 'should proceed to the first checkout step' do + spree_get :edit, { :state => 'confirm' } + response.should render_template :edit + end + end + + context 'when authenticated as guest' do + before { controller.stub :auth_user => user } + + it 'should redirect to registration step' do + spree_get :edit, { :state => 'confirm' } + response.should redirect_to spree.checkout_registration_path + end + end + end + + context 'when registration step disabled' do + before do + Spree::Auth::Config.set(:registration_step => false) + controller.stub :check_authorization + end + + context 'when authenticated as registered' do + before { controller.stub :current_user => user } + + it 'should proceed to the first checkout step' do + spree_get :edit, { :state => 'confirm' } + response.should render_template :edit + end + end + + context 'when authenticated as guest' do + before { controller.stub :auth_user => user } + + it 'should proceed to the first checkout step' do + spree_get :edit, { :state => 'confirm' } + response.should render_template :edit + end + end + + end + + it 'should check if the user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + spree_get :edit, { :state => 'confirm' }, { :access_token => token } + end + end + + context '#update' do + it 'should check if the user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + spree_post :update, { :state => 'confirm' }, { :access_token => token } + end + + context 'when save successful' do + before do + controller.stub :check_authorization + order.stub(:update_attribute).and_return true + order.should_receive(:update_attributes).and_return true + end + + context 'when in the confirm state' do + before do + order.stub :next => true + order.stub :state => 'complete' + order.stub :number => 'R123' + end + + context 'with a guest user' do + before do + order.stub :token => 'ABC' + user.stub :has_role? => true + controller.stub :current_user => nil + end + + it 'should redirect to the tokenized order view' do + spree_post :update, { :state => 'confirm' } + response.should redirect_to spree.token_order_path('R123', 'ABC') + end + + it 'should populate the flash message' do + spree_post :update, { :state => 'confirm' } + flash.notice.should == I18n.t(:order_processed_successfully) + end + end + + context 'with a registered user' do + before do + user.stub :has_role? => true + controller.stub :current_user => mock_model(Spree::User, :has_role? => true) + end + + it 'should redirect to the standard order view' do + spree_post :update, { :state => 'confirm' } + response.should redirect_to spree.order_path('R123') + end + end + end + end + end + + context '#registration' do + it 'should not check registration' do + controller.stub :check_authorization + controller.should_not_receive :check_registration + spree_get :registration + end + + it 'should check if the user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + spree_get :registration, {}, { :access_token => token } + end + end + + context '#update_registration' do + let(:user) { user = mock_model Spree::User } + + it 'should not check registration' do + controller.stub :check_authorization + order.stub :update_attributes => true + controller.should_not_receive :check_registration + spree_put :update_registration + end + + it 'should render the registration view if unable to save' do + controller.stub :check_authorization + order.should_receive(:update_attributes).with('email' => 'invalid').and_return false + spree_put :update_registration, { :order => { :email => 'invalid' } } + response.should render_template :registration + end + + it 'should redirect to the checkout_path after saving' do + order.stub :update_attributes => true + controller.stub :check_authorization + spree_put :update_registration, { :order => { :email => 'jobs@spreecommerce.com' } } + response.should redirect_to spree.checkout_path + end + + it 'should check if the user is authorized for :edit' do + order.stub :update_attributes => true + controller.should_receive(:authorize!).with(:edit, order, token) + spree_put :update_registration, { :order => { :email => 'jobs@spreecommerce.com' } }, { :access_token => token } + end + end +end diff --git a/spec/controllers/orders_controller_spec.rb b/spec/controllers/orders_controller_spec.rb new file mode 100644 index 00000000..78f95e47 --- /dev/null +++ b/spec/controllers/orders_controller_spec.rb @@ -0,0 +1,160 @@ +require 'spec_helper' + +describe Spree::OrdersController do + ORDER_TOKEN = 'ORDER_TOKEN' + + let(:user) { create(:user) } + let(:guest_user) { create(:user) } + let(:order) { Spree::Order.new } + + it 'should understand order routes with token' do + spree.token_order_path('R123456', 'ABCDEF').should == '/orders/R123456/token/ABCDEF' + end + + before do + Spree::User.stub :anonymous! => guest_user + end + + context 'when no order exists in the session' do + before { Spree::Order.stub :new => order } + + context '#populate' do + context 'when not logged in' do + it 'should create an anonymous user' do + Spree::User.should_receive :anonymous! + post :populate + end + end + + context 'when authenticated as a registered user' do + before { controller.stub :current_user => user } + + it 'should not create an anonymous user' do + Spree::User.should_not_receive :anonymous! + post :populate + session[:access_token].should be_nil + end + + it 'should associate the new order with the registered user' do + post :populate + order.user.should == user + end + end + + context 'when not authenticated' do + it 'should create an anonymous user' do + Spree::User.should_receive(:anonymous!).and_return guest_user + post :populate + end + + it 'should associate the new order with the anonymous user' do + post :populate + order.user.should == guest_user + end + + context 'when there is an order token' do + before { order.stub :token => ORDER_TOKEN } + + it 'should store the token in the session' do + post :populate + session[:access_token].should == ORDER_TOKEN + end + + it 'should repalce any previous access tokens' do + session[:access_token] = 'OLD_TOKEN' + post :populate + session[:access_token].should == ORDER_TOKEN + end + end + end + end + end + + context 'when an order exists in the session' do + let(:token) { 'some_token' } + let(:specified_order) { create(:order) } + + before do + controller.stub :current_order => order + controller.stub :current_user => user + end + + context '#populate' do + it 'should check if user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + post :populate, :token => token + end + it "should check against the specified order" do + controller.should_receive(:authorize!).with(:edit, specified_order, token) + post :populate, :id => specified_order.number, :token => token + end + end + + context '#edit' do + it 'should check if user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + get :edit, :token => token + end + it "should check against the specified order" do + controller.should_receive(:authorize!).with(:edit, specified_order, token) + get :edit, :id => specified_order.number, :token => token + end + end + + context '#update' do + it 'should check if user is authorized for :edit' do + order.stub :update_attributes + controller.should_receive(:authorize!).with(:edit, order, token) + post :update, :token => token + end + it "should check against the specified order" do + order.stub :update_attributes + controller.should_receive(:authorize!).with(:edit, specified_order, token) + post :update, :id => specified_order.number, :token => token + end + end + + context '#empty' do + it 'should check if user is authorized for :edit' do + controller.should_receive(:authorize!).with(:edit, order, token) + post :empty, :token => token + end + it "should check against the specified order" do + controller.should_receive(:authorize!).with(:edit, specified_order, token) + post :empty, :id => specified_order.number, :token => token + end + end + + context "#show" do + it "should check against the specified order" do + controller.should_receive(:authorize!).with(:edit, specified_order, token) + get :show, :id => specified_order.number, :token => token + end + end + end + + context 'when no authenticated user' do + let(:order) { create(:order, :number => 'R123') } + + context '#show' do + context 'when token parameter present' do + it 'should store as guest_token in session' do + get :show, {:id => 'R123', :token => order.token } + session[:access_token].should == order.token + end + end + + context 'when no token present' do + it 'should not store a guest_token in the session' do + get :show, {:id => 'R123'} + session[:access_token].should be_nil + end + + it 'should respond with 404' do + get :show, {:id => 'R123'} + response.code.should == '404' + end + end + end + end +end diff --git a/spec/controllers/products_controller_spec.rb b/spec/controllers/products_controller_spec.rb new file mode 100644 index 00000000..c1aaf53f --- /dev/null +++ b/spec/controllers/products_controller_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Spree::ProductsController do + let!(:product) { create(:product, :available_on => 1.year.from_now) } + + it "allows admins to view non-active products" do + controller.stub :current_user => stub(:admin? => true) + get :show, :id => product.to_param + response.status.should == 200 + end + + it "cannot view non-active products" do + controller.stub :current_user => stub(:admin? => false) + get :show, :id => product.to_param + response.status.should == 404 + end +end diff --git a/spec/controllers/user_registrations_controller_spec.rb b/spec/controllers/user_registrations_controller_spec.rb new file mode 100644 index 00000000..342d6854 --- /dev/null +++ b/spec/controllers/user_registrations_controller_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe Spree::UserRegistrationsController do + context '#create' do + it 'should fire exactly one spree.user.signup notification' do + activator = Spree::Activator.create!({:event_name => 'spree.user.signup'}, :without_protection => true) + ActiveSupport::Notifications.subscribe(/spree.user.signup/) { |*args| activator.activate(args) } + activator.should_receive(:activate).once + new_user = build(:user) + + request.env['devise.mapping'] = Devise.mappings[:user] + + post :create, { :commit=>'Create', :user => { 'password' => new_user.password, 'password_confirmation' => new_user.password, 'email' => new_user.email } } + end + end + + after do + ActiveSupport::Notifications.unsubscribe(/spree.user.signup/) + end +end diff --git a/spec/controllers/user_sessions_controller_spec.rb b/spec/controllers/user_sessions_controller_spec.rb new file mode 100644 index 00000000..896560a4 --- /dev/null +++ b/spec/controllers/user_sessions_controller_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe Spree::UserSessionsController do + before do + request.env["devise.mapping"] = Devise.mappings[:user] + end + + context '#create' do + context 'when current_order is associated with a guest user' do + let(:user) { mock Spree::User } + let(:order) { mock_model Spree::Order } + + before do + controller.stub :current_user => user + controller.stub :current_order => order + end + + it 'should associate the order with the newly authenticated user' do + order.should_receive(:associate_user!).with(user) + post :create, {}, { :order_id => 1 } + end + + it 'should destroy the session token for guest_user' do + order.stub(:associate_user!) + post :create, {}, { :order_id => 1, :guest_token => 'foo' } + session[:guest_token].should be_nil + end + end + end +end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 00000000..7c10d2e8 --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe Spree::UsersController do + let(:admin_user) { create(:user) } + let(:user) { create(:user) } + + before do + sign_in user + end + + context '#create' do + it 'should create a new user' do + post :create, { :user => { :email => 'foobar@example.com', :password => 'foobar123', :password_confirmation => 'foobar123' } } + assigns[:user].new_record?.should be_false + end + + context 'when an order exists in the session' do + let(:order) { mock_model Spree::Order } + before { controller.stub :current_order => order } + + it 'should assign the user to the order' do + order.should_receive(:associate_user!) + post :create, { :user => { :email => 'foobar@spreecommerce.com', :password => 'foobar123', :password_confirmation => 'foobar123' } } + end + end + end + + context '#update' do + context 'when updating own account' do + it 'should perform update' do + put :update, { :user => { :email => 'mynew@email-address.com' } } + assigns[:user].email.should == 'mynew@email-address.com' + response.should redirect_to(spree.account_url(:only_path => true)) + end + end + + context 'when attempting to update other account' do + it 'should not allow update' do + put :update, { :user => create(:user) }, { :user => { :email => 'mynew@email-address.com' } } + response.should redirect_to(spree.login_url(:only_path => true)) + end + end + end +end diff --git a/spec/dummy/README.rdoc b/spec/dummy/README.rdoc new file mode 100644 index 00000000..7c36f235 --- /dev/null +++ b/spec/dummy/README.rdoc @@ -0,0 +1,261 @@ +== Welcome to Rails + +Rails is a web-application framework that includes everything needed to create +database-backed web applications according to the Model-View-Control pattern. + +This pattern splits the view (also called the presentation) into "dumb" +templates that are primarily responsible for inserting pre-built data in between +HTML tags. The model contains the "smart" domain objects (such as Account, +Product, Person, Post) that holds all the business logic and knows how to +persist themselves to a database. The controller handles the incoming requests +(such as Save New Account, Update Product, Show Post) by manipulating the model +and directing data to the view. + +In Rails, the model is handled by what's called an object-relational mapping +layer entitled Active Record. This layer allows you to present the data from +database rows as objects and embellish these data objects with business logic +methods. You can read more about Active Record in +link:files/vendor/rails/activerecord/README.html. + +The controller and view are handled by the Action Pack, which handles both +layers by its two parts: Action View and Action Controller. These two layers +are bundled in a single package due to their heavy interdependence. This is +unlike the relationship between the Active Record and Action Pack that is much +more separate. Each of these packages can be used independently outside of +Rails. You can read more about Action Pack in +link:files/vendor/rails/actionpack/README.html. + + +== Getting Started + +1. At the command prompt, create a new Rails application: + rails new myapp (where myapp is the application name) + +2. Change directory to myapp and start the web server: + cd myapp; rails server (run with --help for options) + +3. Go to http://localhost:3000/ and you'll see: + "Welcome aboard: You're riding Ruby on Rails!" + +4. Follow the guidelines to start developing your application. You can find +the following resources handy: + +* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html +* Ruby on Rails Tutorial Book: http://www.railstutorial.org/ + + +== Debugging Rails + +Sometimes your application goes wrong. Fortunately there are a lot of tools that +will help you debug it and get it back on the rails. + +First area to check is the application log files. Have "tail -f" commands +running on the server.log and development.log. Rails will automatically display +debugging and runtime information to these files. Debugging info will also be +shown in the browser on requests from 127.0.0.1. + +You can also log your own messages directly into the log file from your code +using the Ruby logger class from inside your controllers. Example: + + class WeblogController < ActionController::Base + def destroy + @weblog = Weblog.find(params[:id]) + @weblog.destroy + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!") + end + end + +The result will be a message in your log file along the lines of: + + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1! + +More information on how to use the logger is at http://www.ruby-doc.org/core/ + +Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are +several books available online as well: + +* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe) +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide) + +These two books will bring you up to speed on the Ruby language and also on +programming in general. + + +== Debugger + +Debugger support is available through the debugger command when you start your +Mongrel or WEBrick server with --debugger. This means that you can break out of +execution at any point in the code, investigate and change the model, and then, +resume execution! You need to install ruby-debug to run the server in debugging +mode. With gems, use sudo gem install ruby-debug. Example: + + class WeblogController < ActionController::Base + def index + @posts = Post.all + debugger + end + end + +So the controller will accept the action, run the first line, then present you +with a IRB prompt in the server window. Here you can do things like: + + >> @posts.inspect + => "[#nil, "body"=>nil, "id"=>"1"}>, + #"Rails", "body"=>"Only ten..", "id"=>"2"}>]" + >> @posts.first.title = "hello from a debugger" + => "hello from a debugger" + +...and even better, you can examine how your runtime objects actually work: + + >> f = @posts.first + => #nil, "body"=>nil, "id"=>"1"}> + >> f. + Display all 152 possibilities? (y or n) + +Finally, when you're ready to resume execution, you can enter "cont". + + +== Console + +The console is a Ruby shell, which allows you to interact with your +application's domain model. Here you'll have all parts of the application +configured, just like it is when the application is running. You can inspect +domain models, change values, and save to the database. Starting the script +without arguments will launch it in the development environment. + +To start the console, run rails console from the application +directory. + +Options: + +* Passing the -s, --sandbox argument will rollback any modifications + made to the database. +* Passing an environment name as an argument will load the corresponding + environment. Example: rails console production. + +To reload your controllers and models after launching the console run +reload! + +More information about irb can be found at: +link:http://www.rubycentral.org/pickaxe/irb.html + + +== dbconsole + +You can go to the command line of your database directly through rails +dbconsole. You would be connected to the database with the credentials +defined in database.yml. Starting the script without arguments will connect you +to the development database. Passing an argument will connect you to a different +database, like rails dbconsole production. Currently works for MySQL, +PostgreSQL and SQLite 3. + +== Description of Contents + +The default directory structure of a generated Ruby on Rails application: + + |-- app + | |-- assets + | |-- images + | |-- javascripts + | `-- stylesheets + | |-- controllers + | |-- helpers + | |-- mailers + | |-- models + | `-- views + | `-- layouts + |-- config + | |-- environments + | |-- initializers + | `-- locales + |-- db + |-- doc + |-- lib + | `-- tasks + |-- log + |-- public + |-- script + |-- test + | |-- fixtures + | |-- functional + | |-- integration + | |-- performance + | `-- unit + |-- tmp + | |-- cache + | |-- pids + | |-- sessions + | `-- sockets + `-- vendor + |-- assets + `-- stylesheets + `-- plugins + +app + Holds all the code that's specific to this particular application. + +app/assets + Contains subdirectories for images, stylesheets, and JavaScript files. + +app/controllers + Holds controllers that should be named like weblogs_controller.rb for + automated URL mapping. All controllers should descend from + ApplicationController which itself descends from ActionController::Base. + +app/models + Holds models that should be named like post.rb. Models descend from + ActiveRecord::Base by default. + +app/views + Holds the template files for the view that should be named like + weblogs/index.html.erb for the WeblogsController#index action. All views use + eRuby syntax by default. + +app/views/layouts + Holds the template files for layouts to be used with views. This models the + common header/footer method of wrapping views. In your views, define a layout + using the layout :default and create a file named default.html.erb. + Inside default.html.erb, call <% yield %> to render the view using this + layout. + +app/helpers + Holds view helpers that should be named like weblogs_helper.rb. These are + generated for you automatically when using generators for controllers. + Helpers can be used to wrap functionality for your views into methods. + +config + Configuration files for the Rails environment, the routing map, the database, + and other dependencies. + +db + Contains the database schema in schema.rb. db/migrate contains all the + sequence of Migrations for your schema. + +doc + This directory is where your application documentation will be stored when + generated using rake doc:app + +lib + Application specific libraries. Basically, any kind of custom code that + doesn't belong under controllers, models, or helpers. This directory is in + the load path. + +public + The directory available for the web server. Also contains the dispatchers and the + default HTML files. This should be set as the DOCUMENT_ROOT of your web + server. + +script + Helper scripts for automation and generation. + +test + Unit and functional tests along with fixtures. When using the rails generate + command, template test files will be generated for you and placed in this + directory. + +vendor + External libraries that the application depends on. Also includes the plugins + subdirectory. If the app has frozen rails, those gems also go here, under + vendor/rails/. This directory is in the load path. diff --git a/spec/dummy/Rakefile b/spec/dummy/Rakefile new file mode 100644 index 00000000..36458522 --- /dev/null +++ b/spec/dummy/Rakefile @@ -0,0 +1,7 @@ +#!/usr/bin/env rake +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Dummy::Application.load_tasks diff --git a/spec/dummy/app/assets/javascripts/admin/all.js b/spec/dummy/app/assets/javascripts/admin/all.js new file mode 100644 index 00000000..bcf76f29 --- /dev/null +++ b/spec/dummy/app/assets/javascripts/admin/all.js @@ -0,0 +1,10 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// + +//= require admin/spree_auth + +//= require_tree . diff --git a/spec/dummy/app/assets/javascripts/application.js b/spec/dummy/app/assets/javascripts/application.js new file mode 100644 index 00000000..9097d830 --- /dev/null +++ b/spec/dummy/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/spec/dummy/app/assets/javascripts/store/all.js b/spec/dummy/app/assets/javascripts/store/all.js new file mode 100644 index 00000000..7897a145 --- /dev/null +++ b/spec/dummy/app/assets/javascripts/store/all.js @@ -0,0 +1,12 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require jquery +//= require jquery_ujs + +//= require store/spree_auth + +//= require_tree . diff --git a/spec/dummy/app/assets/stylesheets/admin/all.css b/spec/dummy/app/assets/stylesheets/admin/all.css new file mode 100644 index 00000000..a439ffdd --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/admin/all.css @@ -0,0 +1,11 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + + *= require admin/spree_auth + + *= require_self + *= require_tree . +*/ diff --git a/spec/dummy/app/assets/stylesheets/application.css b/spec/dummy/app/assets/stylesheets/application.css new file mode 100644 index 00000000..3b5cc664 --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/application.css @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . +*/ diff --git a/spec/dummy/app/assets/stylesheets/store/all.css b/spec/dummy/app/assets/stylesheets/store/all.css new file mode 100644 index 00000000..f1dba67a --- /dev/null +++ b/spec/dummy/app/assets/stylesheets/store/all.css @@ -0,0 +1,11 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + * + + *= require store/spree_auth + + *= require_self + *= require_tree . +*/ diff --git a/spec/dummy/app/controllers/application_controller.rb b/spec/dummy/app/controllers/application_controller.rb new file mode 100644 index 00000000..e8065d95 --- /dev/null +++ b/spec/dummy/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/spec/dummy/app/helpers/application_helper.rb b/spec/dummy/app/helpers/application_helper.rb new file mode 100644 index 00000000..de6be794 --- /dev/null +++ b/spec/dummy/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/dummy/app/mailers/.gitkeep b/spec/dummy/app/mailers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/dummy/app/models/.gitkeep b/spec/dummy/app/models/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb new file mode 100644 index 00000000..4cab2684 --- /dev/null +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Dummy + <%= stylesheet_link_tag "application", :media => "all" %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + + + +<%= yield %> + + + diff --git a/spec/dummy/config.ru b/spec/dummy/config.ru new file mode 100644 index 00000000..1989ed8d --- /dev/null +++ b/spec/dummy/config.ru @@ -0,0 +1,4 @@ +# This file is used by Rack-based servers to start the application. + +require ::File.expand_path('../config/environment', __FILE__) +run Dummy::Application diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb new file mode 100644 index 00000000..3e91345c --- /dev/null +++ b/spec/dummy/config/application.rb @@ -0,0 +1,71 @@ +require File.expand_path('../boot', __FILE__) + +require 'rails/all' + +Bundler.require(*Rails.groups) + +require 'spree/auth' + +module Dummy + class Application < Rails::Application + + config.to_prepare do + # Load application's model / class decorators + Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + + # Load application's view overrides + Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| + Rails.configuration.cache_classes ? require(c) : load(c) + end + end + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + + # Custom directories with classes and modules you want to be autoloadable. + # config.autoload_paths += %W(#{config.root}/extras) + + # Only load the plugins named here, in the order given (default is alphabetical). + # :all can be used as a placeholder for all plugins not explicitly named. + # config.plugins = [ :exception_notification, :ssl_requirement, :all ] + + # Activate observers that should always be running. + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer + + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. + # config.time_zone = 'Central Time (US & Canada)' + + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] + # config.i18n.default_locale = :de + + # Configure the default encoding used in templates for Ruby 1.9. + config.encoding = "utf-8" + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] + + # Use SQL instead of Active Record's schema dumper when creating the database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + config.active_record.whitelist_attributes = true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' + end +end + + diff --git a/spec/dummy/config/boot.rb b/spec/dummy/config/boot.rb new file mode 100644 index 00000000..71a041d7 --- /dev/null +++ b/spec/dummy/config/boot.rb @@ -0,0 +1,6 @@ +require 'rubygems' +gemfile = File.expand_path("../../../../../Gemfile", __FILE__) + +ENV['BUNDLE_GEMFILE'] = gemfile +require 'bundler' +Bundler.setup diff --git a/spec/dummy/config/database.yml b/spec/dummy/config/database.yml new file mode 100644 index 00000000..abb9a6fa --- /dev/null +++ b/spec/dummy/config/database.yml @@ -0,0 +1,11 @@ + +development: + adapter: sqlite3 + database: "db/spree_development.sqlite3" +test: + adapter: sqlite3 + database: "db/spree_test.sqlite3" +production: + adapter: sqlite3 + database: "db/spree_production.sqlite3" + diff --git a/spec/dummy/config/environment.rb b/spec/dummy/config/environment.rb new file mode 100644 index 00000000..622546b0 --- /dev/null +++ b/spec/dummy/config/environment.rb @@ -0,0 +1,7 @@ +# Load the rails application +require File.expand_path('../application', __FILE__) + +# Initialize the rails application +Dummy::Application.initialize! + +ActiveRecord::Base.include_root_in_json = true diff --git a/spec/dummy/config/environments/development.rb b/spec/dummy/config/environments/development.rb new file mode 100644 index 00000000..82c74d15 --- /dev/null +++ b/spec/dummy/config/environments/development.rb @@ -0,0 +1,37 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Log error messages when you accidentally call methods on nil. + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + + # Print deprecation notices to the Rails logger + config.active_support.deprecation = :log + + # Only use best-standards-support built into browsers + config.action_dispatch.best_standards_support = :builtin + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + config.active_record.auto_explain_threshold_in_seconds = 0.5 + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true +end diff --git a/spec/dummy/config/environments/production.rb b/spec/dummy/config/environments/production.rb new file mode 100644 index 00000000..56e30664 --- /dev/null +++ b/spec/dummy/config/environments/production.rb @@ -0,0 +1,67 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # Code is not reloaded between requests + config.cache_classes = true + + # Full error reports are disabled and caching is turned on + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to Rails.root.join("public/assets") + # config.assets.manifest = YOUR_PATH + + # Specifies the header that your server uses for sending files + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # See everything in the log (default is :info) + # config.log_level = :debug + + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + + # Use a different logger for distributed setups + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) + + # Use a different cache store in production + # config.cache_store = :mem_cache_store + + # Enable serving of images, stylesheets, and JavaScripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + + # Disable delivery errors, bad email addresses will be ignored + # config.action_mailer.raise_delivery_errors = false + + # Enable threaded mode + # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners + config.active_support.deprecation = :notify + + # Log the query plan for queries taking more than this (works + # with SQLite, MySQL, and PostgreSQL) + # config.active_record.auto_explain_threshold_in_seconds = 0.5 +end diff --git a/spec/dummy/config/environments/test.rb b/spec/dummy/config/environments/test.rb new file mode 100644 index 00000000..f1a48141 --- /dev/null +++ b/spec/dummy/config/environments/test.rb @@ -0,0 +1,37 @@ +Dummy::Application.configure do + # Settings specified here will take precedence over those in config/application.rb + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil + config.whiny_nils = true + + # Show full error reports and disable caching + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment + config.action_controller.allow_forgery_protection = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + + # Print deprecation notices to the stderr + config.active_support.deprecation = :stderr +end diff --git a/spec/dummy/config/initializers/backtrace_silencers.rb b/spec/dummy/config/initializers/backtrace_silencers.rb new file mode 100644 index 00000000..59385cdf --- /dev/null +++ b/spec/dummy/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/dummy/config/initializers/inflections.rb b/spec/dummy/config/initializers/inflections.rb new file mode 100644 index 00000000..5d8d9be2 --- /dev/null +++ b/spec/dummy/config/initializers/inflections.rb @@ -0,0 +1,15 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format +# (all these examples are active by default): +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end +# +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/spec/dummy/config/initializers/mime_types.rb b/spec/dummy/config/initializers/mime_types.rb new file mode 100644 index 00000000..72aca7e4 --- /dev/null +++ b/spec/dummy/config/initializers/mime_types.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf +# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/dummy/config/initializers/secret_token.rb b/spec/dummy/config/initializers/secret_token.rb new file mode 100644 index 00000000..f20165c7 --- /dev/null +++ b/spec/dummy/config/initializers/secret_token.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Dummy::Application.config.secret_token = '4f1fb4ba3a1b317d297f5ad4f603d0b09ddd01572c9fb4e2b6954b021ae1c566abc840611d81a580c46e7c3595e7e7b49dfce2025eca8077bfcfe19481c43203' diff --git a/spec/dummy/config/initializers/session_store.rb b/spec/dummy/config/initializers/session_store.rb new file mode 100644 index 00000000..aa2f5129 --- /dev/null +++ b/spec/dummy/config/initializers/session_store.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session' + +# Use the database for sessions instead of the cookie-based default, +# which shouldn't be used to store highly confidential information +# (create the session table with "rails generate session_migration") +# Dummy::Application.config.session_store :active_record_store diff --git a/spec/dummy/config/initializers/spree.rb b/spec/dummy/config/initializers/spree.rb new file mode 100644 index 00000000..e1671c55 --- /dev/null +++ b/spec/dummy/config/initializers/spree.rb @@ -0,0 +1,12 @@ +# Configure Spree Preferences +# +# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart. +# If you would like users to be able to update a setting with the Admin it should NOT be set here. +# +# In order to initialize a setting do: +# config.setting_name = 'new value' +Spree.config do |config| + # Example: + # Uncomment to override the default site name. + # config.site_name = "Spree Demo Site" +end diff --git a/spec/dummy/config/initializers/wrap_parameters.rb b/spec/dummy/config/initializers/wrap_parameters.rb new file mode 100644 index 00000000..da4fb076 --- /dev/null +++ b/spec/dummy/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters :format => [:json] +end + +# Disable root element in JSON by default. +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false +end diff --git a/spec/dummy/config/locales/en.yml b/spec/dummy/config/locales/en.yml new file mode 100644 index 00000000..179c14ca --- /dev/null +++ b/spec/dummy/config/locales/en.yml @@ -0,0 +1,5 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + hello: "Hello world" diff --git a/spec/dummy/config/routes.rb b/spec/dummy/config/routes.rb new file mode 100644 index 00000000..1c8c7310 --- /dev/null +++ b/spec/dummy/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + mount Spree::Core::Engine => "/" +end diff --git a/spec/dummy/config/spree.yml b/spec/dummy/config/spree.yml new file mode 100644 index 00000000..825b8877 --- /dev/null +++ b/spec/dummy/config/spree.yml @@ -0,0 +1,2 @@ +--- +version: 1.1.0 diff --git a/spec/dummy/db/migrate/20120502190250_spree_zero_nine_zero.spree.rb b/spec/dummy/db/migrate/20120502190250_spree_zero_nine_zero.spree.rb new file mode 100644 index 00000000..9319f0e4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190250_spree_zero_nine_zero.spree.rb @@ -0,0 +1,390 @@ +# This migration comes from spree (originally 20090823005402) +class SpreeZeroNineZero < ActiveRecord::Migration + # This is a legacy migration consolidating all of the database changes needed as of Spree 0.9.0 + # (See http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/772) + + def change + create_table :addresses, :force => true do |t| + t.string :firstname, :lastname, :address1, :address2, :city, + :zipcode, :phone, :state_name, :alternative_phone + t.references :state + t.references :country + + t.timestamps + end + + create_table :adjustments, :force => true do |t| + t.integer :position, :adjustment_source_id + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :type, :description, :adjustment_source_type, :secondary_type + t.references :order + + t.timestamps + end + + create_table :assets, :force => true do |t| + t.integer :viewable_id, :attachment_width, :attachment_height, + :attachment_size, :position + t.string :viewable_type, :limit => 50 + t.string :attachment_content_type, :attachment_file_name + t.string :type, :limit => 75 + t.datetime :attachment_updated_at + end + + create_table :calculators, :force => true do |t| + t.string :type + t.integer :calculable_id, :null => false + t.string :calculable_type, :null => false + + t.timestamps + end + + create_table :checkouts, :force => true do |t| + t.references :order + t.string :email, :ip_address + t.text :special_instructions + t.integer :bill_address_id + t.datetime :completed_at + + t.timestamps + end + + create_table :configurations, :force => true do |t| + t.string :name + t.string :type, :limit => 50 + + t.timestamps + end + + add_index :configurations, [:name, :type], :name => 'index_configurations_on_name_and_type' + + create_table :countries, :force => true do |t| + t.string :iso_name, :iso, :iso3, :name + t.integer :numcode + end + + create_table :coupons, :force => true do |t| + t.string :code, :description + t.integer :usage_limit + t.boolean :combine + t.datetime :expires_at, :starts_at + + t.timestamps + end + + create_table :creditcard_txns, :force => true do |t| + t.integer :creditcard_payment_id, :txn_type + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :response_code + t.text :avs_response, :cvv_response + + t.timestamps + end + + create_table :creditcards, :force => true do |t| + t.text :number, :verification_value + t.string :month, :year, :cc_type, :display_number, :first_name, + :last_name, :start_month, :start_year, :issue_number + t.references :address + t.references :checkout + + t.timestamps + end + + create_table :gateway_configurations, :force => true do |t| + t.references :gateway + + t.timestamps + end + + create_table :gateway_option_values, :force => true do |t| + t.references :gateway_configuration + t.references :gateway_option + t.text :value + + t.timestamps + end + + create_table :gateway_options, :force => true do |t| + t.string :name + t.text :description + t.boolean :textarea, :default => false + t.references :gateway + + t.timestamps + end + + create_table :gateways, :force => true do |t| + t.string :clazz, :name + t.text :description + t.boolean :active + + t.timestamps + end + + create_table :inventory_units, :force => true do |t| + t.integer :lock_version, :default => 0 + t.string :state + t.references :variant + t.references :order + + t.timestamps + end + + create_table :line_items, :force => true do |t| + t.references :order + t.references :variant + t.integer :quantity, :null => false + t.decimal :price, :precision => 8, :scale => 2, :null => false + + t.timestamps + end + + add_index :line_items, :order_id, :name => 'index_line_items_on_order_id' + add_index :line_items, :variant_id, :name => 'index_line_items_on_variant_id' + + create_table :option_types, :force => true do |t| + t.string :name, :limit => 100 + t.string :presentation, :limit => 100 + + t.timestamps + end + + create_table :option_types_prototypes, :id => false, :force => true do |t| + t.references :prototype + t.references :option_type + end + + create_table :option_values, :force => true do |t| + t.integer :position + t.string :name, :presentation + t.references :option_type + + t.timestamps + end + + create_table :option_values_variants, :id => false, :force => true do |t| + t.integer :variant_id + t.integer :option_value_id + end + + add_index :option_values_variants, :variant_id, :name => 'index_option_values_variants_on_variant_id' + + create_table :orders, :force => true do |t| + t.string :number, :limit => 15 + t.decimal :item_total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal :total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :state + t.string :token + t.decimal :adjustment_total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal :credit_total, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.references :user + + t.timestamps + end + + add_index :orders, :number, :name => 'index_orders_on_number' + + create_table :payments, :force => true do |t| + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string :type + t.references :order + t.references :creditcard + + t.timestamps + end + + create_table :preferences, :force => true do |t| + t.string :attribute, :null => false, :limit => 100 + t.integer :owner_id, :null => false, :limit => 30 + t.string :owner_type, :null => false, :limit => 50 + t.integer :group_id + t.string :group_type, :limit => 50 + t.string :value + + t.timestamps + end + + add_index :preferences, [:owner_id, :owner_type, :attribute, :group_id, :group_type], :name => 'index_preferences_on_owner_and_attribute_and_preference', :unique => true + + create_table :product_option_types, :force => true do |t| + t.integer :position + t.references :product + t.references :option_type + + t.timestamps + end + + create_table :product_properties, :force => true do |t| + t.string :value + t.references :product + t.references :property + + t.timestamps + end + + create_table :products, :force => true do |t| + t.string :name, :default => '', :null => false + t.text :description + t.datetime :available_on, :deleted_at + t.string :permalink, :meta_description, :meta_keywords + t.references :tax_category + t.references :shipping_category + + t.timestamps + end + + add_index :products, :available_on, :name => 'index_products_on_available_on' + add_index :products, :deleted_at, :name => 'index_products_on_deleted_at' + add_index :products, :name, :name => 'index_products_on_name' + add_index :products, :permalink, :name => 'index_products_on_permalink' + + create_table :products_taxons, :id => false, :force => true do |t| + t.references :product + t.references :taxon + end + + add_index :products_taxons, :product_id, :name => 'index_products_taxons_on_product_id' + add_index :products_taxons, :taxon_id, :name => 'index_products_taxons_on_taxon_id' + + create_table :properties, :force => true do |t| + t.string :name + t.string :presentation, :null => false + + t.timestamps + end + + create_table :properties_prototypes, :id => false, :force => true do |t| + t.references :prototype + t.references :property + end + + create_table :prototypes, :force => true do |t| + t.string :name + + t.timestamps + end + + create_table :roles, :force => true do |t| + t.string :name + end + + create_table :roles_users, :id => false, :force => true do |t| + t.references :role + t.references :user + end + + add_index :roles_users, :role_id, :name => 'index_roles_users_on_role_id' + add_index :roles_users, :user_id, :name => 'index_roles_users_on_user_id' + + create_table :shipments, :force => true do |t| + t.string :tracking, :number + t.decimal :cost, :precision => 8, :scale => 2 + t.datetime :shipped_at + t.references :order + t.references :shipping_method + t.references :address + + t.timestamps + end + + create_table :shipping_categories, :force => true do |t| + t.string :name + + t.timestamps + end + + create_table :shipping_methods, :force => true do |t| + t.string :name + t.references :zone + + t.timestamps + end + + create_table :state_events, :force => true do |t| + t.string :name, :previous_state + t.references :order + t.references :user + + t.timestamps + end + + create_table :states, :force => true do |t| + t.string :name + t.string :abbr + t.references :country + end + + create_table :tax_categories, :force => true do |t| + t.string :name, :description + + t.timestamps + end + + create_table :tax_rates, :force => true do |t| + t.decimal :amount, :precision => 8, :scale => 4 + t.references :zone + t.references :tax_category + + t.timestamps + end + + create_table :taxonomies, :force => true do |t| + t.string :name, :null => false + + t.timestamps + end + + create_table :taxons, :force => true do |t| + t.integer :parent_id + t.integer :position, :default => 0 + t.string :name, :null => false + t.string :permalink + t.references :taxonomy + + t.timestamps + end + + create_table :users, :force => true do |t| + t.string :crypted_password, :limit => 128, :default => '', :null => false + t.string :salt, :limit => 128, :default => '', :null => false + t.string :email, :remember_token, :remember_token_expires_at, + :persistence_token, :single_access_token, :perishable_token + t.integer :login_count, :default => 0, :null => false + t.integer :failed_login_count, :default => 0, :null => false + t.datetime :last_request_at, :current_login_at, :last_login_at + t.string :current_login_ip, :last_login_ip, :login + t.integer :ship_address_id, :bill_address_id + + t.timestamps + end + + create_table :variants, :force => true do |t| + t.string :sku, :default => '', :null => false + t.decimal :price, :precision => 8, :scale => 2, :null => false + t.decimal :weight, :precision => 8, :scale => 2 + t.decimal :height, :precision => 8, :scale => 2 + t.decimal :width, :precision => 8, :scale => 2 + t.decimal :depth, :precision => 8, :scale => 2 + t.datetime :deleted_at + t.boolean :is_master, :default => false + t.references :product + end + + add_index :variants, :product_id, :name => 'index_variants_on_product_id' + + create_table :zone_members, :force => true do |t| + t.integer :zoneable_id + t.string :zoneable_type + t.references :zone + + t.timestamps + end + + create_table :zones, :force => true do |t| + t.string :name, :description + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190251_create_indexes_for_inventory_units.spree.rb b/spec/dummy/db/migrate/20120502190251_create_indexes_for_inventory_units.spree.rb new file mode 100644 index 00000000..35f34bf3 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190251_create_indexes_for_inventory_units.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20090904192342) +class CreateIndexesForInventoryUnits < ActiveRecord::Migration + def change + add_index :inventory_units, :variant_id + add_index :inventory_units, :order_id + end +end diff --git a/spec/dummy/db/migrate/20120502190252_add_count_on_hand_to_variants_and_products.spree.rb b/spec/dummy/db/migrate/20120502190252_add_count_on_hand_to_variants_and_products.spree.rb new file mode 100644 index 00000000..cf059392 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190252_add_count_on_hand_to_variants_and_products.spree.rb @@ -0,0 +1,50 @@ +# This migration comes from spree (originally 20090923100315) +class AddCountOnHandToVariantsAndProducts < ActiveRecord::Migration + def up + add_column :variants, :count_on_hand, :integer, :default => 0, :null => false + add_column :products, :count_on_hand, :integer, :default => 0, :null => false + + # Due to our namespacing changes, this migration (from earlier Spree versions) is broken + # To fix it, temporarily set table name on each of the models involved + # And then... + Spree::Variant.table_name = 'variants' + Spree::Product.table_name = 'products' + Spree::InventoryUnit.table_name = 'inventory_units' + + # In some cases needed to reflect changes in table structure + Spree::Variant.reset_column_information + Spree::Product.reset_column_information + + say_with_time 'Transfering inventory units with status on_hand to variants table...' do + Spree::Variant.all.each do |v| + v.update_attribute(:count_on_hand, v.inventory_units.with_state('on_hand').size) + Spree::InventoryUnit.destroy_all(:variant_id => v.id, :state => 'on_hand') + end + end + + say_with_time 'Updating products count on hand' do + Spree::Product.all.each do |p| + product_count_on_hand = p.has_variants? ? + p.variants.inject(0) { |acc, v| acc + v.count_on_hand } : + (p.master ? p.master.count_on_hand : 0) + p.update_attribute(:count_on_hand, product_count_on_hand) + end + end + + # ... Switch things back at the end of the migration + Spree::Variant.table_name = 'spree_variants' + Spree::Product.table_name = 'spree_products' + Spree::InventoryUnit.table_name = 'spree_inventory_units' + end + + def down + Spree::Variant.all.each do |v| + v.count_on_hand.times do + Spree::InventoryUnit.create(:variant => variant, :state => 'on_hand') + end + end + + remove_column :variants, :count_on_hand + remove_column :products, :count_on_hand + end +end diff --git a/spec/dummy/db/migrate/20120502190253_change_taxons_to_nested_set.spree.rb b/spec/dummy/db/migrate/20120502190253_change_taxons_to_nested_set.spree.rb new file mode 100644 index 00000000..c7eb5674 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190253_change_taxons_to_nested_set.spree.rb @@ -0,0 +1,47 @@ +# This migration comes from spree (originally 20091007134354) +class ChangeTaxonsToNestedSet < ActiveRecord::Migration + def up + add_column :taxons, :lft, :integer + add_column :taxons, :rgt, :integer + + Spree::Taxon.reset_column_information # So the new root ids get saved + + # Temporarily set the table back to taxons + Spree::Taxon.table_name = 'taxons' + + Spree::Taxon.class_eval do + # adapted from awesome nested set to use 'position' information + indices = {} + + left_column_name = 'lft' + right_column_name = 'rgt' + quoted_parent_column_name = 'parent_id' + scope = lambda{|node|} + + set_left_and_rights = lambda do |node| + # set left + node[left_column_name] = indices[scope.call(node)] += 1 + # find + where("#{quoted_parent_column_name} = ?", node).order('position ASC').each{ |n| set_left_and_rights.call(n) } + # set right + node[right_column_name] = indices[scope.call(node)] += 1 + node.save! + end + + # Find root node(s) + where("#{quoted_parent_column_name}" => nil).order('position ASC').each do |root_node| + # setup index for this scope + indices[scope.call(root_node)] ||= 0 + set_left_and_rights.call(root_node) + end + end + + # Set it back after the migration + Spree::Taxon.table_name = 'spree_taxons' + end + + def down + remove_column :taxons, :lft + remove_column :taxons, :rgt + end +end diff --git a/spec/dummy/db/migrate/20120502190254_move_to_configurable_gateways.spree.rb b/spec/dummy/db/migrate/20120502190254_move_to_configurable_gateways.spree.rb new file mode 100644 index 00000000..3390e0b7 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190254_move_to_configurable_gateways.spree.rb @@ -0,0 +1,55 @@ +# This migration comes from spree (originally 20091008091614) +class MoveToConfigurableGateways < ActiveRecord::Migration + def up + drop_table :gateways + drop_table :gateway_options + drop_table :gateway_option_values + drop_table :gateway_configurations + + create_table :gateways, :force => true do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + t.string :server, :default => 'test' + t.boolean :test_mode, :default => true + + t.timestamps + end + end + + def down + drop_table :gateways + + create_table :gateway_configurations, :force => true do |t| + t.references :gateway + + t.timestamps + end + + create_table :gateway_option_values, :force => true do |t| + t.text :value + t.references :gateway_configuration + t.references :gateway_option + + t.timestamps + end + + create_table :gateway_options, :force => true do |t| + t.string :name + t.text :description + t.boolean :textarea, :default => false + t.references :gateway + + t.timestamps + end + + create_table :gateways, :force => true do |t| + t.string :clazz, :name + t.text :description + t.boolean :active + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190255_add_open_id_authentication_tables.spree.rb b/spec/dummy/db/migrate/20120502190255_add_open_id_authentication_tables.spree.rb new file mode 100644 index 00000000..1715d127 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190255_add_open_id_authentication_tables.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20091015110842) +class AddOpenIdAuthenticationTables < ActiveRecord::Migration + def change + create_table :open_id_authentication_associations, :force => true do |t| + t.integer :issued, :lifetime + t.string :handle, :assoc_type + t.binary :server_url, :secret + end + + create_table :open_id_authentication_nonces, :force => true do |t| + t.integer :timestamp, :null => false + t.string :server_url, :null => true + t.string :salt, :null => false + end + end +end diff --git a/spec/dummy/db/migrate/20120502190256_add_openid_field_to_users.spree.rb b/spec/dummy/db/migrate/20120502190256_add_openid_field_to_users.spree.rb new file mode 100644 index 00000000..5b62dc80 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190256_add_openid_field_to_users.spree.rb @@ -0,0 +1,25 @@ +# This migration comes from spree (originally 20091015153048) +class AddOpenidFieldToUsers < ActiveRecord::Migration + def up + add_column :users, :openid_identifier, :string + add_index :users, :openid_identifier + + change_column :users, :login, :string, :default => nil, :null => true + change_column :users, :crypted_password, :string, :default => nil, :null => true + change_column :users, :salt, :string, :default => nil, :null => true + end + + def down + remove_column :users, :openid_identifier + + # Due to namespacing change, temporarily set the table back to users + Spree::User.table_name = 'users' + + [:login, :crypted_password, :salt].each do |field| + Spree::User.where(field => nil).each { |user| user.update_attribute(field, '') if user.send(field).nil? } + change_column :users, field, :string, :default => '', :null => false + end + + Spree::User.table_name = 'spree_users' + end +end diff --git a/spec/dummy/db/migrate/20120502190257_change_preference_value_type.spree.rb b/spec/dummy/db/migrate/20120502190257_change_preference_value_type.spree.rb new file mode 100644 index 00000000..e3cb4ed4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190257_change_preference_value_type.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20091016174634) +class ChangePreferenceValueType < ActiveRecord::Migration + def up + remove_index :preferences, :name => 'index_preferences_on_owner_and_attribute_and_preference' + change_column :preferences, :value, :text + end + + def down + change_column :preferences, :value, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190258_create_billing_integrations.spree.rb b/spec/dummy/db/migrate/20120502190258_create_billing_integrations.spree.rb new file mode 100644 index 00000000..028018ac --- /dev/null +++ b/spec/dummy/db/migrate/20120502190258_create_billing_integrations.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20091017175558) +class CreateBillingIntegrations < ActiveRecord::Migration + def change + create_table :billing_integrations do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190259_charge_refactoring.spree.rb b/spec/dummy/db/migrate/20120502190259_charge_refactoring.spree.rb new file mode 100644 index 00000000..b09913ec --- /dev/null +++ b/spec/dummy/db/migrate/20120502190259_charge_refactoring.spree.rb @@ -0,0 +1,40 @@ +# This migration comes from spree (originally 20091021133257) +class Checkout < ActiveRecord::Base; end; + +# Hack to prevent issues with legacy migrations +class Order < ActiveRecord::Base + has_one :checkout +end + +class ChargeRefactoring < ActiveRecord::Migration + def up + # Temporarily set table name for legacy support + Spree::Adjustment.table_name = 'adjustments' + + add_column :orders, :completed_at, :timestamp + Order.reset_column_information + Order.all.each { |o| o.update_attribute(:completed_at, o.checkout && o.checkout.read_attribute(:completed_at)) } + remove_column :checkouts, :completed_at + + change_column :adjustments, :amount, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + Spree::Adjustment.update_all :type => 'secondary_type' + Spree::Adjustment.where(:type => 'Credit').update_all(:type => 'CouponCredit') + remove_column :adjustments, :secondary_type + + # Reset table name + Spree::Adjustment.table_name = 'spree_adjustments' + end + + def down + add_column :checkouts, :completed_at, :timestamp + Spree::Checkout.reset_column_information + Spree::Checkout.all.each { |c| c.update_attribute(:completed_at, c.order && c.order.completed_at) } + remove_column :orders, :completed_at + + add_column :adjustments, :secondary_type, :string + Spree::Adjustment.update_all :secondary_type => 'type' + Spree::Adjustment.where('type LIKE ?', '%Charge').update_all(:type => 'Charge') + Spree::Adjustment.where('type LIKE ?', '%Credit').update_all(:type => 'Credit') + change_column :adjustments, :amount, :decimal, :null => false, :default => 0, :precision => 8, :scale => 2 + end +end diff --git a/spec/dummy/db/migrate/20120502190260_add_some_indexes.spree.rb b/spec/dummy/db/migrate/20120502190260_add_some_indexes.spree.rb new file mode 100644 index 00000000..65118a50 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190260_add_some_indexes.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20091104151730) +class AddSomeIndexes < ActiveRecord::Migration + def change + add_index :taxons, :permalink + add_index :taxons, :parent_id + add_index :taxons, :taxonomy_id + add_index :assets, :viewable_id + add_index :assets, [:viewable_type, :type] + add_index :product_properties, :product_id + add_index :option_values_variants, [:variant_id, :option_value_id] + end +end diff --git a/spec/dummy/db/migrate/20120502190261_checkout_state_machine.spree.rb b/spec/dummy/db/migrate/20120502190261_checkout_state_machine.spree.rb new file mode 100644 index 00000000..41055f97 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190261_checkout_state_machine.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091126190904) +class CheckoutStateMachine < ActiveRecord::Migration + def change + add_column :checkouts, :state, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190262_state_for_shipments.spree.rb b/spec/dummy/db/migrate/20120502190262_state_for_shipments.spree.rb new file mode 100644 index 00000000..52294f86 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190262_state_for_shipments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091209153045) +class StateForShipments < ActiveRecord::Migration + def change + add_column :shipments, :state, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190263_make_state_events_polymorphic.spree.rb b/spec/dummy/db/migrate/20120502190263_make_state_events_polymorphic.spree.rb new file mode 100644 index 00000000..d22566bd --- /dev/null +++ b/spec/dummy/db/migrate/20120502190263_make_state_events_polymorphic.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20091209202200) +class MakeStateEventsPolymorphic < ActiveRecord::Migration + def up + rename_column :state_events, :order_id, :stateful_id + add_column :state_events, :stateful_type, :string + execute "UPDATE state_events SET stateful_type = 'Order'" + end + + def down + rename_column :state_events, :stateful_id, :order_id + remove_column :state_events, :stateful_type + end +end diff --git a/spec/dummy/db/migrate/20120502190264_ship_address_id_for_checkouts.spree.rb b/spec/dummy/db/migrate/20120502190264_ship_address_id_for_checkouts.spree.rb new file mode 100644 index 00000000..cb86c44d --- /dev/null +++ b/spec/dummy/db/migrate/20120502190264_ship_address_id_for_checkouts.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091211203813) +class ShipAddressIdForCheckouts < ActiveRecord::Migration + def change + add_column :checkouts, :ship_address_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190265_shipping_method_id_for_checkouts.spree.rb b/spec/dummy/db/migrate/20120502190265_shipping_method_id_for_checkouts.spree.rb new file mode 100644 index 00000000..8834f29c --- /dev/null +++ b/spec/dummy/db/migrate/20120502190265_shipping_method_id_for_checkouts.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20091212161118) +class ShippingMethodIdForCheckouts < ActiveRecord::Migration + def change + add_column :checkouts, :shipping_method_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190266_creditcard_last_four_digits.spree.rb b/spec/dummy/db/migrate/20120502190266_creditcard_last_four_digits.spree.rb new file mode 100644 index 00000000..327a1666 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190266_creditcard_last_four_digits.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20091213222815) +class CreditcardLastFourDigits < ActiveRecord::Migration + def up + rename_column :creditcards, :display_number, :last_digits + + creditcards = select_all "SELECT * FROM creditcards" + creditcards.each do |card| + execute "UPDATE creditcards SET last_digits = '#{card['last_digits'].gsub('XXXX-XXXX-XXXX-', '')}' WHERE id = #{card['id']}" if card['last_digits'].present? + end + end + + def down + rename_column :creditcards, :last_digits, :display_number + end +end diff --git a/spec/dummy/db/migrate/20120502190267_populate_legacy_shipment_state.spree.rb b/spec/dummy/db/migrate/20120502190267_populate_legacy_shipment_state.spree.rb new file mode 100644 index 00000000..a35558eb --- /dev/null +++ b/spec/dummy/db/migrate/20120502190267_populate_legacy_shipment_state.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20091214183826) +class PopulateLegacyShipmentState < ActiveRecord::Migration + def up + shipments = select_all "SELECT * FROM shipments" + shipments.each do |shipment| + if shipment['shipped_at'] + execute "UPDATE shipments SET state = 'shipped'" + else + execute "UPDATE shipments SET state = 'pending'" + end + end + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190268_add_cost_price.spree.rb b/spec/dummy/db/migrate/20120502190268_add_cost_price.spree.rb new file mode 100644 index 00000000..1d7c8fd8 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190268_add_cost_price.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100105090147) +class AddCostPrice < ActiveRecord::Migration + def change + add_column :variants, :cost_price, :decimal, :null => true, :default => nil, :precision => 8, :scale => 2 + end +end diff --git a/spec/dummy/db/migrate/20120502190269_shipment_id_for_inventory_units.spree.rb b/spec/dummy/db/migrate/20120502190269_shipment_id_for_inventory_units.spree.rb new file mode 100644 index 00000000..158f4162 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190269_shipment_id_for_inventory_units.spree.rb @@ -0,0 +1,26 @@ +# This migration comes from spree (originally 20100105132138) +class ShipmentIdForInventoryUnits < ActiveRecord::Migration + def up + add_column :inventory_units, :shipment_id, :integer + add_index :inventory_units, :shipment_id + + # migrate legacy shipments + Spree::Shipment.table_name = 'shipments' + + Spree::Shipment.all.each do |shipment| + unless shipment.order + puts "Warning: shipment has invalid order - #{shipment.id}" + next + end + shipment.order.inventory_units.each do |unit| + unit.update_attribute('shipment_id', shipment.id) + end + end + + Spree::Shipment.table_name = 'spree_shipments' + end + + def down + remove_column :inventory_units, :shipment_id + end +end diff --git a/spec/dummy/db/migrate/20120502190270_cim_fields_for_creditcards.spree.rb b/spec/dummy/db/migrate/20120502190270_cim_fields_for_creditcards.spree.rb new file mode 100644 index 00000000..90290e4b --- /dev/null +++ b/spec/dummy/db/migrate/20120502190270_cim_fields_for_creditcards.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100111205525) +class CimFieldsForCreditcards < ActiveRecord::Migration + def change + add_column :creditcards, :gateway_customer_profile_id, :string + add_column :creditcards, :gateway_payment_profile_id, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190271_create_return_authorizations.spree.rb b/spec/dummy/db/migrate/20120502190271_create_return_authorizations.spree.rb new file mode 100644 index 00000000..7637447a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190271_create_return_authorizations.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20100112151511) +class CreateReturnAuthorizations < ActiveRecord::Migration + def change + create_table :return_authorizations do |t| + t.string :number, :state + t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false + t.references :order + t.text :reason + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190272_add_return_authorization_to_inventory_units.spree.rb b/spec/dummy/db/migrate/20120502190272_add_return_authorization_to_inventory_units.spree.rb new file mode 100644 index 00000000..1cb98aed --- /dev/null +++ b/spec/dummy/db/migrate/20120502190272_add_return_authorization_to_inventory_units.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100113090919) +class AddReturnAuthorizationToInventoryUnits < ActiveRecord::Migration + def change + add_column :inventory_units, :return_authorization_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190273_create_trackers.spree.rb b/spec/dummy/db/migrate/20120502190273_create_trackers.spree.rb new file mode 100644 index 00000000..ef3e28ac --- /dev/null +++ b/spec/dummy/db/migrate/20120502190273_create_trackers.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20100113203104) +class CreateTrackers < ActiveRecord::Migration + def change + create_table :trackers do |t| + t.string :environment, :analytics_id + t.boolean :active, :default => true + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190274_creditcard_id_for_creditcard_txns.spree.rb b/spec/dummy/db/migrate/20120502190274_creditcard_id_for_creditcard_txns.spree.rb new file mode 100644 index 00000000..b26b4589 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190274_creditcard_id_for_creditcard_txns.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100121160010) +class CreditcardIdForCreditcardTxns < ActiveRecord::Migration + def change + add_column :creditcard_txns, :creditcard_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190275_original_creditcard_txn_id_for_creditcard_txns.spree.rb b/spec/dummy/db/migrate/20120502190275_original_creditcard_txn_id_for_creditcard_txns.spree.rb new file mode 100644 index 00000000..b9145baa --- /dev/null +++ b/spec/dummy/db/migrate/20120502190275_original_creditcard_txn_id_for_creditcard_txns.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100121183934) +class OriginalCreditcardTxnIdForCreditcardTxns < ActiveRecord::Migration + def change + add_column :creditcard_txns, :original_creditcard_txn_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190276_add_test_mode_to_billing_integration.spree.rb b/spec/dummy/db/migrate/20120502190276_add_test_mode_to_billing_integration.spree.rb new file mode 100644 index 00000000..2e61e8ea --- /dev/null +++ b/spec/dummy/db/migrate/20120502190276_add_test_mode_to_billing_integration.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100125145351) +class AddTestModeToBillingIntegration < ActiveRecord::Migration + def change + add_column :billing_integrations, :test_mode, :boolean, :default => true + add_column :billing_integrations, :server, :string, :default => 'test' + end +end diff --git a/spec/dummy/db/migrate/20120502190277_create_payment_methods.spree.rb b/spec/dummy/db/migrate/20120502190277_create_payment_methods.spree.rb new file mode 100644 index 00000000..d3f7a897 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190277_create_payment_methods.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20100209025806) +class CreatePaymentMethods < ActiveRecord::Migration + def change + create_table :payment_methods do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + # TODO - also migrate any legacy configurations for gateways and billing integrations before dropping the old tables + # we probably also need to do this inside the payment_gateway extension b/c table won't exist yet in fresh bootstrap + #drop_table :billing_integrations + #drop_table :gateways + end +end diff --git a/spec/dummy/db/migrate/20120502190278_polymorphic_payments.spree.rb b/spec/dummy/db/migrate/20120502190278_polymorphic_payments.spree.rb new file mode 100644 index 00000000..4e32c153 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190278_polymorphic_payments.spree.rb @@ -0,0 +1,43 @@ +# This migration comes from spree (originally 20100209144531) +# Legacy table support +class Checkout < ActiveRecord::Base; end; + +class PolymorphicPayments < ActiveRecord::Migration + def up + remove_column :payments, :type + remove_column :payments, :creditcard_id + rename_column :payments, :order_id, :payable_id + change_table :payments do |t| + t.string :payable_type, :payment_method + t.references :source, :polymorphic => true + end + execute "UPDATE payments SET payable_type = 'Order'" + + Spree::Creditcard.table_name = 'creditcards' + + Spree::Creditcard.all.each do |creditcard| + if checkout = Checkout.find_by_id(creditcard.checkout_id) and checkout.order + if payment = checkout.order.payments.first + execute "UPDATE payments SET source_type = 'Creditcard', source_id = #{creditcard.id} WHERE id = #{payment.id}" + end + end + end + + Spree::Creditcard.table_name = 'spree_creditcards' + + remove_column :creditcards, :checkout_id + end + + def down + add_column :creditcards, :checkout_id, :integer + change_table :payments do |t| + t.remove :payable_type + t.remove :payment_method + t.remove :source_id + t.remove :source_type + end + rename_column :payments, :payable_id, :order_id + add_column :payments, :creditcard_id, :integer + add_column :payments, :type, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190279_change_payments_payment_method_to_belongs_to.spree.rb b/spec/dummy/db/migrate/20120502190279_change_payments_payment_method_to_belongs_to.spree.rb new file mode 100644 index 00000000..12f335da --- /dev/null +++ b/spec/dummy/db/migrate/20120502190279_change_payments_payment_method_to_belongs_to.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20100213103131) +class ChangePaymentsPaymentMethodToBelongsTo < ActiveRecord::Migration + def up + remove_column :payments, :payment_method + add_column :payments, :payment_method_id, :integer + end + + def down + add_column :payments, :payment_method, :string + remove_column :payments, :payment_method_id + end +end diff --git a/spec/dummy/db/migrate/20120502190280_assign_creditcard_txns_to_payment.spree.rb b/spec/dummy/db/migrate/20120502190280_assign_creditcard_txns_to_payment.spree.rb new file mode 100644 index 00000000..d6077fee --- /dev/null +++ b/spec/dummy/db/migrate/20120502190280_assign_creditcard_txns_to_payment.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20100214212536) +class AssignCreditcardTxnsToPayment < ActiveRecord::Migration + def up + add_column :creditcard_txns, :payment_id, :integer + + # Temporarily set back to creditcards + Spree::Creditcard.table_name = 'creditcards' + + ActiveRecord::Base.connection.select_all('SELECT * FROM creditcard_txns').each do |txn_attrs| + if creditcard = Spree::Creditcard.find_by_id(txn_attrs['creditcard_id']) and creditcard.payments.first + execute "UPDATE creditcard_txns SET payment_id = #{creditcard.payments.first.id} WHERE id = #{txn_attrs['id']}" + end + end + + Spree::Creditcard.table_name = 'spree_creditcards' + + remove_column :creditcard_txns, :creditcard_payment_id + end + + def down + remove_column :creditcard_txns, :payment_id + add_column :creditcard_txns, :creditcard_payment_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190281_sti_for_transactions.spree.rb b/spec/dummy/db/migrate/20120502190281_sti_for_transactions.spree.rb new file mode 100644 index 00000000..88e3f3eb --- /dev/null +++ b/spec/dummy/db/migrate/20120502190281_sti_for_transactions.spree.rb @@ -0,0 +1,16 @@ +# This migration comes from spree (originally 20100223170312) +class StiForTransactions < ActiveRecord::Migration + def up + rename_table :creditcard_txns, :transactions + add_column :transactions, :type, :string + remove_column :transactions, :creditcard_id + + execute "UPDATE transactions SET type = 'CreditcardTxn'" + end + + def down + rename_table :transactions, :creditcard_txns + remove_column :transactions, :type + add_column :transactions, :creditcard_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190282_drop_billing_integrations.spree.rb b/spec/dummy/db/migrate/20120502190282_drop_billing_integrations.spree.rb new file mode 100644 index 00000000..b239448a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190282_drop_billing_integrations.spree.rb @@ -0,0 +1,17 @@ +# This migration comes from spree (originally 20100223183812) +class DropBillingIntegrations < ActiveRecord::Migration + def up + drop_table :billing_integrations + end + + def down + create_table :billing_integrations do |t| + t.string :type, :name + t.text :description + t.boolean :active, :default => true + t.string :environment, :default => 'development' + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190283_deleted_at_for_payment_methods.spree.rb b/spec/dummy/db/migrate/20120502190283_deleted_at_for_payment_methods.spree.rb new file mode 100644 index 00000000..176f7745 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190283_deleted_at_for_payment_methods.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20100224153127) +class DeletedAtForPaymentMethods < ActiveRecord::Migration + def up + change_table :payment_methods do |t| + t.timestamp :deleted_at, :default => nil + end + end + + def down + remove_column :payments_methods, :column_name + change_table :payment_methods do |t| + t.remove :deleted_at + end + end +end \ No newline at end of file diff --git a/spec/dummy/db/migrate/20120502190284_add_adjustments_index.spree.rb b/spec/dummy/db/migrate/20120502190284_add_adjustments_index.spree.rb new file mode 100644 index 00000000..35ca5f0a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190284_add_adjustments_index.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100301163454) +class AddAdjustmentsIndex < ActiveRecord::Migration + def change + add_index :adjustments, :order_id + end +end + diff --git a/spec/dummy/db/migrate/20120502190285_add_alt_text_to_images.spree.rb b/spec/dummy/db/migrate/20120502190285_add_alt_text_to_images.spree.rb new file mode 100644 index 00000000..c3bb77a6 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190285_add_alt_text_to_images.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100317120946) +class AddAltTextToImages < ActiveRecord::Migration + def change + add_column :assets, :alt, :text + end +end diff --git a/spec/dummy/db/migrate/20120502190286_fix_existing_coupon_credits.spree.rb b/spec/dummy/db/migrate/20120502190286_fix_existing_coupon_credits.spree.rb new file mode 100644 index 00000000..41f2fa2a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190286_fix_existing_coupon_credits.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20100419194457) +class Adjustment < ActiveRecord::Base; end; + +class FixExistingCouponCredits < ActiveRecord::Migration + def up + execute("UPDATE adjustments SET type='PromotionCredit' WHERE type='CouponCredit'") + execute("UPDATE adjustments SET adjustment_source_type='Promotion' WHERE adjustment_source_type='Coupon'") + end + + def down + execute("UPDATE adjustments SET adjustment_source_type='Coupon' WHERE adjustment_source_type='Promotion'") + execute("UPDATE adjustments SET type='CouponCredit' WHERE type='PromotionCredit'") + end +end diff --git a/spec/dummy/db/migrate/20120502190287_add_display_to_payment_methods.spree.rb b/spec/dummy/db/migrate/20120502190287_add_display_to_payment_methods.spree.rb new file mode 100644 index 00000000..0f8db89e --- /dev/null +++ b/spec/dummy/db/migrate/20120502190287_add_display_to_payment_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100427121301) +class AddDisplayToPaymentMethods < ActiveRecord::Migration + def change + add_column :payment_methods, :display, :string, :default => nil + end +end diff --git a/spec/dummy/db/migrate/20120502190288_add_addresses_checkouts_indexes.spree.rb b/spec/dummy/db/migrate/20120502190288_add_addresses_checkouts_indexes.spree.rb new file mode 100644 index 00000000..86ce6547 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190288_add_addresses_checkouts_indexes.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20100504142133) +class AddAddressesCheckoutsIndexes < ActiveRecord::Migration + def change + add_index :addresses, :firstname + add_index :addresses, :lastname + add_index :checkouts, :order_id + add_index :checkouts, :bill_address_id + end +end diff --git a/spec/dummy/db/migrate/20120502190289_add_icon_to_taxons.spree.rb b/spec/dummy/db/migrate/20120502190289_add_icon_to_taxons.spree.rb new file mode 100644 index 00000000..a4bede3a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190289_add_icon_to_taxons.spree.rb @@ -0,0 +1,18 @@ +# This migration comes from spree (originally 20100506180619) +class AddIconToTaxons < ActiveRecord::Migration + def up + # skip this migration if the attribute already exists because of advanced taxon extension + return if column_exists?(:taxons, :icon_file_name) + add_column :taxons, :icon_file_name, :string + add_column :taxons, :icon_content_type, :string + add_column :taxons, :icon_file_size, :integer + add_column :taxons, :icon_updated_at, :datetime + end + + def down + remove_column :taxons, :icon_file_name + remove_column :taxons, :icon_content_type + remove_column :taxons, :icon_file_size + remove_column :taxons, :icon_updated_at + end +end diff --git a/spec/dummy/db/migrate/20120502190290_add_description_to_taxons.spree.rb b/spec/dummy/db/migrate/20120502190290_add_description_to_taxons.spree.rb new file mode 100644 index 00000000..41c58657 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190290_add_description_to_taxons.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20100506185838) +class AddDescriptionToTaxons < ActiveRecord::Migration + def up + # skip this migration if the attribute already exists because of advanced taxon extension + return if column_exists?(:taxons, :description) + add_column :taxons, :description, :text + end + + def down + remove_column :taxons, :description + end +end diff --git a/spec/dummy/db/migrate/20120502190291_index_for_shipments_number.spree.rb b/spec/dummy/db/migrate/20120502190291_index_for_shipments_number.spree.rb new file mode 100644 index 00000000..ac80bf1a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190291_index_for_shipments_number.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100528155333) +class IndexForShipmentsNumber < ActiveRecord::Migration + def change + add_index :shipments, :number + end +end diff --git a/spec/dummy/db/migrate/20120502190292_add_index_on_users_persistence_token.spree.rb b/spec/dummy/db/migrate/20120502190292_add_index_on_users_persistence_token.spree.rb new file mode 100644 index 00000000..40126360 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190292_add_index_on_users_persistence_token.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100528185820) +class AddIndexOnUsersPersistenceToken < ActiveRecord::Migration + def change + add_index :users, :persistence_token + end +end diff --git a/spec/dummy/db/migrate/20120502190293_add_default_to_tax_categories.spree.rb b/spec/dummy/db/migrate/20120502190293_add_default_to_tax_categories.spree.rb new file mode 100644 index 00000000..a7d8c108 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190293_add_default_to_tax_categories.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100605152042) +class AddDefaultToTaxCategories < ActiveRecord::Migration + def change + add_column :tax_categories, :is_default, :boolean, :default => false + end +end diff --git a/spec/dummy/db/migrate/20120502190294_add_display_to_shipping_methods.spree.rb b/spec/dummy/db/migrate/20120502190294_add_display_to_shipping_methods.spree.rb new file mode 100644 index 00000000..581d42ee --- /dev/null +++ b/spec/dummy/db/migrate/20120502190294_add_display_to_shipping_methods.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624110730) +class AddDisplayToShippingMethods < ActiveRecord::Migration + def change + add_column :shipping_methods, :display_on, :string, :default => nil + end +end diff --git a/spec/dummy/db/migrate/20120502190295_rename_payment_method_display.spree.rb b/spec/dummy/db/migrate/20120502190295_rename_payment_method_display.spree.rb new file mode 100644 index 00000000..3cb38abd --- /dev/null +++ b/spec/dummy/db/migrate/20120502190295_rename_payment_method_display.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624123336) +class RenamePaymentMethodDisplay < ActiveRecord::Migration + def change + rename_column :payment_methods, :display, :display_on + end +end diff --git a/spec/dummy/db/migrate/20120502190296_rename_preferences_field.spree.rb b/spec/dummy/db/migrate/20120502190296_rename_preferences_field.spree.rb new file mode 100644 index 00000000..3cd68a94 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190296_rename_preferences_field.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100624175547) +class RenamePreferencesField < ActiveRecord::Migration + def change + rename_column :preferences, :attribute, :name + end +end diff --git a/spec/dummy/db/migrate/20120502190297_add_guest_flag.spree.rb b/spec/dummy/db/migrate/20120502190297_add_guest_flag.spree.rb new file mode 100644 index 00000000..81d5b2cb --- /dev/null +++ b/spec/dummy/db/migrate/20120502190297_add_guest_flag.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100811163637) +class AddGuestFlag < ActiveRecord::Migration + def change + add_column :users, :guest, :boolean + end +end diff --git a/spec/dummy/db/migrate/20120502190298_drop_order_token.spree.rb b/spec/dummy/db/migrate/20120502190298_drop_order_token.spree.rb new file mode 100644 index 00000000..986d84bd --- /dev/null +++ b/spec/dummy/db/migrate/20120502190298_drop_order_token.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20100811205836) +class DropOrderToken < ActiveRecord::Migration + def up + remove_column :orders, :token + end + + def down + add_column :orders, :token, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190299_payments_state_and_assigned_to_order_only.spree.rb b/spec/dummy/db/migrate/20120502190299_payments_state_and_assigned_to_order_only.spree.rb new file mode 100644 index 00000000..e2256e21 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190299_payments_state_and_assigned_to_order_only.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20100812162326) +class PaymentsStateAndAssignedToOrderOnly < ActiveRecord::Migration + def up + # TODO: migrate existing payments + rename_column :payments, :payable_id, :order_id + remove_column :payments, :payable_type + add_column :payments, :state, :string + end + + def down + remove_column :payments, :state + add_column :payments, :payable_type, :string + rename_column :payments, :order_id, :payable_id + end +end diff --git a/spec/dummy/db/migrate/20120502190300_create_address_keys_for_order.spree.rb b/spec/dummy/db/migrate/20120502190300_create_address_keys_for_order.spree.rb new file mode 100644 index 00000000..204ce6e8 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190300_create_address_keys_for_order.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100813023502) +class CreateAddressKeysForOrder < ActiveRecord::Migration + def change + add_column :orders, :bill_address_id, :integer + add_column :orders, :ship_address_id, :integer + end +end \ No newline at end of file diff --git a/spec/dummy/db/migrate/20120502190301_payment_total_for_orders.spree.rb b/spec/dummy/db/migrate/20120502190301_payment_total_for_orders.spree.rb new file mode 100644 index 00000000..6cf32a8a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190301_payment_total_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100813185745) +class PaymentTotalForOrders < ActiveRecord::Migration + def change + add_column :orders, :payment_total, :decimal, :precision => 8, :scale => 2, :default => 0.0 + end +end diff --git a/spec/dummy/db/migrate/20120502190302_shipping_method_id_for_orders.spree.rb b/spec/dummy/db/migrate/20120502190302_shipping_method_id_for_orders.spree.rb new file mode 100644 index 00000000..c7ff0b4c --- /dev/null +++ b/spec/dummy/db/migrate/20120502190302_shipping_method_id_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100816212146) +class ShippingMethodIdForOrders < ActiveRecord::Migration + def change + add_column :orders, :shipping_method_id, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190303_add_shipment_and_payment_state.spree.rb b/spec/dummy/db/migrate/20120502190303_add_shipment_and_payment_state.spree.rb new file mode 100644 index 00000000..51fb0844 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190303_add_shipment_and_payment_state.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100817152723) +class AddShipmentAndPaymentState < ActiveRecord::Migration + def change + add_column :orders, :shipment_state, :string + add_column :orders, :payment_state, :string + end +end \ No newline at end of file diff --git a/spec/dummy/db/migrate/20120502190304_refactor_adjustments.spree.rb b/spec/dummy/db/migrate/20120502190304_refactor_adjustments.spree.rb new file mode 100644 index 00000000..ec28a163 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190304_refactor_adjustments.spree.rb @@ -0,0 +1,30 @@ +# This migration comes from spree (originally 20100819170125) +class RefactorAdjustments < ActiveRecord::Migration + def up + change_table :adjustments do |t| + t.boolean :mandatory + t.boolean :frozen + t.rename :adjustment_source_id, :source_id + t.rename :adjustment_source_type, :source_type + t.references :originator + t.string :originator_type + t.remove :type + t.rename :description, :label + t.remove :position + end + end + + def down + change_table :adjustments do |t| + t.integer :position + t.rename :label, :description + t.string :type + t.remove :originator_type + t.remove :originator_id + t.rename :source_type, :adjustment_source_type + t.rename :source_id, :adjustment_source_id + t.remove :frozen + t.remove :mandatory + end + end +end diff --git a/spec/dummy/db/migrate/20120502190305_response_code_and_avs_response_for_payments.spree.rb b/spec/dummy/db/migrate/20120502190305_response_code_and_avs_response_for_payments.spree.rb new file mode 100644 index 00000000..8679c1b0 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190305_response_code_and_avs_response_for_payments.spree.rb @@ -0,0 +1,7 @@ +# This migration comes from spree (originally 20100820135707) +class ResponseCodeAndAvsResponseForPayments < ActiveRecord::Migration + def change + add_column :payments, :response_code, :string + add_column :payments, :avs_response, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190306_change_guest_flag_to_anonymous.spree.rb b/spec/dummy/db/migrate/20120502190306_change_guest_flag_to_anonymous.spree.rb new file mode 100644 index 00000000..d8e866f7 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190306_change_guest_flag_to_anonymous.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100901171814) +class ChangeGuestFlagToAnonymous < ActiveRecord::Migration + def change + rename_column :users, :guest, :anonymous + end +end diff --git a/spec/dummy/db/migrate/20120502190307_email_for_orders.spree.rb b/spec/dummy/db/migrate/20120502190307_email_for_orders.spree.rb new file mode 100644 index 00000000..9e17763c --- /dev/null +++ b/spec/dummy/db/migrate/20120502190307_email_for_orders.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100903203949) +class EmailForOrders < ActiveRecord::Migration + def change + add_column :orders, :email, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190308_create_mail_methods.spree.rb b/spec/dummy/db/migrate/20120502190308_create_mail_methods.spree.rb new file mode 100644 index 00000000..5efa48b3 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190308_create_mail_methods.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20100923162011) +class CreateMailMethods < ActiveRecord::Migration + def change + create_table :mail_methods do |t| + t.string :environment + t.boolean :active, :default => true + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190309_rename_frozen_to_locked.spree.rb b/spec/dummy/db/migrate/20120502190309_rename_frozen_to_locked.spree.rb new file mode 100644 index 00000000..aee207d0 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190309_rename_frozen_to_locked.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20100929151905) +class RenameFrozenToLocked < ActiveRecord::Migration + def change + rename_column :adjustments, :frozen, :locked + end +end diff --git a/spec/dummy/db/migrate/20120502190310_move_special_instructions_to_orders.spree.rb b/spec/dummy/db/migrate/20120502190310_move_special_instructions_to_orders.spree.rb new file mode 100644 index 00000000..dbc4e25e --- /dev/null +++ b/spec/dummy/db/migrate/20120502190310_move_special_instructions_to_orders.spree.rb @@ -0,0 +1,11 @@ +# This migration comes from spree (originally 20101008190536) +class MoveSpecialInstructionsToOrders < ActiveRecord::Migration + def up + add_column :orders, :special_instructions, :text + execute "UPDATE orders SET special_instructions = (SELECT special_instructions FROM checkouts WHERE order_id = orders.id)" + end + + def down + remove_column :orders, :special_instructions, :text + end +end diff --git a/spec/dummy/db/migrate/20120502190311_create_log_entries.spree.rb b/spec/dummy/db/migrate/20120502190311_create_log_entries.spree.rb new file mode 100644 index 00000000..2daf37e4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190311_create_log_entries.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101026184700) +class CreateLogEntries < ActiveRecord::Migration + def change + create_table :log_entries do |t| + t.integer :source_id + t.string :source_type + t.text :details + + t.timestamps + end + end +end diff --git a/spec/dummy/db/migrate/20120502190312_migrate_transactions_to_payment_state.spree.rb b/spec/dummy/db/migrate/20120502190312_migrate_transactions_to_payment_state.spree.rb new file mode 100644 index 00000000..e208262e --- /dev/null +++ b/spec/dummy/db/migrate/20120502190312_migrate_transactions_to_payment_state.spree.rb @@ -0,0 +1,99 @@ +# This migration comes from spree (originally 20101026184714) +class Transaction < ActiveRecord::Base; end +class CreditcardTxn < Transaction; end + +class MigrateTransactionsToPaymentState < ActiveRecord::Migration + + AUTHORIZED=1 + COMPLETED=2 + PURCHASED=3 + VOIDED = 4 + CREDITED =5 + + PAYMENT_COMPLETE = 'completed' + PAYMENT_VOID = 'void' + PAYMENT_PENDING = 'pending' + + # Temporarily set the table back to payments + Spree::Payment.table_name = 'payments' + + def up + migrate_authorized_only_transactions + migrate_voided_transactions + migrate_completed_transactions + migrate_purchased_transactions + migrate_credited_transactions + + Spree::Payment.table_name = 'spree_payments' + end + + def migrate_credited_transactions + credited = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{CREDITED}") + credited.each do |tx| + payment = Spree::Payment.find(tx) + order = payment.order + order.create_payment( + :amount => tx.amount, + :source_id => payment.source_id, :source_type => 'Creditcard', + :payment_method_id => payment.payment_method_id, :state => PAYMENT_COMPLETE, + :avs_response => tx.avs_response, :response_code => tx.response_code + ) + end + credited.each(&:destroy) + end + + def migrate_voided_transactions + voided = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{VOIDED}") + voided.each do |tx| + update_payment(tx, PAYMENT_VOID) + end + unless voided.empty? + all_but_credited = [AUTHORIZED, COMPLETED, PURCHASED, VOIDED] + voided_and_subsequent_transactions = Transaction.find_by_sql("SELECT * FROM transactions WHERE payment_id IN (#{voided.map(&:payment_id).join(',')}) AND txn_type IN (#{all_but_credited.join(',')})") + voided_and_subsequent_transactions.each(&:destroy) + end + end + + def migrate_purchased_transactions + migrate_transactions(PURCHASED) + end + + def migrate_completed_transactions + migrate_transactions(COMPLETED) + end + + def migrate_transactions(type) + txs = Transaction.find_by_sql("SELECT * FROM transactions WHERE txn_type = #{type}") + txs.each do |tx| + update_payment(tx, PAYMENT_COMPLETE) + end + txs.each(&:destroy) + end + + def migrate_authorized_only_transactions + if (ActiveRecord::Base.connection.adapter_name == 'PostgreSQL') + group_by_clause = 'GROUP BY transactions.' + Transaction.column_names.join(', transactions.') + else + group_by_clause = 'GROUP BY payment_id' + end + authorized_only = Transaction.find_by_sql("SELECT * FROM transactions #{group_by_clause} HAVING COUNT(payment_id) = 1 AND txn_type = #{AUTHORIZED}") + authorized_only.each do |tx| + update_payment(tx, PAYMENT_PENDING) + end + authorized_only.each(&:destroy) + end + + def update_payment(tx, state) + payment = Spree::Payment.find(tx.payment_id) + payment.update_attributes_without_callbacks({ + :state => state, + :source_type => 'Creditcard', + :amount => tx.amount, + :response_code => tx.response_code, + :avs_response => tx.avs_response + }) + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190313_delete_in_progress_orders.spree.rb b/spec/dummy/db/migrate/20120502190313_delete_in_progress_orders.spree.rb new file mode 100644 index 00000000..08c09e38 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190313_delete_in_progress_orders.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20101026184746) +class DeleteInProgressOrders < ActiveRecord::Migration + def up + execute("DELETE FROM orders WHERE orders.state = 'in_progress'") + delete_orphans('adjustments') + delete_orphans('checkouts') + delete_orphans('shipments') + delete_orphans('payments') + delete_orphans('line_items') + delete_orphans('inventory_units') + end + + def down + end + + private + def delete_orphans(table_name) + execute "DELETE FROM #{table_name} WHERE order_id NOT IN (SELECT id FROM orders)" + end +end diff --git a/spec/dummy/db/migrate/20120502190314_migrate_checkout_to_orders.spree.rb b/spec/dummy/db/migrate/20120502190314_migrate_checkout_to_orders.spree.rb new file mode 100644 index 00000000..6ae948d3 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190314_migrate_checkout_to_orders.spree.rb @@ -0,0 +1,24 @@ +# This migration comes from spree (originally 20101026184808) +class MigrateCheckoutToOrders < ActiveRecord::Migration + def up + orders = select_all "SELECT * FROM orders" + + orders.each do |order| + checkout = update_order(order) + execute "DELETE FROM checkouts WHERE id = #{checkout['id']}" if checkout + end + end + + def down + end + + private + def update_order(order) + checkout = select_one "SELECT * FROM checkouts WHERE order_id = #{order['id']}" + + if checkout + execute "UPDATE orders SET email='#{checkout['email']}', bill_address_id = #{checkout['bill_address_id']}, ship_address_id = #{checkout['ship_address_id']} WHERE id = #{checkout['id']}" + end + checkout + end +end diff --git a/spec/dummy/db/migrate/20120502190315_remove_shipped_state.spree.rb b/spec/dummy/db/migrate/20120502190315_remove_shipped_state.spree.rb new file mode 100644 index 00000000..041b5fe4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190315_remove_shipped_state.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20101026184855) +class RemoveShippedState < ActiveRecord::Migration + def up + execute "UPDATE orders SET state = 'complete' WHERE state = 'shipped'" + shipments = select_all "SELECT shipments.id FROM shipments WHERE order_id IN (SELECT orders.id FROM orders WHERE orders.state = 'shipped')" + shipments.each do |shipment| + execute "UPDATE shipments SET state='shipped' WHERE id = #{shipment[:id]}" + end + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190316_prevent_nil_payment_total.spree.rb b/spec/dummy/db/migrate/20120502190316_prevent_nil_payment_total.spree.rb new file mode 100644 index 00000000..ba47f39c --- /dev/null +++ b/spec/dummy/db/migrate/20120502190316_prevent_nil_payment_total.spree.rb @@ -0,0 +1,9 @@ +# This migration comes from spree (originally 20101026184916) +class PreventNilPaymentTotal < ActiveRecord::Migration + def up + execute "UPDATE orders SET payment_total = 0.0 WHERE payment_total IS NULL" + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190317_prevent_nil_email.spree.rb b/spec/dummy/db/migrate/20120502190317_prevent_nil_email.spree.rb new file mode 100644 index 00000000..5178279e --- /dev/null +++ b/spec/dummy/db/migrate/20120502190317_prevent_nil_email.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20101026184932) +class PreventNilEmail < ActiveRecord::Migration + def up + execute "UPDATE orders SET email = 'guest@example.com' WHERE email IS NULL" + execute "UPDATE orders SET email = 'guest@example.com' WHERE email = ''" + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190318_generate_anonymous_users.spree.rb b/spec/dummy/db/migrate/20120502190318_generate_anonymous_users.spree.rb new file mode 100644 index 00000000..b4516514 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190318_generate_anonymous_users.spree.rb @@ -0,0 +1,21 @@ +# This migration comes from spree (originally 20101026184959) +class GenerateAnonymousUsers < ActiveRecord::Migration + def up + Spree::User.table_name = 'users' + Spree::Order.table_name = 'orders' + + Spree::User.reset_column_information + Spree::Order.where(:user_id => nil).each do |order| + user = Spree::User.anonymous! + user.email ||= order.email + order.user = user + order.save! + end + + Spree::User.table_name = 'spree_users' + Spree::Order.table_name = 'spree_orders' + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190319_update_order_state.spree.rb b/spec/dummy/db/migrate/20120502190319_update_order_state.spree.rb new file mode 100644 index 00000000..f7975444 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190319_update_order_state.spree.rb @@ -0,0 +1,13 @@ +# This migration comes from spree (originally 20101026185022) +class UpdateOrderState < ActiveRecord::Migration + def up + Spree::Order.table_name = 'orders' + + Spree::Order.all.map(&:update!) + + Spree::Order.table_name = 'spree_orders' + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190320_cleanup_legacy_tables.spree.rb b/spec/dummy/db/migrate/20120502190320_cleanup_legacy_tables.spree.rb new file mode 100644 index 00000000..a2dba137 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190320_cleanup_legacy_tables.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101026192225) +class CleanupLegacyTables < ActiveRecord::Migration + def up + drop_table :checkouts + drop_table :transactions + drop_table :open_id_authentication_associations + drop_table :open_id_authentication_nonces + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190321_remove_number_and_cvv_from_credicard.spree.rb b/spec/dummy/db/migrate/20120502190321_remove_number_and_cvv_from_credicard.spree.rb new file mode 100644 index 00000000..75fc6f3c --- /dev/null +++ b/spec/dummy/db/migrate/20120502190321_remove_number_and_cvv_from_credicard.spree.rb @@ -0,0 +1,12 @@ +# This migration comes from spree (originally 20101028151745) +class RemoveNumberAndCvvFromCredicard < ActiveRecord::Migration + def up + remove_column :creditcards, :number + remove_column :creditcards, :verification_value + end + + def down + add_column :creditcards, :verification_value, :text + add_column :creditcards, :number, :text + end +end diff --git a/spec/dummy/db/migrate/20120502190322_drop_anonymous_field_for_user.spree.rb b/spec/dummy/db/migrate/20120502190322_drop_anonymous_field_for_user.spree.rb new file mode 100644 index 00000000..d73a0a47 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190322_drop_anonymous_field_for_user.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20101103212716) +class DropAnonymousFieldForUser < ActiveRecord::Migration + def up + remove_column :users, :anonymous + end + + def down + add_column :users, :anonymous, :boolean + end +end diff --git a/spec/dummy/db/migrate/20120502190323_renamed_rma_cancelled_state.spree.rb b/spec/dummy/db/migrate/20120502190323_renamed_rma_cancelled_state.spree.rb new file mode 100644 index 00000000..5e979995 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190323_renamed_rma_cancelled_state.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20101111133551) +class RenamedRmaCancelledState < ActiveRecord::Migration + def up + execute "UPDATE return_authorizations SET state = 'canceled' WHERE state = 'cancelled'" + end + + def down + execute "UPDATE return_authorizations SET state = 'cancelled' WHERE state = 'canceled'" + end +end diff --git a/spec/dummy/db/migrate/20120502190324_fix_problematic_index_names.spree.rb b/spec/dummy/db/migrate/20120502190324_fix_problematic_index_names.spree.rb new file mode 100644 index 00000000..f6458086 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190324_fix_problematic_index_names.spree.rb @@ -0,0 +1,14 @@ +# This migration comes from spree (originally 20101117031806) +class FixProblematicIndexNames < ActiveRecord::Migration + def up + begin + remove_index :preferences, :name => 'index_preferences_on_owner_and_attribute_and_preference' + rescue ArgumentError + # ignore - already remove then + end + add_index :preferences, [:owner_id, :owner_type, :name, :group_id, :group_type], :name => 'ix_prefs_on_owner_attr_pref', :unique => true + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190325_add_position_to_variants.spree.rb b/spec/dummy/db/migrate/20120502190325_add_position_to_variants.spree.rb new file mode 100644 index 00000000..58b18d6b --- /dev/null +++ b/spec/dummy/db/migrate/20120502190325_add_position_to_variants.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20101223215658) +class AddPositionToVariants < ActiveRecord::Migration + def change + add_column :variants, :position, :integer + end +end diff --git a/spec/dummy/db/migrate/20120502190326_add_next_state_to_state_events.spree.rb b/spec/dummy/db/migrate/20120502190326_add_next_state_to_state_events.spree.rb new file mode 100644 index 00000000..eb0bad61 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190326_add_next_state_to_state_events.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110110130847) +class AddNextStateToStateEvents < ActiveRecord::Migration + def change + add_column :state_events, :next_state, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190327_add_position_to_option_types.spree.rb b/spec/dummy/db/migrate/20120502190327_add_position_to_option_types.spree.rb new file mode 100644 index 00000000..eebb58d3 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190327_add_position_to_option_types.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110111122537) +class AddPositionToOptionTypes < ActiveRecord::Migration + def change + add_column :option_types, :position, :integer, :null => false, :default => 0 + end +end diff --git a/spec/dummy/db/migrate/20120502190328_remove_trailing_slashes_in_taxon_permalinks.spree.rb b/spec/dummy/db/migrate/20120502190328_remove_trailing_slashes_in_taxon_permalinks.spree.rb new file mode 100644 index 00000000..7196965a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190328_remove_trailing_slashes_in_taxon_permalinks.spree.rb @@ -0,0 +1,20 @@ +# This migration comes from spree (originally 20110314192118) +class RemoveTrailingSlashesInTaxonPermalinks < ActiveRecord::Migration + def up + taxons = select_all "SELECT * FROM taxons" + taxons.each do |taxon| + if taxon['permalink'] && taxon['permalink'][-1..-1] == '/' + execute "UPDATE taxons SET permalink = '#{taxon['permalink'][0...-1]}' WHERE id = #{taxon['id']}" + end + end + end + + def down + taxons = select_all "SELECT * FROM taxons" + taxons.each do |taxon| + if taxon['permalink'] && taxon['permalink'][-1..-1] != '/' + execute "UPDATE taxons SET permalink = '#{taxon['permalink'] + '/'}' WHERE id = #{taxon['id']}" + end + end + end +end diff --git a/spec/dummy/db/migrate/20120502190329_create_activators.spree.rb b/spec/dummy/db/migrate/20120502190329_create_activators.spree.rb new file mode 100644 index 00000000..a37f1ef5 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190329_create_activators.spree.rb @@ -0,0 +1,15 @@ +# This migration comes from spree (originally 20110329141434) +class CreateActivators < ActiveRecord::Migration + def change + create_table :activators, :force => true do |t| + t.string :description + t.datetime :expires_at + t.datetime :created_at + t.datetime :updated_at + t.datetime :starts_at + t.string :name + t.string :event_name + t.string :type + end + end +end diff --git a/spec/dummy/db/migrate/20120502190330_eligible_for_adjustments.spree.rb b/spec/dummy/db/migrate/20120502190330_eligible_for_adjustments.spree.rb new file mode 100644 index 00000000..f3b8a443 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190330_eligible_for_adjustments.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20110418151136) +class EligibleForAdjustments < ActiveRecord::Migration + def change + add_column :adjustments, :eligible, :boolean, :default => true + end +end diff --git a/spec/dummy/db/migrate/20120502190331_namespace_top_level_models.spree.rb b/spec/dummy/db/migrate/20120502190331_namespace_top_level_models.spree.rb new file mode 100644 index 00000000..9b82265a --- /dev/null +++ b/spec/dummy/db/migrate/20120502190331_namespace_top_level_models.spree.rb @@ -0,0 +1,50 @@ +# This migration comes from spree (originally 20111007143030) +class NamespaceTopLevelModels < ActiveRecord::Migration + def change + rename_table :activators, :spree_activators + rename_table :addresses, :spree_addresses + rename_table :adjustments, :spree_adjustments + rename_table :configurations, :spree_configurations + rename_table :assets, :spree_assets + rename_table :calculators, :spree_calculators + rename_table :countries, :spree_countries + rename_table :creditcards, :spree_creditcards + rename_table :gateways, :spree_gateways + rename_table :inventory_units, :spree_inventory_units + rename_table :line_items, :spree_line_items + rename_table :log_entries, :spree_log_entries + rename_table :mail_methods, :spree_mail_methods + rename_table :option_types, :spree_option_types + rename_table :option_values, :spree_option_values + rename_table :option_types_prototypes, :spree_option_types_prototypes + rename_table :option_values_variants, :spree_option_values_variants + rename_table :orders, :spree_orders + rename_table :payments, :spree_payments + rename_table :payment_methods, :spree_payment_methods + rename_table :preferences, :spree_preferences + rename_table :products, :spree_products + rename_table :product_option_types, :spree_product_option_types + rename_table :product_properties, :spree_product_properties + rename_table :products_taxons, :spree_products_taxons + rename_table :properties, :spree_properties + rename_table :prototypes, :spree_prototypes + rename_table :properties_prototypes, :spree_properties_prototypes + rename_table :return_authorizations, :spree_return_authorizations + rename_table :roles, :spree_roles + rename_table :roles_users, :spree_roles_users + rename_table :shipments, :spree_shipments + rename_table :shipping_categories, :spree_shipping_categories + rename_table :shipping_methods, :spree_shipping_methods + rename_table :states, :spree_states + rename_table :state_events, :spree_state_events + rename_table :tax_categories, :spree_tax_categories + rename_table :tax_rates, :spree_tax_rates + rename_table :taxons, :spree_taxons + rename_table :taxonomies, :spree_taxonomies + rename_table :trackers, :spree_trackers + rename_table :users, :spree_users + rename_table :variants, :spree_variants + rename_table :zones, :spree_zones + rename_table :zone_members, :spree_zone_members + end +end diff --git a/spec/dummy/db/migrate/20120502190332_migrate_namespaced_polymorphic_models.spree.rb b/spec/dummy/db/migrate/20120502190332_migrate_namespaced_polymorphic_models.spree.rb new file mode 100644 index 00000000..fc04334d --- /dev/null +++ b/spec/dummy/db/migrate/20120502190332_migrate_namespaced_polymorphic_models.spree.rb @@ -0,0 +1,53 @@ +# This migration comes from spree (originally 20111107143030) +class MigrateNamespacedPolymorphicModels < ActiveRecord::Migration + def concat(str1, str2) + dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym + + case dbtype + when :mysql, :mysql2 + "CONCAT(#{str1}, #{str2})" + when :sqlserver + "(#{str1} + #{str2})" + else + "(#{str1} || #{str2})" + end + end + + def update_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = #{concat("'Spree::'", column_name)}" + + " where #{column_name} NOT LIKE 'Spree::%' AND #{column_name} IS NOT NULL" + end + end + + def replace_column_data(table_names, column_name) + tables = Array.wrap(table_names) + tables.each do |table| + execute "UPDATE #{table} SET #{column_name} = REPLACE(#{column_name}, 'Spree::', '') " + + " where #{column_name} LIKE 'Spree::%'" + end + end + + def up + update_column_data(['spree_payments', 'spree_adjustments', 'spree_log_entries'], 'source_type') + update_column_data('spree_adjustments', 'originator_type') + update_column_data('spree_calculators', 'calculable_type') + update_column_data('spree_preferences', 'owner_type') + update_column_data('spree_state_events', 'stateful_type') + update_column_data(['spree_activators', 'spree_assets', 'spree_calculators', 'spree_configurations', 'spree_gateways', 'spree_payment_methods'], 'type') + update_column_data('spree_assets', 'viewable_type') + update_column_data('spree_zone_members', 'zoneable_type') + end + + def down + replace_column_data(['spree_payments', 'spree_adjustments', 'spree_log_entries'], 'source_type') + replace_column_data('spree_adjustments', 'originator_type') + replace_column_data('spree_calculators', 'calculable_type') + replace_column_data('spree_preferences', 'owner_type') + replace_column_data('spree_state_events', 'stateful_type') + replace_column_data(['spree_activators', 'spree_assets', 'spree_calculators', 'spree_configurations', 'spree_gateways', 'spree_payment_methods'], 'type') + replace_column_data('spree_assets', 'viewable_type') + replace_column_data('spree_zone_members', 'zoneable_type') + end +end diff --git a/spec/dummy/db/migrate/20120502190333_make_adjustments_polymorphic.spree.rb b/spec/dummy/db/migrate/20120502190333_make_adjustments_polymorphic.spree.rb new file mode 100644 index 00000000..e7ae0076 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190333_make_adjustments_polymorphic.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20111201024007) +class MakeAdjustmentsPolymorphic < ActiveRecord::Migration + + def change + add_column :spree_adjustments, :adjustable_type, :string + rename_column :spree_adjustments, :order_id, :adjustable_id + execute "UPDATE spree_adjustments SET adjustable_type = 'Spree::Order'" + end + +end diff --git a/spec/dummy/db/migrate/20120502190334_add_company_to_addresses.spree.rb b/spec/dummy/db/migrate/20120502190334_add_company_to_addresses.spree.rb new file mode 100644 index 00000000..db74d0ad --- /dev/null +++ b/spec/dummy/db/migrate/20120502190334_add_company_to_addresses.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111215032408) +class AddCompanyToAddresses < ActiveRecord::Migration + def change + add_column :spree_addresses, :company, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190335_add_inc_tax_to_tax_rates.spree.rb b/spec/dummy/db/migrate/20120502190335_add_inc_tax_to_tax_rates.spree.rb new file mode 100644 index 00000000..c22668e4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190335_add_inc_tax_to_tax_rates.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111216154844) +class AddIncTaxToTaxRates < ActiveRecord::Migration + def change + add_column :spree_tax_rates, :inc_tax, :boolean, :default => false + end +end diff --git a/spec/dummy/db/migrate/20120502190336_rename_inc_price_attribute.spree.rb b/spec/dummy/db/migrate/20120502190336_rename_inc_price_attribute.spree.rb new file mode 100644 index 00000000..10d04286 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190336_rename_inc_price_attribute.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111219203242) +class RenameIncPriceAttribute < ActiveRecord::Migration + def change + rename_column :spree_tax_rates, :inc_tax, :included_in_price + end +end diff --git a/spec/dummy/db/migrate/20120502190337_add_default_tax_zone.spree.rb b/spec/dummy/db/migrate/20120502190337_add_default_tax_zone.spree.rb new file mode 100644 index 00000000..d4d21690 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190337_add_default_tax_zone.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20111219205902) +class AddDefaultTaxZone < ActiveRecord::Migration + def change + add_column :spree_zones, :default_tax, :boolean, :default => false + end +end diff --git a/spec/dummy/db/migrate/20120502190338_associate_shipping_methods_and_shipping_categories.spree.rb b/spec/dummy/db/migrate/20120502190338_associate_shipping_methods_and_shipping_categories.spree.rb new file mode 100644 index 00000000..0f3d03ca --- /dev/null +++ b/spec/dummy/db/migrate/20120502190338_associate_shipping_methods_and_shipping_categories.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20120105193911) +class AssociateShippingMethodsAndShippingCategories < ActiveRecord::Migration + def change + change_table :spree_shipping_methods do |t| + t.references :shipping_category + end + end +end diff --git a/spec/dummy/db/migrate/20120502190339_add_match_rules_to_shipping_methods.spree.rb b/spec/dummy/db/migrate/20120502190339_add_match_rules_to_shipping_methods.spree.rb new file mode 100644 index 00000000..17e37906 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190339_add_match_rules_to_shipping_methods.spree.rb @@ -0,0 +1,8 @@ +# This migration comes from spree (originally 20120105195817) +class AddMatchRulesToShippingMethods < ActiveRecord::Migration + def change + add_column :spree_shipping_methods, :match_none, :boolean + add_column :spree_shipping_methods, :match_all, :boolean + add_column :spree_shipping_methods, :match_one, :boolean + end +end diff --git a/spec/dummy/db/migrate/20120502190340_new_preferences.spree.rb b/spec/dummy/db/migrate/20120502190340_new_preferences.spree.rb new file mode 100644 index 00000000..7d48500d --- /dev/null +++ b/spec/dummy/db/migrate/20120502190340_new_preferences.spree.rb @@ -0,0 +1,49 @@ +# This migration comes from spree (originally 20120119024710) +require 'spree/core/preference_rescue' + +class NewPreferences < ActiveRecord::Migration + + def up + add_column :spree_preferences, :key, :string + add_column :spree_preferences, :value_type, :string + add_index :spree_preferences, :key, :unique => true + + remove_index :spree_preferences, :name => 'ix_prefs_on_owner_attr_pref' + + # remove old constraints for migration + change_column :spree_preferences, :name, :string, :null => true + change_column :spree_preferences, :owner_id, :integer, :null => true + change_column :spree_preferences, :owner_type, :string, :null => true + change_column :spree_preferences, :group_id, :integer, :null => true + change_column :spree_preferences, :group_type, :string, :null => true + + cfgs = execute("select id, type from spree_configurations").to_a + execute("select id, owner_id, name from spree_preferences where owner_type = 'Spree::Configuration'").each do |pref| + configuration = cfgs.detect { |c| c[0].to_s == pref[1].to_s } + + value_type = configuration[1].constantize.new.send "preferred_#{pref[2]}_type" rescue 'string' + + execute "UPDATE spree_preferences set `key` = '#{configuration[1].underscore}/#{pref[2]}', `value_type` = '#{value_type}' where id = #{pref[0]}" rescue nil + end + + # remove orphaned calculator preferences + Spree::Preference.where(:owner_type => 'Spree::Calculator').each do |preference| + preference.destroy unless Spree::Calculator.exists? preference.owner_id + end + + Spree::PreferenceRescue.try + + Spree::Preference.where(:value_type => nil).update_all(:value_type => 'string') + end + + def down + remove_column :spree_preferences, :key + remove_column :spree_preferences, :value_type + + add_column :spree_preferences, :name, :string + add_column :spree_preferences, :owner_id, :integer + add_column :spree_preferences, :owner_type, :string + add_column :spree_preferences, :group_id, :integer + add_column :spree_preferences, :group_type, :string + end +end \ No newline at end of file diff --git a/spec/dummy/db/migrate/20120502190341_rename_state_events_to_state_changes.spree.rb b/spec/dummy/db/migrate/20120502190341_rename_state_events_to_state_changes.spree.rb new file mode 100644 index 00000000..469e730d --- /dev/null +++ b/spec/dummy/db/migrate/20120502190341_rename_state_events_to_state_changes.spree.rb @@ -0,0 +1,10 @@ +# This migration comes from spree (originally 20120203001428) +class RenameStateEventsToStateChanges < ActiveRecord::Migration + def up + rename_table :spree_state_events, :spree_state_changes + end + + def down + rename_table :spree_state_changes, :spree_state_events + end +end diff --git a/spec/dummy/db/migrate/20120502190342_add_deleted_at_to_tax_category.spree.rb b/spec/dummy/db/migrate/20120502190342_add_deleted_at_to_tax_category.spree.rb new file mode 100644 index 00000000..b5f90236 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190342_add_deleted_at_to_tax_category.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120203153759) +class AddDeletedAtToTaxCategory < ActiveRecord::Migration + def change + add_column :spree_tax_categories, :deleted_at, :datetime + end +end diff --git a/spec/dummy/db/migrate/20120502190343_migrate_images_from_products_to_variants.spree.rb b/spec/dummy/db/migrate/20120502190343_migrate_images_from_products_to_variants.spree.rb new file mode 100644 index 00000000..5199cbd4 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190343_migrate_images_from_products_to_variants.spree.rb @@ -0,0 +1,36 @@ +# This migration comes from spree (originally 20120315064358) +class MigrateImagesFromProductsToVariants < ActiveRecord::Migration + def up + images = select_all("SELECT spree_assets.* FROM spree_assets + WHERE spree_assets.type IN ('Spree::Image') + AND spree_assets.viewable_type = 'Spree::Product'") + + images.each do |image| + master_variant_id = select_value("SELECT id FROM spree_variants + WHERE product_id = #{image['viewable_id']} + AND is_master = #{quoted_true}") + + execute("UPDATE spree_assets SET viewable_type = 'Spree::Variant', viewable_id = #{master_variant_id} + WHERE id = #{image['id']}") if master_variant_id + end + end + + def down + images = select_all("SELECT spree_assets.* FROM spree_assets + JOIN spree_variants + ON spree_variants.id = spree_assets.viewable_id + AND spree_variants.is_master = #{quoted_true} + WHERE spree_assets.type IN ('Spree::Image') + AND spree_assets.viewable_type = 'Spree::Variant'") + + images.each do |image| + product_id = select_value("SELECT spree_products.id FROM spree_products + JOIN spree_variants + ON spree_variants.id = #{image['viewable_id']} + AND spree_products.id = spree_variants.product_id") + + execute("UPDATE spree_assets SET viewable_type = 'Spree::Product', viewable_id = #{product_id} + WHERE id = #{image['id']}") if product_id + end + end +end diff --git a/spec/dummy/db/migrate/20120502190344_rename_attachment_size_to_attachment_file_size.spree.rb b/spec/dummy/db/migrate/20120502190344_rename_attachment_size_to_attachment_file_size.spree.rb new file mode 100644 index 00000000..2dec8f21 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190344_rename_attachment_size_to_attachment_file_size.spree.rb @@ -0,0 +1,6 @@ +# This migration comes from spree (originally 20120416233427) +class RenameAttachmentSizeToAttachmentFileSize < ActiveRecord::Migration + def change + rename_column :spree_assets, :attachment_size, :attachment_file_size + end +end diff --git a/spec/dummy/db/migrate/20120502190345_rename_columns_for_devise.spree_auth.rb b/spec/dummy/db/migrate/20120502190345_rename_columns_for_devise.spree_auth.rb new file mode 100644 index 00000000..e9c89ff6 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190345_rename_columns_for_devise.spree_auth.rb @@ -0,0 +1,39 @@ +# This migration comes from spree_auth (originally 20101026184950) +class RenameColumnsForDevise < ActiveRecord::Migration + def up + return if column_exists?(:spree_users, :password_salt) + rename_column :spree_users, :crypted_password, :encrypted_password + rename_column :spree_users, :salt, :password_salt + rename_column :spree_users, :remember_token_expires_at, :remember_created_at + rename_column :spree_users, :login_count, :sign_in_count + rename_column :spree_users, :failed_login_count, :failed_attempts + rename_column :spree_users, :single_access_token, :reset_password_token + rename_column :spree_users, :current_login_at, :current_sign_in_at + rename_column :spree_users, :last_login_at, :last_sign_in_at + rename_column :spree_users, :current_login_ip, :current_sign_in_ip + rename_column :spree_users, :last_login_ip, :last_sign_in_ip + add_column :spree_users, :authentication_token, :string + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :locked_at, :datetime + remove_column :spree_users, :api_key if column_exists?(:spree_users, :api_key) + remove_column :spree_users, :openid_identifier + end + + def down + remove_column :spree_users, :authentication_token + remove_column :spree_users, :locked_at + remove_column :spree_users, :unlock_token + rename_column :spree_users, :last_sign_in_ip, :last_login_ip + rename_column :spree_users, :current_sign_in_ip, :current_login_ip + rename_column :spree_users, :last_sign_in_at, :last_login_at + rename_column :spree_users, :current_sign_in_at, :current_login_at + rename_column :spree_users, :reset_password_token, :single_access_token + rename_column :spree_users, :failed_attempts, :failed_login_count + rename_column :spree_users, :sign_in_count, :login_count + rename_column :spree_users, :remember_created_at, :remember_token_expires_at + rename_column :spree_users, :password_salt, :salt + rename_column :spree_users, :encrypted_password, :crypted_password + add_column :spree_users, :unlock_token, :string + add_column :spree_users, :openid_identifier, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190346_convert_user_remember_field.spree_auth.rb b/spec/dummy/db/migrate/20120502190346_convert_user_remember_field.spree_auth.rb new file mode 100644 index 00000000..9e6a94ff --- /dev/null +++ b/spec/dummy/db/migrate/20120502190346_convert_user_remember_field.spree_auth.rb @@ -0,0 +1,12 @@ +# This migration comes from spree_auth (originally 20101214150824) +class ConvertUserRememberField < ActiveRecord::Migration + def up + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :datetime + end + + def down + remove_column :spree_users, :remember_created_at + add_column :spree_users, :remember_created_at, :string + end +end diff --git a/spec/dummy/db/migrate/20120502190347_create_tokenized_permissions.spree_auth.rb b/spec/dummy/db/migrate/20120502190347_create_tokenized_permissions.spree_auth.rb new file mode 100644 index 00000000..36c87512 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190347_create_tokenized_permissions.spree_auth.rb @@ -0,0 +1,14 @@ +# This migration comes from spree_auth (originally 20101217012656) +class CreateTokenizedPermissions < ActiveRecord::Migration + def change + create_table :tokenized_permissions do |t| + t.integer :permissable_id + t.string :permissable_type + t.string :token + + t.timestamps + end + + add_index :tokenized_permissions, [:permissable_id, :permissable_type], :name => 'index_tokenized_name_and_type' + end +end diff --git a/spec/dummy/db/migrate/20120502190348_tokens_for_legacy_orders.spree_auth.rb b/spec/dummy/db/migrate/20120502190348_tokens_for_legacy_orders.spree_auth.rb new file mode 100644 index 00000000..8e7781a0 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190348_tokens_for_legacy_orders.spree_auth.rb @@ -0,0 +1,19 @@ +# This migration comes from spree_auth (originally 20101219201531) +class TokensForLegacyOrders < ActiveRecord::Migration + def up + Spree::TokenizedPermission.table_name = 'tokenized_permissions' + + # add token permissions for legacy orders (stop relying on user persistence token) + Spree::Order.all.each do |order| + next unless order.user + permission = order.build_tokenized_permission + permission.token = order.user.persistence_token + permission.save! + end + + Spree::TokenizedPermission.table_name = 'spree_tokenized_permissions' + end + + def down + end +end diff --git a/spec/dummy/db/migrate/20120502190349_namespace_tokenized_permission.spree_auth.rb b/spec/dummy/db/migrate/20120502190349_namespace_tokenized_permission.spree_auth.rb new file mode 100644 index 00000000..d19d41e0 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190349_namespace_tokenized_permission.spree_auth.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_auth (originally 20111007143030) +class NamespaceTokenizedPermission < ActiveRecord::Migration + def change + rename_table :tokenized_permissions, :spree_tokenized_permissions + end +end diff --git a/spec/dummy/db/migrate/20120502190350_migrate_tokenized_permissions.spree_auth.rb b/spec/dummy/db/migrate/20120502190350_migrate_tokenized_permissions.spree_auth.rb new file mode 100644 index 00000000..4a6b5733 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190350_migrate_tokenized_permissions.spree_auth.rb @@ -0,0 +1,25 @@ +# This migration comes from spree_auth (originally 20111206075712) +class MigrateTokenizedPermissions < ActiveRecord::Migration + def concat(str1, str2) + dbtype = Rails.configuration.database_configuration[Rails.env]['adapter'].to_sym + + case dbtype + when :mysql, :mysql2 + "CONCAT(#{str1}, #{str2})" + when :sqlserver + "(#{str1} + #{str2})" + else + "(#{str1} || #{str2})" + end + end + + def up + execute "UPDATE spree_tokenized_permissions SET permissable_type = #{concat("'Spree::'", "permissable_type")}" + + " WHERE permissable_type NOT LIKE 'Spree::%' AND permissable_type IS NOT NULL" + end + + def down + execute "UPDATE spree_tokenized_permissions SET permissable_type = REPLACE(permissable_type, 'Spree::', '')" + + " WHERE permissable_type LIKE 'Spree::%'" + end +end diff --git a/spec/dummy/db/migrate/20120502190351_add_reset_password_sent_at_to_spree_users.spree_auth.rb b/spec/dummy/db/migrate/20120502190351_add_reset_password_sent_at_to_spree_users.spree_auth.rb new file mode 100644 index 00000000..7632ac34 --- /dev/null +++ b/spec/dummy/db/migrate/20120502190351_add_reset_password_sent_at_to_spree_users.spree_auth.rb @@ -0,0 +1,6 @@ +# This migration comes from spree_auth (originally 20120203010234) +class AddResetPasswordSentAtToSpreeUsers < ActiveRecord::Migration + def change + add_column :spree_users, :reset_password_sent_at, :datetime + end +end diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb new file mode 100644 index 00000000..b7527d60 --- /dev/null +++ b/spec/dummy/db/schema.rb @@ -0,0 +1,543 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20120502190351) do + + create_table "coupons", :force => true do |t| + t.string "code" + t.string "description" + t.integer "usage_limit" + t.boolean "combine" + t.datetime "expires_at" + t.datetime "starts_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_activators", :force => true do |t| + t.string "description" + t.datetime "expires_at" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "starts_at" + t.string "name" + t.string "event_name" + t.string "type" + end + + create_table "spree_addresses", :force => true do |t| + t.string "firstname" + t.string "lastname" + t.string "address1" + t.string "address2" + t.string "city" + t.string "zipcode" + t.string "phone" + t.string "state_name" + t.string "alternative_phone" + t.integer "state_id" + t.integer "country_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "company" + end + + add_index "spree_addresses", ["firstname"], :name => "index_addresses_on_firstname" + add_index "spree_addresses", ["lastname"], :name => "index_addresses_on_lastname" + + create_table "spree_adjustments", :force => true do |t| + t.integer "source_id" + t.decimal "amount", :precision => 8, :scale => 2 + t.string "label" + t.string "source_type" + t.integer "adjustable_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "mandatory" + t.boolean "locked" + t.integer "originator_id" + t.string "originator_type" + t.boolean "eligible", :default => true + t.string "adjustable_type" + end + + add_index "spree_adjustments", ["adjustable_id"], :name => "index_adjustments_on_order_id" + + create_table "spree_assets", :force => true do |t| + t.integer "viewable_id" + t.integer "attachment_width" + t.integer "attachment_height" + t.integer "attachment_file_size" + t.integer "position" + t.string "viewable_type", :limit => 50 + t.string "attachment_content_type" + t.string "attachment_file_name" + t.string "type", :limit => 75 + t.datetime "attachment_updated_at" + t.text "alt" + end + + add_index "spree_assets", ["viewable_id"], :name => "index_assets_on_viewable_id" + add_index "spree_assets", ["viewable_type", "type"], :name => "index_assets_on_viewable_type_and_type" + + create_table "spree_calculators", :force => true do |t| + t.string "type" + t.integer "calculable_id", :null => false + t.string "calculable_type", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_configurations", :force => true do |t| + t.string "name" + t.string "type", :limit => 50 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_configurations", ["name", "type"], :name => "index_configurations_on_name_and_type" + + create_table "spree_countries", :force => true do |t| + t.string "iso_name" + t.string "iso" + t.string "iso3" + t.string "name" + t.integer "numcode" + end + + create_table "spree_creditcards", :force => true do |t| + t.string "month" + t.string "year" + t.string "cc_type" + t.string "last_digits" + t.string "first_name" + t.string "last_name" + t.string "start_month" + t.string "start_year" + t.string "issue_number" + t.integer "address_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "gateway_customer_profile_id" + t.string "gateway_payment_profile_id" + end + + create_table "spree_gateways", :force => true do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", :default => true + t.string "environment", :default => "development" + t.string "server", :default => "test" + t.boolean "test_mode", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_inventory_units", :force => true do |t| + t.integer "lock_version", :default => 0 + t.string "state" + t.integer "variant_id" + t.integer "order_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "shipment_id" + t.integer "return_authorization_id" + end + + add_index "spree_inventory_units", ["order_id"], :name => "index_inventory_units_on_order_id" + add_index "spree_inventory_units", ["shipment_id"], :name => "index_inventory_units_on_shipment_id" + add_index "spree_inventory_units", ["variant_id"], :name => "index_inventory_units_on_variant_id" + + create_table "spree_line_items", :force => true do |t| + t.integer "order_id" + t.integer "variant_id" + t.integer "quantity", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_line_items", ["order_id"], :name => "index_line_items_on_order_id" + add_index "spree_line_items", ["variant_id"], :name => "index_line_items_on_variant_id" + + create_table "spree_log_entries", :force => true do |t| + t.integer "source_id" + t.string "source_type" + t.text "details" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_mail_methods", :force => true do |t| + t.string "environment" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_option_types", :force => true do |t| + t.string "name", :limit => 100 + t.string "presentation", :limit => 100 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "position", :default => 0, :null => false + end + + create_table "spree_option_types_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "option_type_id" + end + + create_table "spree_option_values", :force => true do |t| + t.integer "position" + t.string "name" + t.string "presentation" + t.integer "option_type_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_option_values_variants", :id => false, :force => true do |t| + t.integer "variant_id" + t.integer "option_value_id" + end + + add_index "spree_option_values_variants", ["variant_id", "option_value_id"], :name => "index_option_values_variants_on_variant_id_and_option_value_id" + add_index "spree_option_values_variants", ["variant_id"], :name => "index_option_values_variants_on_variant_id" + + create_table "spree_orders", :force => true do |t| + t.string "number", :limit => 15 + t.decimal "item_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal "total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.string "state" + t.decimal "adjustment_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.decimal "credit_total", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "completed_at" + t.integer "bill_address_id" + t.integer "ship_address_id" + t.decimal "payment_total", :precision => 8, :scale => 2, :default => 0.0 + t.integer "shipping_method_id" + t.string "shipment_state" + t.string "payment_state" + t.string "email" + t.text "special_instructions" + end + + add_index "spree_orders", ["number"], :name => "index_orders_on_number" + + create_table "spree_payment_methods", :force => true do |t| + t.string "type" + t.string "name" + t.text "description" + t.boolean "active", :default => true + t.string "environment", :default => "development" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.datetime "deleted_at" + t.string "display_on" + end + + create_table "spree_payments", :force => true do |t| + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "order_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "source_id" + t.string "source_type" + t.integer "payment_method_id" + t.string "state" + t.string "response_code" + t.string "avs_response" + end + + create_table "spree_preferences", :force => true do |t| + t.string "name", :limit => 100 + t.integer "owner_id", :limit => 30 + t.string "owner_type", :limit => 50 + t.integer "group_id" + t.string "group_type", :limit => 50 + t.text "value", :limit => 255 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "key" + t.string "value_type" + end + + add_index "spree_preferences", ["key"], :name => "index_spree_preferences_on_key", :unique => true + + create_table "spree_product_option_types", :force => true do |t| + t.integer "position" + t.integer "product_id" + t.integer "option_type_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_product_properties", :force => true do |t| + t.string "value" + t.integer "product_id" + t.integer "property_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_product_properties", ["product_id"], :name => "index_product_properties_on_product_id" + + create_table "spree_products", :force => true do |t| + t.string "name", :default => "", :null => false + t.text "description" + t.datetime "available_on" + t.datetime "deleted_at" + t.string "permalink" + t.string "meta_description" + t.string "meta_keywords" + t.integer "tax_category_id" + t.integer "shipping_category_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "count_on_hand", :default => 0, :null => false + end + + add_index "spree_products", ["available_on"], :name => "index_products_on_available_on" + add_index "spree_products", ["deleted_at"], :name => "index_products_on_deleted_at" + add_index "spree_products", ["name"], :name => "index_products_on_name" + add_index "spree_products", ["permalink"], :name => "index_products_on_permalink" + + create_table "spree_products_taxons", :id => false, :force => true do |t| + t.integer "product_id" + t.integer "taxon_id" + end + + add_index "spree_products_taxons", ["product_id"], :name => "index_products_taxons_on_product_id" + add_index "spree_products_taxons", ["taxon_id"], :name => "index_products_taxons_on_taxon_id" + + create_table "spree_properties", :force => true do |t| + t.string "name" + t.string "presentation", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_properties_prototypes", :id => false, :force => true do |t| + t.integer "prototype_id" + t.integer "property_id" + end + + create_table "spree_prototypes", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_return_authorizations", :force => true do |t| + t.string "number" + t.string "state" + t.decimal "amount", :precision => 8, :scale => 2, :default => 0.0, :null => false + t.integer "order_id" + t.text "reason" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_roles", :force => true do |t| + t.string "name" + end + + create_table "spree_roles_users", :id => false, :force => true do |t| + t.integer "role_id" + t.integer "user_id" + end + + add_index "spree_roles_users", ["role_id"], :name => "index_roles_users_on_role_id" + add_index "spree_roles_users", ["user_id"], :name => "index_roles_users_on_user_id" + + create_table "spree_shipments", :force => true do |t| + t.string "tracking" + t.string "number" + t.decimal "cost", :precision => 8, :scale => 2 + t.datetime "shipped_at" + t.integer "order_id" + t.integer "shipping_method_id" + t.integer "address_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "state" + end + + add_index "spree_shipments", ["number"], :name => "index_shipments_on_number" + + create_table "spree_shipping_categories", :force => true do |t| + t.string "name" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_shipping_methods", :force => true do |t| + t.string "name" + t.integer "zone_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "display_on" + t.integer "shipping_category_id" + t.boolean "match_none" + t.boolean "match_all" + t.boolean "match_one" + end + + create_table "spree_state_changes", :force => true do |t| + t.string "name" + t.string "previous_state" + t.integer "stateful_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "stateful_type" + t.string "next_state" + end + + create_table "spree_states", :force => true do |t| + t.string "name" + t.string "abbr" + t.integer "country_id" + end + + create_table "spree_tax_categories", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "is_default", :default => false + t.datetime "deleted_at" + end + + create_table "spree_tax_rates", :force => true do |t| + t.decimal "amount", :precision => 8, :scale => 4 + t.integer "zone_id" + t.integer "tax_category_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "included_in_price", :default => false + end + + create_table "spree_taxonomies", :force => true do |t| + t.string "name", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_taxons", :force => true do |t| + t.integer "parent_id" + t.integer "position", :default => 0 + t.string "name", :null => false + t.string "permalink" + t.integer "taxonomy_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "lft" + t.integer "rgt" + t.string "icon_file_name" + t.string "icon_content_type" + t.integer "icon_file_size" + t.datetime "icon_updated_at" + t.text "description" + end + + add_index "spree_taxons", ["parent_id"], :name => "index_taxons_on_parent_id" + add_index "spree_taxons", ["permalink"], :name => "index_taxons_on_permalink" + add_index "spree_taxons", ["taxonomy_id"], :name => "index_taxons_on_taxonomy_id" + + create_table "spree_tokenized_permissions", :force => true do |t| + t.integer "permissable_id" + t.string "permissable_type" + t.string "token" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "spree_tokenized_permissions", ["permissable_id", "permissable_type"], :name => "index_tokenized_name_and_type" + + create_table "spree_trackers", :force => true do |t| + t.string "environment" + t.string "analytics_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_users", :force => true do |t| + t.string "encrypted_password", :limit => 128 + t.string "password_salt", :limit => 128 + t.string "email" + t.string "remember_token" + t.string "persistence_token" + t.string "reset_password_token" + t.string "perishable_token" + t.integer "sign_in_count", :default => 0, :null => false + t.integer "failed_attempts", :default => 0, :null => false + t.datetime "last_request_at" + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "login" + t.integer "ship_address_id" + t.integer "bill_address_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "authentication_token" + t.string "unlock_token" + t.datetime "locked_at" + t.datetime "remember_created_at" + t.datetime "reset_password_sent_at" + end + + add_index "spree_users", ["persistence_token"], :name => "index_users_on_persistence_token" + + create_table "spree_variants", :force => true do |t| + t.string "sku", :default => "", :null => false + t.decimal "price", :precision => 8, :scale => 2, :null => false + t.decimal "weight", :precision => 8, :scale => 2 + t.decimal "height", :precision => 8, :scale => 2 + t.decimal "width", :precision => 8, :scale => 2 + t.decimal "depth", :precision => 8, :scale => 2 + t.datetime "deleted_at" + t.boolean "is_master", :default => false + t.integer "product_id" + t.integer "count_on_hand", :default => 0, :null => false + t.decimal "cost_price", :precision => 8, :scale => 2 + t.integer "position" + end + + add_index "spree_variants", ["product_id"], :name => "index_variants_on_product_id" + + create_table "spree_zone_members", :force => true do |t| + t.integer "zoneable_id" + t.string "zoneable_type" + t.integer "zone_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "spree_zones", :force => true do |t| + t.string "name" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "default_tax", :default => false + end + +end diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb new file mode 100644 index 00000000..07d3e3fb --- /dev/null +++ b/spec/dummy/db/seeds.rb @@ -0,0 +1,11 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) +# Mayor.create(:name => 'Emanuel', :city => cities.first) + + +Spree::Core::Engine.load_seed if defined?(Spree::Core) +Spree::Auth::Engine.load_seed if defined?(Spree::Auth) diff --git a/spec/dummy/db/spree_development.sqlite3 b/spec/dummy/db/spree_development.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..6987297f57e8349e7251447ebe23453e31474971 GIT binary patch literal 372736 zcmeI*4{#jUeIIZf|1AzU04rP8S)ydEj)I6aN%3&N;g2ku0?88%69gy-utiJOdU5*z zta!J3+}#5KI*M}uDW}e#&UD-~lXe`tSXQun>Ry}P$>_dw_Xjsfy34ZyqKd;9ji&-=6Q-O=)^ugsVpQI>6|tb58x zm)w;|biJe~U0q$P^yhW@^KtrfxT`DS)&Hcw>;EJgFShw}wd>3`pFT=693A)$%l7KP z4+p+K@IME>JMbN8>)0Yiy^+L~Ufl4erbw!GDh zvZg!5RoxlN5)2)>B4XtrgA$i$!Tu-y~a`eiQ-Y&)U zbjQ=;D_2j8t)l6=Rno2^x?woPbv34GS{_*;4sB|2l@xE-RZk2%ME8iH>0U-L=qt}G z6JEGlVbM0}>ZZ{rrB9to-1&^q=bE=}asBSU?QhrjeriYk-x@z!Mc*hBOKcvkM$nlp z3B7DrE!JF8G|PHvXySBERW21?o?4t)P_oZw`Q}r|ify?>E80f1U-dOtYvgE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^mQApijgKmY;|fB*y_009U<00IX^fc^jfb;$>%wx}lrAOHafKmY;|fB*y_ o009U<00Nx|;QZf-8m@r=1Rwwb2tWV=5P$##AOHaf94vwV4?5K7`~Uy| literal 0 HcmV?d00001 diff --git a/spec/dummy/db/spree_test.sqlite3 b/spec/dummy/db/spree_test.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..088e4fc336ae910138004122fc9fc916f79d2b11 GIT binary patch literal 372736 zcmeFa3t$^*d8n|M}~rHMTo zX+{~1k~mz-*vppELMit{ftE{Yfx`cn_Ow7bE#&|$Eu}4ISqg3Gc1v4IIUHE%w*Qv4 z|2w0RJQ~SK*2%y7Cw+6#<^68&_k8d7e((3qNXnc_h^j!Ik(Dy9lH(4)gCHCalBC1o z_$2&)2>v(zq~Qh8cw>8Q5x2bjq~qw*w|9f6+xHK8LdN%RzGrIt1><88u@rKMWAAQz!lQBs9vK?!LGysp6f1fj)6sVH1D z9-yDn8F9I$@Tw?F)x0bjs^od8m{(UTO&HcpJ`(}MM(NX_zFygt>Isr5c7v9+HXWIv zKXh1cF&NUS9#>#uf>`fu84qir26n5=+j(THS++Dh9pM_9HpgpXL?5n#BJiqE%=2oH zEW#^QEDP3gu2ppDCh4KIJKV0ov17#gIcu-^QlVDjRat4+;fBD|vA-MXTk33Uzf3zU z)GLL#k=Kpev?puVEIHb1Xvug@j5M;}6<9bxXeo;Y^VO=L8kT!r6fWp9*sxri3D$E=6RCqTkRh}l>~#eW z93UQdSuClZ*V<-ZC;Qo`@_D8_02W?V`NB$BkktGIv8b*z?WZ+uMG%))VB(m@ z)tY!lgh8!}mo}Ukq*vsss5>odnWhe{R#=~(7EQqGsk%n3*-Ue{1aV41-9gYs&Y*!v^W}_TUlR@!L14f zvCNkaO&uB2J#L9#5=w2Wp;<%cv2E$H#oDgPd4notSTS`!y&5E!WVs~plCGazI4i)E z-H^zNxGYL~Myo4@td@k1iVGzu2)?aZ85yOgsazsU9#juPdCOR~mk()O+rcXxwt1yu zQGx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lj#YNU%ZW+bx-uMB(AdEbp@8o?VMZWJ_5@xT^{IbCH6l+>;B5sz z_M}C;G=|ttu;_&Hgua5nKF5N8>IoRHJ8C*W^JEBi<*5$PKw0q1fdJ?pZ0{W0fRhC6 z^Xk_bftqndng>|D`e81*0>JC{A8j^tI8A9fA+*`J5eLuq1(etC8gTTW33ws6WAA%M z&WE~!=eq*X>pRO6xXm#^lh6~iw!w=~Znt|q8-|b?iDu3cOBZ!GE|=%!*0;NIr`;N9 zn3Rs`I3;9Zmch%O+->(4ZU}@|Of$-61j7WLwy*Co<|7pJZ(9=VQoQ!RtvLIE-MXJoF?7N`O$XkO5jrdw1B{oawN5e+nliGuRL zGhM+eSq6XX33#y+V>BN!qD?x((Eyb~SM^h5o7^0K-V}gi*D%pSRj&8yS|5cLc$YS+ zaJ^I4`Y6F)p9rY(U8SiohoM6e<%UYeGc4@G9 zOw<$bXIG01psBkKqB*d9R{CT2&wBz0?L;h3`%~an{98R*nXRt0{F$c-eDjPGPR6`C zhi|?%@Kss>jXW)qqfOkLQLwX~&(z+Ua1TC%``Cj`7j{fShbu~=4BY@Y< zGEmGJ=bYudM)9squOlGX?nCHts8^uvzRez~dNpBJ0I%J3oF$r%i;)#gX4$#s<0`Xv zQ^2oX0X8QZLLmy{319}pONuR|w?DyFt>XA`tw!LbdFLYm&UPxJ*$|}i`Z3lCj!8lHsKEuN{V;!ZwG=r`Hc>DFvup@SnEwb4nyI8}X+L+=4 z0mXK8oE1^*>o_a$I=g;Y`8qZax&oB#=E!XdsGsF{a9%Ef^w+^&C`EH^<2D%=P~0|; z@iNEF{Td3pG@tk6v!;OaVay@!E_s@#lf15;hA{bppAQ8r{BV2c@W$&(CsJ#c26;d4 rN3V;W2xe}5dG_Fqb], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.2ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (2.2ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.1ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-1-5819"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-1-5819' LIMIT 1 + Rendered /Users/ryan/Sites/gems/spree/core/app/views/spree/products/show.html.erb within spree/layouts/spree_application (5.2ms) +Completed 200 OK in 135ms (Views: 127.3ms | ActiveRecord: 0.2ms) +  (1.4ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::TaxCategory Load (0.4ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + Spree::TaxCategory Exists (0.1ms) SELECT 1 FROM "spree_tax_categories" WHERE ("spree_tax_categories"."name" = 'TaxCategory - 198665' AND "spree_tax_categories"."deleted_at" IS NULL) LIMIT 1 + SQL (0.5ms) INSERT INTO "spree_tax_categories" ("created_at", "deleted_at", "description", "is_default", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 02 May 2012 19:03:26 UTC +00:00], ["deleted_at", nil], ["description", "In dolores voluptas eligendi dolor nam commodi sed."], ["is_default", false], ["name", "TaxCategory - 198665"], ["updated_at", Wed, 02 May 2012 19:03:26 UTC +00:00]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Spree::ShippingCategory Load (0.2ms) SELECT "spree_shipping_categories".* FROM "spree_shipping_categories" LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.8ms) INSERT INTO "spree_shipping_categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 02 May 2012 19:03:26 UTC +00:00], ["name", "ShippingCategory #2"], ["updated_at", Wed, 02 May 2012 19:03:26 UTC +00:00]] +  (0.1ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE (permalink LIKE 'product-number-2-5379%') ORDER BY name ASC, LENGTH(permalink) DESC, permalink DESC LIMIT 1 + Spree::Product Exists (0.1ms) SELECT 1 FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-5379' LIMIT 1 + SQL (0.4ms) INSERT INTO "spree_products" ("available_on", "count_on_hand", "created_at", "deleted_at", "description", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["available_on", Thu, 02 May 2013 19:03:26 UTC +00:00], ["count_on_hand", 0], ["created_at", Wed, 02 May 2012 19:03:26 UTC +00:00], ["deleted_at", nil], ["description", "Doloremque beatae expedita excepturi qui et. Qui alias pariatur quisquam voluptas impedit dolorum eos aut. Eos animi est facere iure architecto amet saepe. Autem architecto perferendis qui et modi dicta ipsum id.\nOfficiis quia saepe quis mollitia. Non veritatis itaque omnis dolorem illo quidem. Ratione et consequatur nesciunt velit voluptas fuga aut. Repellendus cumque eum voluptas."], ["meta_description", nil], ["meta_keywords", nil], ["name", "Product #2 - 5379"], ["permalink", "product-number-2-5379"], ["shipping_category_id", 1], ["tax_category_id", 1], ["updated_at", Wed, 02 May 2012 19:03:26 UTC +00:00]] + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = 1 LIMIT 1 + SQL (0.1ms) UPDATE "spree_products" SET "updated_at" = '2012-05-02 19:03:26.832633' WHERE "spree_products"."id" = 1 + SQL (0.1ms) INSERT INTO "spree_variants" ("cost_price", "count_on_hand", "deleted_at", "depth", "height", "is_master", "position", "price", "product_id", "sku", "weight", "width") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["cost_price", #], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.1ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (0.1ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-2-5379"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-5379' LIMIT 1 +Completed 200 OK in 44ms (Views: 1.7ms | ActiveRecord: 0.2ms) +  (1.5ms) rollback transaction +  (1.8ms) select owner_id, owner_type, name, value from spree_preferences where `key` is null + Spree::Preference Load (0.2ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE ("spree_preferences"."key" IS NOT NULL) AND ("spree_preferences"."value_type" IS NOT NULL) + Spree::MailMethod Load (0.2ms) SELECT "spree_mail_methods".* FROM "spree_mail_methods" WHERE "spree_mail_methods"."environment" = 'test' LIMIT 1 + Spree::Property Load (0.2ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = 'brand' LIMIT 1 +  (0.1ms) begin transaction + Fixture Delete (0.4ms) DELETE FROM "spree_countries" + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Chad', 'TCD', 'TD', 'CHAD', 39, 148) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Faroe Islands', 'FRO', 'FO', 'FAROE ISLANDS', 65, 234) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('India', 'IND', 'IN', 'INDIA', 92, 356) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nicaragua', 'NIC', 'NI', 'NICARAGUA', 146, 558) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Lucia', 'LCA', 'LC', 'SAINT LUCIA', 172, 662) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Fiji', 'FJI', 'FJ', 'FIJI', 66, 242) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Indonesia', 'IDN', 'ID', 'INDONESIA', 93, 360) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Niger', 'NER', 'NE', 'NIGER', 147, 562) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Pierre and Miquelon', 'SPM', 'PM', 'SAINT PIERRE AND MIQUELON', 173, 666) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Finland', 'FIN', 'FI', 'FINLAND', 67, 246) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nigeria', 'NGA', 'NG', 'NIGERIA', 148, 566) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Vincent and the Grenadines', 'VCT', 'VC', 'SAINT VINCENT AND THE GRENADINES', 174, 670) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('France', 'FRA', 'FR', 'FRANCE', 68, 250) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iran, Islamic Republic of', 'IRN', 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 94, 364) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Niue', 'NIU', 'NU', 'NIUE', 149, 570) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Samoa', 'WSM', 'WS', 'SAMOA', 175, 882) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('French Guiana', 'GUF', 'GF', 'FRENCH GUIANA', 69, 254) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iraq', 'IRQ', 'IQ', 'IRAQ', 95, 368) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('San Marino', 'SMR', 'SM', 'SAN MARINO', 176, 674) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ireland', 'IRL', 'IE', 'IRELAND', 96, 372) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sao Tome and Principe', 'STP', 'ST', 'SAO TOME AND PRINCIPE', 177, 678) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Israel', 'ISR', 'IL', 'ISRAEL', 97, 376) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saudi Arabia', 'SAU', 'SA', 'SAUDI ARABIA', 178, 682) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Italy', 'ITA', 'IT', 'ITALY', 98, 380) + Fixture Insert (0.2ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Senegal', 'SEN', 'SN', 'SENEGAL', 179, 686) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Jamaica', 'JAM', 'JM', 'JAMAICA', 99, 388) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Japan', 'JPN', 'JP', 'JAPAN', 100, 392) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Jordan', 'JOR', 'JO', 'JORDAN', 101, 400) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belgium', 'BEL', 'BE', 'BELGIUM', 20, 56) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belize', 'BLZ', 'BZ', 'BELIZE', 21, 84) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kazakhstan', 'KAZ', 'KZ', 'KAZAKHSTAN', 102, 398) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uganda', 'UGA', 'UG', 'UGANDA', 210, 800) + Fixture Insert (0.4ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Benin', 'BEN', 'BJ', 'BENIN', 22, 204) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kenya', 'KEN', 'KE', 'KENYA', 103, 404) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ukraine', 'UKR', 'UA', 'UKRAINE', 211, 804) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bermuda', 'BMU', 'BM', 'BERMUDA', 23, 60) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kiribati', 'KIR', 'KI', 'KIRIBATI', 104, 296) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mexico', 'MEX', 'MX', 'MEXICO', 130, 484) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United Arab Emirates', 'ARE', 'AE', 'UNITED ARAB EMIRATES', 212, 784) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bhutan', 'BTN', 'BT', 'BHUTAN', 24, 64) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cuba', 'CUB', 'CU', 'CUBA', 50, 192) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('North Korea', 'PRK', 'KP', 'KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF', 105, 408) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Micronesia, Federated States of', 'FSM', 'FM', 'MICRONESIA, FEDERATED STATES OF', 131, 583) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United Kingdom', 'GBR', 'GB', 'UNITED KINGDOM', 213, 826) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bolivia', 'BOL', 'BO', 'BOLIVIA', 25, 68) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cyprus', 'CYP', 'CY', 'CYPRUS', 51, 196) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('South Korea', 'KOR', 'KR', 'KOREA, REPUBLIC OF', 106, 410) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Moldova, Republic of', 'MDA', 'MD', 'MOLDOVA, REPUBLIC OF', 132, 498) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United States', 'USA', 'US', 'UNITED STATES', 214, 840) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bosnia and Herzegovina', 'BIH', 'BA', 'BOSNIA AND HERZEGOVINA', 26, 70) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Czech Republic', 'CZE', 'CZ', 'CZECH REPUBLIC', 52, 203) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kuwait', 'KWT', 'KW', 'KUWAIT', 107, 414) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Monaco', 'MCO', 'MC', 'MONACO', 133, 492) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uruguay', 'URY', 'UY', 'URUGUAY', 215, 858) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Botswana', 'BWA', 'BW', 'BOTSWANA', 27, 72) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Denmark', 'DNK', 'DK', 'DENMARK', 53, 208) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guadeloupe', 'GLP', 'GP', 'GUADELOUPE', 80, 312) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kyrgyzstan', 'KGZ', 'KG', 'KYRGYZSTAN', 108, 417) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mongolia', 'MNG', 'MN', 'MONGOLIA', 134, 496) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Philippines', 'PHL', 'PH', 'PHILIPPINES', 160, 608) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Brazil', 'BRA', 'BR', 'BRAZIL', 28, 76) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Djibouti', 'DJI', 'DJ', 'DJIBOUTI', 54, 262) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guam', 'GUM', 'GU', 'GUAM', 81, 316) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lao People''s Democratic Republic', 'LAO', 'LA', 'LAO PEOPLE''S DEMOCRATIC REPUBLIC', 109, 418) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Montserrat', 'MSR', 'MS', 'MONTSERRAT', 135, 500) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Pitcairn', 'PCN', 'PN', 'PITCAIRN', 161, 612) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uzbekistan', 'UZB', 'UZ', 'UZBEKISTAN', 216, 860) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Brunei Darussalam', 'BRN', 'BN', 'BRUNEI DARUSSALAM', 29, 96) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Dominica', 'DMA', 'DM', 'DOMINICA', 55, 212) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guatemala', 'GTM', 'GT', 'GUATEMALA', 82, 320) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Morocco', 'MAR', 'MA', 'MOROCCO', 136, 504) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Poland', 'POL', 'PL', 'POLAND', 162, 616) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Vanuatu', 'VUT', 'VU', 'VANUATU', 217, 548) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Dominican Republic', 'DOM', 'DO', 'DOMINICAN REPUBLIC', 56, 214) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mozambique', 'MOZ', 'MZ', 'MOZAMBIQUE', 137, 508) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Portugal', 'PRT', 'PT', 'PORTUGAL', 163, 620) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sudan', 'SDN', 'SD', 'SUDAN', 190, 736) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Venezuela', 'VEN', 'VE', 'VENEZUELA', 218, 862) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ecuador', 'ECU', 'EC', 'ECUADOR', 57, 218) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guinea', 'GIN', 'GN', 'GUINEA', 83, 324) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Myanmar', 'MMR', 'MM', 'MYANMAR', 138, 104) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Puerto Rico', 'PRI', 'PR', 'PUERTO RICO', 164, 630) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Suriname', 'SUR', 'SR', 'SURINAME', 191, 740) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Viet Nam', 'VNM', 'VN', 'VIET NAM', 219, 704) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Egypt', 'EGY', 'EG', 'EGYPT', 58, 818) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guinea-Bissau', 'GNB', 'GW', 'GUINEA-BISSAU', 84, 624) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Namibia', 'NAM', 'NA', 'NAMIBIA', 139, 516) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Qatar', 'QAT', 'QA', 'QATAR', 165, 634) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Svalbard and Jan Mayen', 'SJM', 'SJ', 'SVALBARD AND JAN MAYEN', 192, 744) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('El Salvador', 'SLV', 'SV', 'EL SALVADOR', 59, 222) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guyana', 'GUY', 'GY', 'GUYANA', 85, 328) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Reunion', 'REU', 'RE', 'REUNION', 166, 638) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Haiti', 'HTI', 'HT', 'HAITI', 86, 332) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Romania', 'ROM', 'RO', 'ROMANIA', 167, 642) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Swaziland', 'SWZ', 'SZ', 'SWAZILAND', 193, 748) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Holy See (Vatican City State)', 'VAT', 'VA', 'HOLY SEE (VATICAN CITY STATE)', 87, 336) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Russian Federation', 'RUS', 'RU', 'RUSSIAN FEDERATION', 168, 643) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sweden', 'SWE', 'SE', 'SWEDEN', 194, 752) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Honduras', 'HND', 'HN', 'HONDURAS', 88, 340) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Rwanda', 'RWA', 'RW', 'RWANDA', 169, 646) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Switzerland', 'CHE', 'CH', 'SWITZERLAND', 195, 756) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Hong Kong', 'HKG', 'HK', 'HONG KONG', 89, 344) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Syrian Arab Republic', 'SYR', 'SY', 'SYRIAN ARAB REPUBLIC', 196, 760) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Taiwan', 'TWN', 'TW', 'TAIWAN, PROVINCE OF CHINA', 197, 158) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tajikistan', 'TJK', 'TJ', 'TAJIKISTAN', 198, 762) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tanzania, United Republic of', 'TZA', 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 199, 834) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Armenia', 'ARM', 'AM', 'ARMENIA', 10, 51) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Aruba', 'ABW', 'AW', 'ARUBA', 11, 533) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Australia', 'AUS', 'AU', 'AUSTRALIA', 12, 36) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Thailand', 'THA', 'TH', 'THAILAND', 200, 764) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Austria', 'AUT', 'AT', 'AUSTRIA', 13, 40) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Madagascar', 'MDG', 'MG', 'MADAGASCAR', 120, 450) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Togo', 'TGO', 'TG', 'TOGO', 201, 768) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Azerbaijan', 'AZE', 'AZ', 'AZERBAIJAN', 14, 31) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Chile', 'CHL', 'CL', 'CHILE', 40, 152) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malawi', 'MWI', 'MW', 'MALAWI', 121, 454) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tokelau', 'TKL', 'TK', 'TOKELAU', 202, 772) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bahamas', 'BHS', 'BS', 'BAHAMAS', 15, 44) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('China', 'CHN', 'CN', 'CHINA', 41, 156) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malaysia', 'MYS', 'MY', 'MALAYSIA', 122, 458) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tonga', 'TON', 'TO', 'TONGA', 203, 776) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bahrain', 'BHR', 'BH', 'BAHRAIN', 16, 48) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Colombia', 'COL', 'CO', 'COLOMBIA', 42, 170) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Maldives', 'MDV', 'MV', 'MALDIVES', 123, 462) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Trinidad and Tobago', 'TTO', 'TT', 'TRINIDAD AND TOBAGO', 204, 780) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bangladesh', 'BGD', 'BD', 'BANGLADESH', 17, 50) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Comoros', 'COM', 'KM', 'COMOROS', 43, 174) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('French Polynesia', 'PYF', 'PF', 'FRENCH POLYNESIA', 70, 258) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mali', 'MLI', 'ML', 'MALI', 124, 466) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Norfolk Island', 'NFK', 'NF', 'NORFOLK ISLAND', 150, 574) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tunisia', 'TUN', 'TN', 'TUNISIA', 205, 788) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Barbados', 'BRB', 'BB', 'BARBADOS', 18, 52) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Congo', 'COG', 'CG', 'CONGO', 44, 178) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gabon', 'GAB', 'GA', 'GABON', 71, 266) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malta', 'MLT', 'MT', 'MALTA', 125, 470) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Northern Mariana Islands', 'MNP', 'MP', 'NORTHERN MARIANA ISLANDS', 151, 580) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turkey', 'TUR', 'TR', 'TURKEY', 206, 792) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Congo, the Democratic Republic of the', 'COD', 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 45, 180) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Marshall Islands', 'MHL', 'MH', 'MARSHALL ISLANDS', 126, 584) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Norway', 'NOR', 'NO', 'NORWAY', 152, 578) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turkmenistan', 'TKM', 'TM', 'TURKMENISTAN', 207, 795) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belarus', 'BLR', 'BY', 'BELARUS', 19, 112) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cook Islands', 'COK', 'CK', 'COOK ISLANDS', 46, 184) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gambia', 'GMB', 'GM', 'GAMBIA', 72, 270) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Martinique', 'MTQ', 'MQ', 'MARTINIQUE', 127, 474) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Oman', 'OMN', 'OM', 'OMAN', 153, 512) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Seychelles', 'SYC', 'SC', 'SEYCHELLES', 180, 690) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turks and Caicos Islands', 'TCA', 'TC', 'TURKS AND CAICOS ISLANDS', 208, 796) + Fixture Insert (0.2ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Georgia', 'GEO', 'GE', 'GEORGIA', 73, 268) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mauritania', 'MRT', 'MR', 'MAURITANIA', 128, 478) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Pakistan', 'PAK', 'PK', 'PAKISTAN', 154, 586) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sierra Leone', 'SLE', 'SL', 'SIERRA LEONE', 181, 694) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tuvalu', 'TUV', 'TV', 'TUVALU', 209, 798) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Costa Rica', 'CRI', 'CR', 'COSTA RICA', 47, 188) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Germany', 'DEU', 'DE', 'GERMANY', 74, 276) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mauritius', 'MUS', 'MU', 'MAURITIUS', 129, 480) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Palau', 'PLW', 'PW', 'PALAU', 155, 585) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cote D''Ivoire', 'CIV', 'CI', 'COTE D''IVOIRE', 48, 384) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Panama', 'PAN', 'PA', 'PANAMA', 156, 591) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Singapore', 'SGP', 'SG', 'SINGAPORE', 182, 702) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Croatia', 'HRV', 'HR', 'CROATIA', 49, 191) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ghana', 'GHA', 'GH', 'GHANA', 75, 288) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Papua New Guinea', 'PNG', 'PG', 'PAPUA NEW GUINEA', 157, 598) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Slovakia', 'SVK', 'SK', 'SLOVAKIA', 183, 703) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gibraltar', 'GIB', 'GI', 'GIBRALTAR', 76, 292) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Paraguay', 'PRY', 'PY', 'PARAGUAY', 158, 600) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Slovenia', 'SVN', 'SI', 'SLOVENIA', 184, 705) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Greece', 'GRC', 'GR', 'GREECE', 77, 300) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Peru', 'PER', 'PE', 'PERU', 159, 604) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Solomon Islands', 'SLB', 'SB', 'SOLOMON ISLANDS', 185, 90) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Greenland', 'GRL', 'GL', 'GREENLAND', 78, 304) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Somalia', 'SOM', 'SO', 'SOMALIA', 186, 706) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Grenada', 'GRD', 'GD', 'GRENADA', 79, 308) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('South Africa', 'ZAF', 'ZA', 'SOUTH AFRICA', 187, 710) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Spain', 'ESP', 'ES', 'SPAIN', 188, 724) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sri Lanka', 'LKA', 'LK', 'SRI LANKA', 189, 144) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Afghanistan', 'AFG', 'AF', 'AFGHANISTAN', 1, 4) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Albania', 'ALB', 'AL', 'ALBANIA', 2, 8) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Algeria', 'DZA', 'DZ', 'ALGERIA', 3, 12) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Latvia', 'LVA', 'LV', 'LATVIA', 110, 428) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('American Samoa', 'ASM', 'AS', 'AMERICAN SAMOA', 4, 16) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bulgaria', 'BGR', 'BG', 'BULGARIA', 30, 100) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lebanon', 'LBN', 'LB', 'LEBANON', 111, 422) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Andorra', 'AND', 'AD', 'ANDORRA', 5, 20) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Burkina Faso', 'BFA', 'BF', 'BURKINA FASO', 31, 854) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lesotho', 'LSO', 'LS', 'LESOTHO', 112, 426) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Angola', 'AGO', 'AO', 'ANGOLA', 6, 24) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Burundi', 'BDI', 'BI', 'BURUNDI', 32, 108) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Liberia', 'LBR', 'LR', 'LIBERIA', 113, 430) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Virgin Islands, British', 'VGB', 'VG', 'VIRGIN ISLANDS, BRITISH', 220, 92) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Anguilla', 'AIA', 'AI', 'ANGUILLA', 7, 660) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cambodia', 'KHM', 'KH', 'CAMBODIA', 33, 116) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Equatorial Guinea', 'GNQ', 'GQ', 'EQUATORIAL GUINEA', 60, 226) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Libyan Arab Jamahiriya', 'LBY', 'LY', 'LIBYAN ARAB JAMAHIRIYA', 114, 434) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nauru', 'NRU', 'NR', 'NAURU', 140, 520) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Virgin Islands, U.S.', 'VIR', 'VI', 'VIRGIN ISLANDS, U.S.', 221, 850) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Antigua and Barbuda', 'ATG', 'AG', 'ANTIGUA AND BARBUDA', 8, 28) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cameroon', 'CMR', 'CM', 'CAMEROON', 34, 120) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Liechtenstein', 'LIE', 'LI', 'LIECHTENSTEIN', 115, 438) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nepal', 'NPL', 'NP', 'NEPAL', 141, 524) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Wallis and Futuna', 'WLF', 'WF', 'WALLIS AND FUTUNA', 222, 876) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Western Sahara', 'ESH', 'EH', 'WESTERN SAHARA', 223, 732) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Argentina', 'ARG', 'AR', 'ARGENTINA', 9, 32) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Canada', 'CAN', 'CA', 'CANADA', 35, 124) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Eritrea', 'ERI', 'ER', 'ERITREA', 61, 232) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lithuania', 'LTU', 'LT', 'LITHUANIA', 116, 440) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Netherlands', 'NLD', 'NL', 'NETHERLANDS', 142, 528) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Yemen', 'YEM', 'YE', 'YEMEN', 224, 887) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cape Verde', 'CPV', 'CV', 'CAPE VERDE', 36, 132) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Estonia', 'EST', 'EE', 'ESTONIA', 62, 233) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Luxembourg', 'LUX', 'LU', 'LUXEMBOURG', 117, 442) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Netherlands Antilles', 'ANT', 'AN', 'NETHERLANDS ANTILLES', 143, 530) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Helena', 'SHN', 'SH', 'SAINT HELENA', 170, 654) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Zambia', 'ZMB', 'ZM', 'ZAMBIA', 225, 894) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cayman Islands', 'CYM', 'KY', 'CAYMAN ISLANDS', 37, 136) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ethiopia', 'ETH', 'ET', 'ETHIOPIA', 63, 231) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Hungary', 'HUN', 'HU', 'HUNGARY', 90, 348) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Macao', 'MAC', 'MO', 'MACAO', 118, 446) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('New Caledonia', 'NCL', 'NC', 'NEW CALEDONIA', 144, 540) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Zimbabwe', 'ZWE', 'ZW', 'ZIMBABWE', 226, 716) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Central African Republic', 'CAF', 'CF', 'CENTRAL AFRICAN REPUBLIC', 38, 140) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Falkland Islands (Malvinas)', 'FLK', 'FK', 'FALKLAND ISLANDS (MALVINAS)', 64, 238) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iceland', 'ISL', 'IS', 'ICELAND', 91, 352) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Macedonia', 'MKD', 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 119, 807) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('New Zealand', 'NZL', 'NZ', 'NEW ZEALAND', 145, 554) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Kitts and Nevis', 'KNA', 'KN', 'SAINT KITTS AND NEVIS', 171, 659) + Fixture Delete (0.1ms) DELETE FROM "spree_zones" + Fixture Insert (0.1ms) INSERT INTO "spree_zones" ("name", "created_at", "updated_at", "id", "description") VALUES ('EU_VAT', '2009-06-04 17:22:26.000000', '2009-06-04 17:22:26.000000', 1, 'Countries that make up the EU VAT zone.') + Fixture Insert (0.1ms) INSERT INTO "spree_zones" ("name", "created_at", "updated_at", "id", "description") VALUES ('North America', '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'USA + Canada') + Fixture Delete (0.1ms) DELETE FROM "spree_zone_members" + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (162, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 394938353) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (67, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 966149671) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (163, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 91991191) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (167, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 847027202) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (74, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 777453396) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (68, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 244414130) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (183, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 729140670) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (90, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 424792003) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (184, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 477297967) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (96, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 5807739) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (13, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 4914820) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (188, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 35022990) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (98, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 929017584) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (20, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 423866172) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (194, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 890329113) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (110, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 691747661) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (30, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 776249265) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (213, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 739772837) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (116, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 507251676) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (51, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 807406092) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (117, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 120937060) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (52, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 120011419) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (214, '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'Spree::Country', 195044517) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (125, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 808610553) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (53, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 506358563) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (35, '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'Spree::Country', 1017582644) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (142, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 546142054) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (62, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 690576312) + Fixture Delete (0.1ms) DELETE FROM "spree_states" + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Michigan', 214, 931624400, 'MI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('South Dakota', 214, 615306087, 'SD') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Washington', 214, 414569975, 'WA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Wisconsin', 214, 103680699, 'WI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Arizona', 214, 948208802, 'AZ') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Illinois', 214, 625629523, 'IL') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Hampshire', 214, 426832442, 'NH') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('North Carolina', 214, 177087202, 'NC') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Kansas', 214, 969722173, 'KS') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Missouri', 214, 653576146, 'MO') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Arkansas', 214, 471470972, 'AR') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Nevada', 214, 179539703, 'NV') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('District of Columbia', 214, 6764998, 'DC') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Idaho', 214, 982433740, 'ID') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Nebraska', 214, 673350891, 'NE') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Pennsylvania', 214, 471711976, 'PA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Hawaii', 214, 199950338, 'HI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Utah', 214, 17199670, 'UT') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Vermont', 214, 989115415, 'VT') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Delaware', 214, 721598219, 'DE') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Rhode Island', 214, 474001862, 'RI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Oklahoma', 214, 248548169, 'OK') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Louisiana', 214, 37199952, 'LA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Montana', 214, 999156632, 'MT') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Tennessee', 214, 726305632, 'TN') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Maryland', 214, 480368357, 'MD') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Florida', 214, 267271847, 'FL') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Virginia', 214, 41111624, 'VA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Minnesota', 214, 1032288924, 'MN') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Jersey', 214, 750950030, 'NJ') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Ohio', 214, 485193526, 'OH') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('California', 214, 276110813, 'CA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('North Dakota', 214, 51943165, 'ND') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Maine', 214, 1055056709, 'ME') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Indiana', 214, 769938586, 'IN') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Texas', 214, 525212995, 'TX') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Oregon', 214, 298914262, 'OR') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Wyoming', 214, 66390489, 'WY') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Alabama', 214, 1061493585, 'AL') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Iowa', 214, 825306985, 'IA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Mississippi', 214, 532363768, 'MS') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Kentucky', 214, 308473843, 'KY') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Mexico', 214, 69729944, 'NM') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Georgia', 214, 876916760, 'GA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Colorado', 214, 536031023, 'CO') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Massachusetts', 214, 385551075, 'MA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Connecticut', 214, 69870734, 'CT') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New York', 214, 889445952, 'NY') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('South Carolina', 214, 597434151, 'SC') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Alaska', 214, 403740659, 'AK') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('West Virginia', 214, 91367981, 'WV') + Fixture Delete (0.1ms) DELETE FROM "spree_roles" + Fixture Insert (0.1ms) INSERT INTO "spree_roles" ("name", "id") VALUES ('admin', 930089099) + Fixture Insert (0.0ms) INSERT INTO "spree_roles" ("name", "id") VALUES ('user', 770229923) +  (3.6ms) commit transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::TaxCategory Load (0.1ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + Spree::TaxCategory Exists (0.1ms) SELECT 1 FROM "spree_tax_categories" WHERE ("spree_tax_categories"."name" = 'TaxCategory - 653797' AND "spree_tax_categories"."deleted_at" IS NULL) LIMIT 1 + SQL (0.7ms) INSERT INTO "spree_tax_categories" ("created_at", "deleted_at", "description", "is_default", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["deleted_at", nil], ["description", "Ipsam natus sed vel quasi."], ["is_default", false], ["name", "TaxCategory - 653797"], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::ShippingCategory Load (0.1ms) SELECT "spree_shipping_categories".* FROM "spree_shipping_categories" LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.8ms) INSERT INTO "spree_shipping_categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["name", "ShippingCategory #1"], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + Spree::Product Load (0.3ms) SELECT "spree_products".* FROM "spree_products" WHERE (permalink LIKE 'product-number-1-3374%') ORDER BY name ASC, LENGTH(permalink) DESC, permalink DESC LIMIT 1 + Spree::Product Exists (0.1ms) SELECT 1 FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-1-3374' LIMIT 1 + SQL (0.8ms) INSERT INTO "spree_products" ("available_on", "count_on_hand", "created_at", "deleted_at", "description", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["available_on", Thu, 02 May 2013 19:04:05 UTC +00:00], ["count_on_hand", 0], ["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["deleted_at", nil], ["description", "Molestiae nam deleniti voluptatibus nisi sequi. Corrupti quo dolore quia voluptates provident dignissimos officia aliquid. Consequatur autem natus nihil sequi repellat. Ut rerum aliquid voluptatem repellendus velit. Error omnis rerum tempora quo et consectetur beatae.\nOdit repellendus et dolor eius. Et et iste fugiat in omnis. Libero odio et impedit et omnis.\nVoluptatem est modi culpa et sapiente et laborum. Quae nisi ut sit enim natus. Rerum nisi quibusdam doloremque."], ["meta_description", nil], ["meta_keywords", nil], ["name", "Product #1 - 3374"], ["permalink", "product-number-1-3374"], ["shipping_category_id", 1], ["tax_category_id", 1], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = 1 LIMIT 1 + SQL (0.2ms) UPDATE "spree_products" SET "updated_at" = '2012-05-02 19:04:05.799813' WHERE "spree_products"."id" = 1 + SQL (0.3ms) INSERT INTO "spree_variants" ("cost_price", "count_on_hand", "deleted_at", "depth", "height", "is_master", "position", "price", "product_id", "sku", "weight", "width") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["cost_price", #], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.2ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (0.1ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-1-3374"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-1-3374' LIMIT 1 + Rendered /Users/ryan/Sites/gems/spree/core/app/views/spree/products/show.html.erb within spree/layouts/spree_application (3.8ms) +Completed 200 OK in 114ms (Views: 105.9ms | ActiveRecord: 0.2ms) +  (1.5ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::TaxCategory Load (0.2ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + Spree::TaxCategory Exists (0.1ms) SELECT 1 FROM "spree_tax_categories" WHERE ("spree_tax_categories"."name" = 'TaxCategory - 413247' AND "spree_tax_categories"."deleted_at" IS NULL) LIMIT 1 + SQL (0.6ms) INSERT INTO "spree_tax_categories" ("created_at", "deleted_at", "description", "is_default", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["deleted_at", nil], ["description", "Est placeat enim assumenda."], ["is_default", false], ["name", "TaxCategory - 413247"], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::ShippingCategory Load (0.1ms) SELECT "spree_shipping_categories".* FROM "spree_shipping_categories" LIMIT 1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "spree_shipping_categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["name", "ShippingCategory #2"], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE (permalink LIKE 'product-number-2-6347%') ORDER BY name ASC, LENGTH(permalink) DESC, permalink DESC LIMIT 1 + Spree::Product Exists (0.1ms) SELECT 1 FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-6347' LIMIT 1 + SQL (0.4ms) INSERT INTO "spree_products" ("available_on", "count_on_hand", "created_at", "deleted_at", "description", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["available_on", Thu, 02 May 2013 19:04:05 UTC +00:00], ["count_on_hand", 0], ["created_at", Wed, 02 May 2012 19:04:05 UTC +00:00], ["deleted_at", nil], ["description", "Temporibus tenetur culpa quo reiciendis saepe veritatis numquam et. Non aut amet libero. Ab qui reiciendis esse magnam qui velit quo nisi."], ["meta_description", nil], ["meta_keywords", nil], ["name", "Product #2 - 6347"], ["permalink", "product-number-2-6347"], ["shipping_category_id", 1], ["tax_category_id", 1], ["updated_at", Wed, 02 May 2012 19:04:05 UTC +00:00]] + Spree::Product Load (0.1ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = 1 LIMIT 1 + SQL (0.1ms) UPDATE "spree_products" SET "updated_at" = '2012-05-02 19:04:05.959540' WHERE "spree_products"."id" = 1 + SQL (0.1ms) INSERT INTO "spree_variants" ("cost_price", "count_on_hand", "deleted_at", "depth", "height", "is_master", "position", "price", "product_id", "sku", "weight", "width") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["cost_price", #], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.2ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (0.1ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-2-6347"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-6347' LIMIT 1 +Completed 404 Not Found in 42ms (Views: 3.0ms | ActiveRecord: 0.2ms) +  (1.5ms) rollback transaction +  (2.6ms) select owner_id, owner_type, name, value from spree_preferences where `key` is null + Spree::Preference Load (0.2ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE ("spree_preferences"."key" IS NOT NULL) AND ("spree_preferences"."value_type" IS NOT NULL) + Spree::MailMethod Load (0.2ms) SELECT "spree_mail_methods".* FROM "spree_mail_methods" WHERE "spree_mail_methods"."environment" = 'test' LIMIT 1 + Spree::Property Load (0.2ms) SELECT "spree_properties".* FROM "spree_properties" WHERE "spree_properties"."name" = 'brand' LIMIT 1 +  (0.1ms) begin transaction + Fixture Delete (0.5ms) DELETE FROM "spree_countries" + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Chad', 'TCD', 'TD', 'CHAD', 39, 148) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Faroe Islands', 'FRO', 'FO', 'FAROE ISLANDS', 65, 234) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('India', 'IND', 'IN', 'INDIA', 92, 356) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nicaragua', 'NIC', 'NI', 'NICARAGUA', 146, 558) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Lucia', 'LCA', 'LC', 'SAINT LUCIA', 172, 662) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Fiji', 'FJI', 'FJ', 'FIJI', 66, 242) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Indonesia', 'IDN', 'ID', 'INDONESIA', 93, 360) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Niger', 'NER', 'NE', 'NIGER', 147, 562) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Pierre and Miquelon', 'SPM', 'PM', 'SAINT PIERRE AND MIQUELON', 173, 666) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Finland', 'FIN', 'FI', 'FINLAND', 67, 246) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nigeria', 'NGA', 'NG', 'NIGERIA', 148, 566) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Vincent and the Grenadines', 'VCT', 'VC', 'SAINT VINCENT AND THE GRENADINES', 174, 670) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('France', 'FRA', 'FR', 'FRANCE', 68, 250) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iran, Islamic Republic of', 'IRN', 'IR', 'IRAN, ISLAMIC REPUBLIC OF', 94, 364) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Niue', 'NIU', 'NU', 'NIUE', 149, 570) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Samoa', 'WSM', 'WS', 'SAMOA', 175, 882) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('French Guiana', 'GUF', 'GF', 'FRENCH GUIANA', 69, 254) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iraq', 'IRQ', 'IQ', 'IRAQ', 95, 368) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('San Marino', 'SMR', 'SM', 'SAN MARINO', 176, 674) + Fixture Insert (0.4ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ireland', 'IRL', 'IE', 'IRELAND', 96, 372) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sao Tome and Principe', 'STP', 'ST', 'SAO TOME AND PRINCIPE', 177, 678) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Israel', 'ISR', 'IL', 'ISRAEL', 97, 376) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saudi Arabia', 'SAU', 'SA', 'SAUDI ARABIA', 178, 682) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Italy', 'ITA', 'IT', 'ITALY', 98, 380) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Senegal', 'SEN', 'SN', 'SENEGAL', 179, 686) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Jamaica', 'JAM', 'JM', 'JAMAICA', 99, 388) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Japan', 'JPN', 'JP', 'JAPAN', 100, 392) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Jordan', 'JOR', 'JO', 'JORDAN', 101, 400) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belgium', 'BEL', 'BE', 'BELGIUM', 20, 56) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belize', 'BLZ', 'BZ', 'BELIZE', 21, 84) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kazakhstan', 'KAZ', 'KZ', 'KAZAKHSTAN', 102, 398) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uganda', 'UGA', 'UG', 'UGANDA', 210, 800) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Benin', 'BEN', 'BJ', 'BENIN', 22, 204) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kenya', 'KEN', 'KE', 'KENYA', 103, 404) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ukraine', 'UKR', 'UA', 'UKRAINE', 211, 804) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bermuda', 'BMU', 'BM', 'BERMUDA', 23, 60) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kiribati', 'KIR', 'KI', 'KIRIBATI', 104, 296) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mexico', 'MEX', 'MX', 'MEXICO', 130, 484) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United Arab Emirates', 'ARE', 'AE', 'UNITED ARAB EMIRATES', 212, 784) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bhutan', 'BTN', 'BT', 'BHUTAN', 24, 64) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cuba', 'CUB', 'CU', 'CUBA', 50, 192) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('North Korea', 'PRK', 'KP', 'KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF', 105, 408) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Micronesia, Federated States of', 'FSM', 'FM', 'MICRONESIA, FEDERATED STATES OF', 131, 583) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United Kingdom', 'GBR', 'GB', 'UNITED KINGDOM', 213, 826) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bolivia', 'BOL', 'BO', 'BOLIVIA', 25, 68) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cyprus', 'CYP', 'CY', 'CYPRUS', 51, 196) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('South Korea', 'KOR', 'KR', 'KOREA, REPUBLIC OF', 106, 410) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Moldova, Republic of', 'MDA', 'MD', 'MOLDOVA, REPUBLIC OF', 132, 498) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('United States', 'USA', 'US', 'UNITED STATES', 214, 840) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bosnia and Herzegovina', 'BIH', 'BA', 'BOSNIA AND HERZEGOVINA', 26, 70) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Czech Republic', 'CZE', 'CZ', 'CZECH REPUBLIC', 52, 203) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kuwait', 'KWT', 'KW', 'KUWAIT', 107, 414) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Monaco', 'MCO', 'MC', 'MONACO', 133, 492) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uruguay', 'URY', 'UY', 'URUGUAY', 215, 858) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Botswana', 'BWA', 'BW', 'BOTSWANA', 27, 72) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Denmark', 'DNK', 'DK', 'DENMARK', 53, 208) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guadeloupe', 'GLP', 'GP', 'GUADELOUPE', 80, 312) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Kyrgyzstan', 'KGZ', 'KG', 'KYRGYZSTAN', 108, 417) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mongolia', 'MNG', 'MN', 'MONGOLIA', 134, 496) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Philippines', 'PHL', 'PH', 'PHILIPPINES', 160, 608) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Brazil', 'BRA', 'BR', 'BRAZIL', 28, 76) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Djibouti', 'DJI', 'DJ', 'DJIBOUTI', 54, 262) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guam', 'GUM', 'GU', 'GUAM', 81, 316) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lao People''s Democratic Republic', 'LAO', 'LA', 'LAO PEOPLE''S DEMOCRATIC REPUBLIC', 109, 418) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Montserrat', 'MSR', 'MS', 'MONTSERRAT', 135, 500) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Pitcairn', 'PCN', 'PN', 'PITCAIRN', 161, 612) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Uzbekistan', 'UZB', 'UZ', 'UZBEKISTAN', 216, 860) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Brunei Darussalam', 'BRN', 'BN', 'BRUNEI DARUSSALAM', 29, 96) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Dominica', 'DMA', 'DM', 'DOMINICA', 55, 212) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guatemala', 'GTM', 'GT', 'GUATEMALA', 82, 320) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Morocco', 'MAR', 'MA', 'MOROCCO', 136, 504) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Poland', 'POL', 'PL', 'POLAND', 162, 616) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Vanuatu', 'VUT', 'VU', 'VANUATU', 217, 548) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Dominican Republic', 'DOM', 'DO', 'DOMINICAN REPUBLIC', 56, 214) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mozambique', 'MOZ', 'MZ', 'MOZAMBIQUE', 137, 508) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Portugal', 'PRT', 'PT', 'PORTUGAL', 163, 620) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sudan', 'SDN', 'SD', 'SUDAN', 190, 736) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Venezuela', 'VEN', 'VE', 'VENEZUELA', 218, 862) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ecuador', 'ECU', 'EC', 'ECUADOR', 57, 218) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guinea', 'GIN', 'GN', 'GUINEA', 83, 324) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Myanmar', 'MMR', 'MM', 'MYANMAR', 138, 104) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Puerto Rico', 'PRI', 'PR', 'PUERTO RICO', 164, 630) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Suriname', 'SUR', 'SR', 'SURINAME', 191, 740) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Viet Nam', 'VNM', 'VN', 'VIET NAM', 219, 704) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Egypt', 'EGY', 'EG', 'EGYPT', 58, 818) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guinea-Bissau', 'GNB', 'GW', 'GUINEA-BISSAU', 84, 624) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Namibia', 'NAM', 'NA', 'NAMIBIA', 139, 516) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Qatar', 'QAT', 'QA', 'QATAR', 165, 634) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Svalbard and Jan Mayen', 'SJM', 'SJ', 'SVALBARD AND JAN MAYEN', 192, 744) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('El Salvador', 'SLV', 'SV', 'EL SALVADOR', 59, 222) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Guyana', 'GUY', 'GY', 'GUYANA', 85, 328) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Reunion', 'REU', 'RE', 'REUNION', 166, 638) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Haiti', 'HTI', 'HT', 'HAITI', 86, 332) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Romania', 'ROM', 'RO', 'ROMANIA', 167, 642) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Swaziland', 'SWZ', 'SZ', 'SWAZILAND', 193, 748) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Holy See (Vatican City State)', 'VAT', 'VA', 'HOLY SEE (VATICAN CITY STATE)', 87, 336) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Russian Federation', 'RUS', 'RU', 'RUSSIAN FEDERATION', 168, 643) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sweden', 'SWE', 'SE', 'SWEDEN', 194, 752) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Honduras', 'HND', 'HN', 'HONDURAS', 88, 340) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Rwanda', 'RWA', 'RW', 'RWANDA', 169, 646) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Switzerland', 'CHE', 'CH', 'SWITZERLAND', 195, 756) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Hong Kong', 'HKG', 'HK', 'HONG KONG', 89, 344) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Syrian Arab Republic', 'SYR', 'SY', 'SYRIAN ARAB REPUBLIC', 196, 760) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Taiwan', 'TWN', 'TW', 'TAIWAN, PROVINCE OF CHINA', 197, 158) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tajikistan', 'TJK', 'TJ', 'TAJIKISTAN', 198, 762) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tanzania, United Republic of', 'TZA', 'TZ', 'TANZANIA, UNITED REPUBLIC OF', 199, 834) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Armenia', 'ARM', 'AM', 'ARMENIA', 10, 51) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Aruba', 'ABW', 'AW', 'ARUBA', 11, 533) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Australia', 'AUS', 'AU', 'AUSTRALIA', 12, 36) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Thailand', 'THA', 'TH', 'THAILAND', 200, 764) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Austria', 'AUT', 'AT', 'AUSTRIA', 13, 40) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Madagascar', 'MDG', 'MG', 'MADAGASCAR', 120, 450) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Togo', 'TGO', 'TG', 'TOGO', 201, 768) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Azerbaijan', 'AZE', 'AZ', 'AZERBAIJAN', 14, 31) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Chile', 'CHL', 'CL', 'CHILE', 40, 152) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malawi', 'MWI', 'MW', 'MALAWI', 121, 454) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tokelau', 'TKL', 'TK', 'TOKELAU', 202, 772) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bahamas', 'BHS', 'BS', 'BAHAMAS', 15, 44) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('China', 'CHN', 'CN', 'CHINA', 41, 156) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malaysia', 'MYS', 'MY', 'MALAYSIA', 122, 458) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tonga', 'TON', 'TO', 'TONGA', 203, 776) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bahrain', 'BHR', 'BH', 'BAHRAIN', 16, 48) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Colombia', 'COL', 'CO', 'COLOMBIA', 42, 170) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Maldives', 'MDV', 'MV', 'MALDIVES', 123, 462) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Trinidad and Tobago', 'TTO', 'TT', 'TRINIDAD AND TOBAGO', 204, 780) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bangladesh', 'BGD', 'BD', 'BANGLADESH', 17, 50) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Comoros', 'COM', 'KM', 'COMOROS', 43, 174) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('French Polynesia', 'PYF', 'PF', 'FRENCH POLYNESIA', 70, 258) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mali', 'MLI', 'ML', 'MALI', 124, 466) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Norfolk Island', 'NFK', 'NF', 'NORFOLK ISLAND', 150, 574) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tunisia', 'TUN', 'TN', 'TUNISIA', 205, 788) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Barbados', 'BRB', 'BB', 'BARBADOS', 18, 52) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Congo', 'COG', 'CG', 'CONGO', 44, 178) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gabon', 'GAB', 'GA', 'GABON', 71, 266) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Malta', 'MLT', 'MT', 'MALTA', 125, 470) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Northern Mariana Islands', 'MNP', 'MP', 'NORTHERN MARIANA ISLANDS', 151, 580) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turkey', 'TUR', 'TR', 'TURKEY', 206, 792) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Congo, the Democratic Republic of the', 'COD', 'CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 45, 180) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Marshall Islands', 'MHL', 'MH', 'MARSHALL ISLANDS', 126, 584) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Norway', 'NOR', 'NO', 'NORWAY', 152, 578) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turkmenistan', 'TKM', 'TM', 'TURKMENISTAN', 207, 795) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Belarus', 'BLR', 'BY', 'BELARUS', 19, 112) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cook Islands', 'COK', 'CK', 'COOK ISLANDS', 46, 184) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gambia', 'GMB', 'GM', 'GAMBIA', 72, 270) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Martinique', 'MTQ', 'MQ', 'MARTINIQUE', 127, 474) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Oman', 'OMN', 'OM', 'OMAN', 153, 512) + Fixture Insert (84.6ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Seychelles', 'SYC', 'SC', 'SEYCHELLES', 180, 690) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Turks and Caicos Islands', 'TCA', 'TC', 'TURKS AND CAICOS ISLANDS', 208, 796) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Georgia', 'GEO', 'GE', 'GEORGIA', 73, 268) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mauritania', 'MRT', 'MR', 'MAURITANIA', 128, 478) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Pakistan', 'PAK', 'PK', 'PAKISTAN', 154, 586) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sierra Leone', 'SLE', 'SL', 'SIERRA LEONE', 181, 694) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Tuvalu', 'TUV', 'TV', 'TUVALU', 209, 798) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Costa Rica', 'CRI', 'CR', 'COSTA RICA', 47, 188) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Germany', 'DEU', 'DE', 'GERMANY', 74, 276) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Mauritius', 'MUS', 'MU', 'MAURITIUS', 129, 480) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Palau', 'PLW', 'PW', 'PALAU', 155, 585) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cote D''Ivoire', 'CIV', 'CI', 'COTE D''IVOIRE', 48, 384) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Panama', 'PAN', 'PA', 'PANAMA', 156, 591) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Singapore', 'SGP', 'SG', 'SINGAPORE', 182, 702) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Croatia', 'HRV', 'HR', 'CROATIA', 49, 191) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ghana', 'GHA', 'GH', 'GHANA', 75, 288) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Papua New Guinea', 'PNG', 'PG', 'PAPUA NEW GUINEA', 157, 598) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Slovakia', 'SVK', 'SK', 'SLOVAKIA', 183, 703) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Gibraltar', 'GIB', 'GI', 'GIBRALTAR', 76, 292) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Paraguay', 'PRY', 'PY', 'PARAGUAY', 158, 600) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Slovenia', 'SVN', 'SI', 'SLOVENIA', 184, 705) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Greece', 'GRC', 'GR', 'GREECE', 77, 300) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Peru', 'PER', 'PE', 'PERU', 159, 604) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Solomon Islands', 'SLB', 'SB', 'SOLOMON ISLANDS', 185, 90) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Greenland', 'GRL', 'GL', 'GREENLAND', 78, 304) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Somalia', 'SOM', 'SO', 'SOMALIA', 186, 706) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Grenada', 'GRD', 'GD', 'GRENADA', 79, 308) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('South Africa', 'ZAF', 'ZA', 'SOUTH AFRICA', 187, 710) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Spain', 'ESP', 'ES', 'SPAIN', 188, 724) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Sri Lanka', 'LKA', 'LK', 'SRI LANKA', 189, 144) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Afghanistan', 'AFG', 'AF', 'AFGHANISTAN', 1, 4) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Albania', 'ALB', 'AL', 'ALBANIA', 2, 8) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Algeria', 'DZA', 'DZ', 'ALGERIA', 3, 12) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Latvia', 'LVA', 'LV', 'LATVIA', 110, 428) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('American Samoa', 'ASM', 'AS', 'AMERICAN SAMOA', 4, 16) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Bulgaria', 'BGR', 'BG', 'BULGARIA', 30, 100) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lebanon', 'LBN', 'LB', 'LEBANON', 111, 422) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Andorra', 'AND', 'AD', 'ANDORRA', 5, 20) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Burkina Faso', 'BFA', 'BF', 'BURKINA FASO', 31, 854) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lesotho', 'LSO', 'LS', 'LESOTHO', 112, 426) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Angola', 'AGO', 'AO', 'ANGOLA', 6, 24) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Burundi', 'BDI', 'BI', 'BURUNDI', 32, 108) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Liberia', 'LBR', 'LR', 'LIBERIA', 113, 430) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Virgin Islands, British', 'VGB', 'VG', 'VIRGIN ISLANDS, BRITISH', 220, 92) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Anguilla', 'AIA', 'AI', 'ANGUILLA', 7, 660) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cambodia', 'KHM', 'KH', 'CAMBODIA', 33, 116) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Equatorial Guinea', 'GNQ', 'GQ', 'EQUATORIAL GUINEA', 60, 226) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Libyan Arab Jamahiriya', 'LBY', 'LY', 'LIBYAN ARAB JAMAHIRIYA', 114, 434) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nauru', 'NRU', 'NR', 'NAURU', 140, 520) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Virgin Islands, U.S.', 'VIR', 'VI', 'VIRGIN ISLANDS, U.S.', 221, 850) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Antigua and Barbuda', 'ATG', 'AG', 'ANTIGUA AND BARBUDA', 8, 28) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cameroon', 'CMR', 'CM', 'CAMEROON', 34, 120) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Liechtenstein', 'LIE', 'LI', 'LIECHTENSTEIN', 115, 438) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Nepal', 'NPL', 'NP', 'NEPAL', 141, 524) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Wallis and Futuna', 'WLF', 'WF', 'WALLIS AND FUTUNA', 222, 876) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Western Sahara', 'ESH', 'EH', 'WESTERN SAHARA', 223, 732) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Argentina', 'ARG', 'AR', 'ARGENTINA', 9, 32) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Canada', 'CAN', 'CA', 'CANADA', 35, 124) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Eritrea', 'ERI', 'ER', 'ERITREA', 61, 232) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Lithuania', 'LTU', 'LT', 'LITHUANIA', 116, 440) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Netherlands', 'NLD', 'NL', 'NETHERLANDS', 142, 528) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Yemen', 'YEM', 'YE', 'YEMEN', 224, 887) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cape Verde', 'CPV', 'CV', 'CAPE VERDE', 36, 132) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Estonia', 'EST', 'EE', 'ESTONIA', 62, 233) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Luxembourg', 'LUX', 'LU', 'LUXEMBOURG', 117, 442) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Netherlands Antilles', 'ANT', 'AN', 'NETHERLANDS ANTILLES', 143, 530) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Helena', 'SHN', 'SH', 'SAINT HELENA', 170, 654) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Zambia', 'ZMB', 'ZM', 'ZAMBIA', 225, 894) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Cayman Islands', 'CYM', 'KY', 'CAYMAN ISLANDS', 37, 136) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Ethiopia', 'ETH', 'ET', 'ETHIOPIA', 63, 231) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Hungary', 'HUN', 'HU', 'HUNGARY', 90, 348) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Macao', 'MAC', 'MO', 'MACAO', 118, 446) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('New Caledonia', 'NCL', 'NC', 'NEW CALEDONIA', 144, 540) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Zimbabwe', 'ZWE', 'ZW', 'ZIMBABWE', 226, 716) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Central African Republic', 'CAF', 'CF', 'CENTRAL AFRICAN REPUBLIC', 38, 140) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Falkland Islands (Malvinas)', 'FLK', 'FK', 'FALKLAND ISLANDS (MALVINAS)', 64, 238) + Fixture Insert (0.0ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Iceland', 'ISL', 'IS', 'ICELAND', 91, 352) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Macedonia', 'MKD', 'MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 119, 807) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('New Zealand', 'NZL', 'NZ', 'NEW ZEALAND', 145, 554) + Fixture Insert (0.1ms) INSERT INTO "spree_countries" ("name", "iso3", "iso", "iso_name", "id", "numcode") VALUES ('Saint Kitts and Nevis', 'KNA', 'KN', 'SAINT KITTS AND NEVIS', 171, 659) + Fixture Delete (0.1ms) DELETE FROM "spree_zones" + Fixture Insert (0.1ms) INSERT INTO "spree_zones" ("name", "created_at", "updated_at", "id", "description") VALUES ('EU_VAT', '2009-06-04 17:22:26.000000', '2009-06-04 17:22:26.000000', 1, 'Countries that make up the EU VAT zone.') + Fixture Insert (0.1ms) INSERT INTO "spree_zones" ("name", "created_at", "updated_at", "id", "description") VALUES ('North America', '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'USA + Canada') + Fixture Delete (0.1ms) DELETE FROM "spree_zone_members" + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (162, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 394938353) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (67, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 966149671) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (163, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 91991191) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (167, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 847027202) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (74, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 777453396) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (68, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 244414130) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (183, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 729140670) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (90, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 424792003) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (184, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 477297967) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (96, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 5807739) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (13, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 4914820) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (188, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 35022990) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (98, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 929017584) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (20, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 423866172) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (194, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 890329113) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (110, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 691747661) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (30, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 776249265) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (213, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 739772837) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (116, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 507251676) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (51, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 807406092) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (117, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 120937060) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (52, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 120011419) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (214, '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'Spree::Country', 195044517) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (125, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 808610553) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (53, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 506358563) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (35, '2009-06-04 17:22:41.000000', '2009-06-04 17:22:41.000000', 2, 'Spree::Country', 1017582644) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (142, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 546142054) + Fixture Insert (0.1ms) INSERT INTO "spree_zone_members" ("zoneable_id", "created_at", "updated_at", "zone_id", "zoneable_type", "id") VALUES (62, '2009-06-04 13:22:26.000000', '2009-06-04 13:22:26.000000', 1, 'Spree::Country', 690576312) + Fixture Delete (0.1ms) DELETE FROM "spree_states" + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Michigan', 214, 931624400, 'MI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('South Dakota', 214, 615306087, 'SD') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Washington', 214, 414569975, 'WA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Wisconsin', 214, 103680699, 'WI') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Arizona', 214, 948208802, 'AZ') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Illinois', 214, 625629523, 'IL') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Hampshire', 214, 426832442, 'NH') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('North Carolina', 214, 177087202, 'NC') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Kansas', 214, 969722173, 'KS') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Missouri', 214, 653576146, 'MO') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Arkansas', 214, 471470972, 'AR') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Nevada', 214, 179539703, 'NV') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('District of Columbia', 214, 6764998, 'DC') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Idaho', 214, 982433740, 'ID') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Nebraska', 214, 673350891, 'NE') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Pennsylvania', 214, 471711976, 'PA') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Hawaii', 214, 199950338, 'HI') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Utah', 214, 17199670, 'UT') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Vermont', 214, 989115415, 'VT') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Delaware', 214, 721598219, 'DE') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Rhode Island', 214, 474001862, 'RI') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Oklahoma', 214, 248548169, 'OK') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Louisiana', 214, 37199952, 'LA') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Montana', 214, 999156632, 'MT') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Tennessee', 214, 726305632, 'TN') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Maryland', 214, 480368357, 'MD') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Florida', 214, 267271847, 'FL') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Virginia', 214, 41111624, 'VA') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Minnesota', 214, 1032288924, 'MN') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Jersey', 214, 750950030, 'NJ') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Ohio', 214, 485193526, 'OH') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('California', 214, 276110813, 'CA') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('North Dakota', 214, 51943165, 'ND') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Maine', 214, 1055056709, 'ME') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Indiana', 214, 769938586, 'IN') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Texas', 214, 525212995, 'TX') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Oregon', 214, 298914262, 'OR') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Wyoming', 214, 66390489, 'WY') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Alabama', 214, 1061493585, 'AL') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Iowa', 214, 825306985, 'IA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Mississippi', 214, 532363768, 'MS') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Kentucky', 214, 308473843, 'KY') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New Mexico', 214, 69729944, 'NM') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Georgia', 214, 876916760, 'GA') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Colorado', 214, 536031023, 'CO') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Massachusetts', 214, 385551075, 'MA') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Connecticut', 214, 69870734, 'CT') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('New York', 214, 889445952, 'NY') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('South Carolina', 214, 597434151, 'SC') + Fixture Insert (0.0ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('Alaska', 214, 403740659, 'AK') + Fixture Insert (0.1ms) INSERT INTO "spree_states" ("name", "country_id", "id", "abbr") VALUES ('West Virginia', 214, 91367981, 'WV') + Fixture Delete (0.1ms) DELETE FROM "spree_roles" + Fixture Insert (0.1ms) INSERT INTO "spree_roles" ("name", "id") VALUES ('admin', 930089099) + Fixture Insert (0.0ms) INSERT INTO "spree_roles" ("name", "id") VALUES ('user', 770229923) +  (5.6ms) commit transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::TaxCategory Load (0.1ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + Spree::TaxCategory Exists (0.2ms) SELECT 1 FROM "spree_tax_categories" WHERE ("spree_tax_categories"."name" = 'TaxCategory - 667625' AND "spree_tax_categories"."deleted_at" IS NULL) LIMIT 1 + SQL (0.7ms) INSERT INTO "spree_tax_categories" ("created_at", "deleted_at", "description", "is_default", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["deleted_at", nil], ["description", "Sed illo mollitia et."], ["is_default", false], ["name", "TaxCategory - 667625"], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::ShippingCategory Load (0.1ms) SELECT "spree_shipping_categories".* FROM "spree_shipping_categories" LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + SQL (0.7ms) INSERT INTO "spree_shipping_categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["name", "ShippingCategory #1"], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + Spree::Product Load (0.3ms) SELECT "spree_products".* FROM "spree_products" WHERE (permalink LIKE 'product-number-1-7720%') ORDER BY name ASC, LENGTH(permalink) DESC, permalink DESC LIMIT 1 + Spree::Product Exists (0.1ms) SELECT 1 FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-1-7720' LIMIT 1 + SQL (0.8ms) INSERT INTO "spree_products" ("available_on", "count_on_hand", "created_at", "deleted_at", "description", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["available_on", Thu, 02 May 2013 19:05:18 UTC +00:00], ["count_on_hand", 0], ["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["deleted_at", nil], ["description", "Officia odio eum qui vero quas aperiam vitae veritatis. Est sit dolorem dolor perspiciatis neque et. Nesciunt eum quis et modi. Dicta expedita vel minima aliquid.\nEst iusto aut voluptatem culpa cum ex voluptate corrupti. Eveniet totam numquam dolore dolorum non. Dicta sed optio unde culpa accusantium."], ["meta_description", nil], ["meta_keywords", nil], ["name", "Product #1 - 7720"], ["permalink", "product-number-1-7720"], ["shipping_category_id", 1], ["tax_category_id", 1], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = 1 LIMIT 1 + SQL (0.2ms) UPDATE "spree_products" SET "updated_at" = '2012-05-02 19:05:18.654680' WHERE "spree_products"."id" = 1 + SQL (0.3ms) INSERT INTO "spree_variants" ("cost_price", "count_on_hand", "deleted_at", "depth", "height", "is_master", "position", "price", "product_id", "sku", "weight", "width") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["cost_price", #], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.2ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (0.1ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-1-7720"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-1-7720' LIMIT 1 + Rendered /Users/ryan/Sites/gems/spree/core/app/views/spree/products/show.html.erb within spree/layouts/spree_application (5.1ms) +Completed 200 OK in 118ms (Views: 114.3ms | ActiveRecord: 0.2ms) +  (2.9ms) rollback transaction +  (0.1ms) begin transaction +  (0.1ms) SAVEPOINT active_record_1 +  (0.1ms) RELEASE SAVEPOINT active_record_1 + Spree::TaxCategory Load (0.2ms) SELECT "spree_tax_categories".* FROM "spree_tax_categories" WHERE "spree_tax_categories"."deleted_at" IS NULL LIMIT 1 +  (0.1ms) SAVEPOINT active_record_1 + Spree::TaxCategory Exists (0.1ms) SELECT 1 FROM "spree_tax_categories" WHERE ("spree_tax_categories"."name" = 'TaxCategory - 124293' AND "spree_tax_categories"."deleted_at" IS NULL) LIMIT 1 + SQL (0.5ms) INSERT INTO "spree_tax_categories" ("created_at", "deleted_at", "description", "is_default", "name", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["deleted_at", nil], ["description", "Veniam iusto ex neque nisi ut minima."], ["is_default", false], ["name", "TaxCategory - 124293"], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 + Spree::ShippingCategory Load (0.1ms) SELECT "spree_shipping_categories".* FROM "spree_shipping_categories" LIMIT 1 +  (0.0ms) SAVEPOINT active_record_1 + SQL (0.5ms) INSERT INTO "spree_shipping_categories" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["name", "ShippingCategory #2"], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] +  (0.0ms) RELEASE SAVEPOINT active_record_1 +  (0.0ms) SAVEPOINT active_record_1 + Spree::Product Load (0.3ms) SELECT "spree_products".* FROM "spree_products" WHERE (permalink LIKE 'product-number-2-9180%') ORDER BY name ASC, LENGTH(permalink) DESC, permalink DESC LIMIT 1 + Spree::Product Exists (0.1ms) SELECT 1 FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-9180' LIMIT 1 + SQL (0.5ms) INSERT INTO "spree_products" ("available_on", "count_on_hand", "created_at", "deleted_at", "description", "meta_description", "meta_keywords", "name", "permalink", "shipping_category_id", "tax_category_id", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["available_on", Thu, 02 May 2013 19:05:18 UTC +00:00], ["count_on_hand", 0], ["created_at", Wed, 02 May 2012 19:05:18 UTC +00:00], ["deleted_at", nil], ["description", "Omnis officia eius quo enim ut accusamus et. Recusandae non dolore et dolorem quia quas. Culpa sequi ut error nostrum sunt ea facilis sed. Eaque aut molestias non neque. Ex a modi et voluptatum voluptas qui.\nDeserunt et rerum quo deleniti et voluptate omnis perferendis. Numquam fuga odit facilis sunt id et. Dolorum consequatur est doloribus quam.\nCorporis accusantium fuga sit sequi dolore ut quis. Totam possimus et rerum nam tenetur vel. Iure voluptatem ipsam et quod dolorem sit.\nCupiditate veritatis reiciendis soluta officia. A rerum voluptas est aspernatur illo voluptates dolores qui. Esse est omnis consequuntur voluptates explicabo est qui ut. Modi harum quaerat qui dolor sit laudantium. Aliquid vero omnis incidunt facilis sapiente.\nOmnis cumque eius est atque. Omnis quisquam voluptatem id perspiciatis occaecati aliquid est. Ipsam voluptatem quaerat perferendis sit ipsa. Nisi qui ducimus qui. Suscipit rerum omnis animi corporis natus dolorem rerum qui."], ["meta_description", nil], ["meta_keywords", nil], ["name", "Product #2 - 9180"], ["permalink", "product-number-2-9180"], ["shipping_category_id", 1], ["tax_category_id", 1], ["updated_at", Wed, 02 May 2012 19:05:18 UTC +00:00]] + Spree::Product Load (0.1ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = 1 LIMIT 1 + SQL (0.2ms) UPDATE "spree_products" SET "updated_at" = '2012-05-02 19:05:18.829300' WHERE "spree_products"."id" = 1 + SQL (0.2ms) INSERT INTO "spree_variants" ("cost_price", "count_on_hand", "deleted_at", "depth", "height", "is_master", "position", "price", "product_id", "sku", "weight", "width") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["cost_price", #], ["count_on_hand", 0], ["deleted_at", nil], ["depth", nil], ["height", nil], ["is_master", false], ["position", nil], ["price", #], ["product_id", 1], ["sku", "ABC"], ["weight", nil], ["width", nil]] +  (0.2ms) UPDATE "spree_variants" SET "is_master" = 't' WHERE "spree_variants"."id" = 1 +  (0.1ms) SELECT COUNT(*) FROM "spree_variants" WHERE "spree_variants"."product_id" = 1 AND ("spree_variants".is_master = 'f' AND "spree_variants".deleted_at IS NULL) +  (0.0ms) RELEASE SAVEPOINT active_record_1 +Processing by Spree::ProductsController#show as HTML + Parameters: {"id"=>"product-number-2-9180"} + Spree::Product Load (0.2ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'product-number-2-9180' LIMIT 1 +Completed 404 Not Found in 6ms (Views: 2.8ms | ActiveRecord: 0.2ms) +  (1.5ms) rollback transaction diff --git a/spec/dummy/public/404.html b/spec/dummy/public/404.html new file mode 100644 index 00000000..9a48320a --- /dev/null +++ b/spec/dummy/public/404.html @@ -0,0 +1,26 @@ + + + + The page you were looking for doesn't exist (404) + + + + + +
    +

    The page you were looking for doesn't exist.

    +

    You may have mistyped the address or the page may have moved.

    +
    + + diff --git a/spec/dummy/public/422.html b/spec/dummy/public/422.html new file mode 100644 index 00000000..83660ab1 --- /dev/null +++ b/spec/dummy/public/422.html @@ -0,0 +1,26 @@ + + + + The change you wanted was rejected (422) + + + + + +
    +

    The change you wanted was rejected.

    +

    Maybe you tried to change something you didn't have access to.

    +
    + + diff --git a/spec/dummy/public/500.html b/spec/dummy/public/500.html new file mode 100644 index 00000000..f3648a0d --- /dev/null +++ b/spec/dummy/public/500.html @@ -0,0 +1,25 @@ + + + + We're sorry, but something went wrong (500) + + + + + +
    +

    We're sorry, but something went wrong.

    +
    + + diff --git a/spec/dummy/public/favicon.ico b/spec/dummy/public/favicon.ico new file mode 100644 index 00000000..e69de29b diff --git a/spec/dummy/script/rails b/spec/dummy/script/rails new file mode 100755 index 00000000..f8da2cff --- /dev/null +++ b/spec/dummy/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/spec/dummy/spec/dummy/script/rails b/spec/dummy/spec/dummy/script/rails new file mode 100644 index 00000000..f8da2cff --- /dev/null +++ b/spec/dummy/spec/dummy/script/rails @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/spec/lib/token_resource_spec.rb b/spec/lib/token_resource_spec.rb new file mode 100644 index 00000000..1670ee66 --- /dev/null +++ b/spec/lib/token_resource_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +# Its pretty difficult to test this module in isolation b/c it needs to work in conjunction with an actual class that +# extends ActiveRecord::Base and has a corresponding table in the database. So we'll just test it using Order instead +# since those classes are including the module. +describe Spree::TokenResource do + let(:order) { Spree::Order.new } + let(:permission) { mock_model(Spree::TokenizedPermission) } + + it 'should add has_one :tokenized_permission relationship' do + assert Spree::Order.reflect_on_all_associations(:has_one).map(&:name).include?(:tokenized_permission) + end + + context '#token' do + it 'should return the token of the associated permission' do + order.stub :tokenized_permission => permission + permission.stub :token => 'foo' + order.token.should == 'foo' + end + + it 'should return nil if there is no associated permission' do + order.token.should be_nil + end + end + + context '#create_token' do + it 'should create a randomized 16 character token' do + token = order.create_token + token.size.should == 16 + end + end +end \ No newline at end of file diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb new file mode 100644 index 00000000..7b0a8e84 --- /dev/null +++ b/spec/models/ability_spec.rb @@ -0,0 +1,251 @@ +require 'spec_helper' +require 'bar_ability' +require 'cancan/matchers' + +# Fake ability for testing registration of additional abilities +class FooAbility + include CanCan::Ability + + def initialize(user) + # allow anyone to perform index on Order + can :index, Spree::Order + # allow anyone to update an Order with id of 1 + can :update, Spree::Order do |order| + order.id == 1 + end + end +end + +describe Spree::Ability do + let(:user) { Spree::User.new } + let(:ability) { Spree::Ability.new(user) } + let(:token) { nil } + + TOKEN = 'token123' + + after(:each) { + Spree::Ability.abilities = Set.new + user.roles = [] + } + + context 'register_ability' do + it 'should add the ability to the list of abilties' do + Spree::Ability.register_ability(FooAbility) + Spree::Ability.new(user).abilities.should_not be_empty + end + + it 'should apply the registered abilities permissions' do + Spree::Ability.register_ability(FooAbility) + Spree::Ability.new(user).can?(:update, mock_model(Spree::Order, :id => 1)).should be_true + end + end + + shared_examples_for 'access granted' do + it 'should allow read' do + ability.should be_able_to(:read, resource, token) if token + ability.should be_able_to(:read, resource) unless token + end + + it 'should allow create' do + ability.should be_able_to(:create, resource, token) if token + ability.should be_able_to(:create, resource) unless token + end + + it 'should allow update' do + ability.should be_able_to(:update, resource, token) if token + ability.should be_able_to(:update, resource) unless token + end + end + + shared_examples_for 'access denied' do + it 'should not allow read' do + ability.should_not be_able_to(:read, resource) + end + + it 'should not allow create' do + ability.should_not be_able_to(:create, resource) + end + + it 'should not allow update' do + ability.should_not be_able_to(:update, resource) + end + end + + shared_examples_for 'index allowed' do + it 'should allow index' do + ability.should be_able_to(:index, resource) + end + end + + shared_examples_for 'no index allowed' do + it 'should not allow index' do + ability.should_not be_able_to(:index, resource) + end + end + + shared_examples_for 'create only' do + it 'should allow create' do + ability.should be_able_to(:create, resource) + end + + it 'should not allow read' do + ability.should_not be_able_to(:read, resource) + end + + it 'should not allow update' do + ability.should_not be_able_to(:update, resource) + end + + it 'should not allow index' do + ability.should_not be_able_to(:index, resource) + end + end + + shared_examples_for 'read only' do + it 'should not allow create' do + ability.should_not be_able_to(:create, resource) + end + + it 'should allow read' do + ability.should be_able_to(:read, resource) + end + + it 'should not allow update' do + ability.should_not be_able_to(:update, resource) + end + + it 'should allow index' do + ability.should be_able_to(:index, resource) + end + end + + context 'for general resource' do + let(:resource) { Object.new } + + context 'with admin user' do + before(:each) { user.stub(:has_role?).and_return(true) } + it_should_behave_like 'access granted' + it_should_behave_like 'index allowed' + end + + context 'with customer' do + it_should_behave_like 'access denied' + it_should_behave_like 'no index allowed' + end + end + + context 'for admin protected resources' do + let(:resource) { Object.new } + let(:resource_shipment) { Spree::Shipment.new } + let(:resource_product) { Spree::Product.new } + let(:resource_user) { Spree::User.new } + let(:resource_order) { Spree::Order.new } + let(:fakedispatch_user) { Spree::User.new } + let(:fakedispatch_ability) { Spree::Ability.new(fakedispatch_user) } + + context 'with admin user' do + #before(:each) { user.stub(:has_role?).and_return(true) } + it 'should be able to admin' do + user.roles = [Spree::Role.find_or_create_by_name('admin')] + ability.should be_able_to :admin, resource + ability.should be_able_to :index, resource_order + ability.should be_able_to :show, resource_product + ability.should be_able_to :create, resource_user + end + end + + context 'with fakedispatch user' do + it 'should be able to admin on the order and shipment pages' do + user.roles = [Spree::Role.find_or_create_by_name('bar')] + + Spree::Ability.register_ability(BarAbility) + + ability.should_not be_able_to :admin, resource + + ability.should be_able_to :admin, resource_order + ability.should be_able_to :index, resource_order + ability.should_not be_able_to :update, resource_order + # ability.should_not be_able_to :create, resource_order # Fails + + ability.should be_able_to :admin, resource_shipment + ability.should be_able_to :index, resource_shipment + ability.should be_able_to :create, resource_shipment + + ability.should_not be_able_to :admin, resource_product + ability.should_not be_able_to :update, resource_product + # ability.should_not be_able_to :show, resource_product # Fails + + ability.should_not be_able_to :admin, resource_user + ability.should_not be_able_to :update, resource_user + ability.should be_able_to :update, user + # ability.should_not be_able_to :create, resource_user # Fails + # It can create new users if is has access to the :admin, User!! + + # TODO change the Ability class so only users and customers get the extra premissions? + end + end + + context 'with customer' do + it 'should not be able to admin' do + ability.should_not be_able_to :admin, resource + ability.should_not be_able_to :admin, resource_order + ability.should_not be_able_to :admin, resource_product + ability.should_not be_able_to :admin, resource_user + end + end + end + + context 'for User' do + context 'requested by same user' do + let(:resource) { user } + it_should_behave_like 'access granted' + it_should_behave_like 'no index allowed' + end + context 'requested by other user' do + let(:resource) { Spree::User.new } + it_should_behave_like 'create only' + end + end + + context 'for Order' do + let(:resource) { Spree::Order.new } + + context 'requested by same user' do + before(:each) { resource.user = user } + it_should_behave_like 'access granted' + it_should_behave_like 'no index allowed' + end + + context 'requested by other user' do + before(:each) { resource.user = Spree::User.new } + it_should_behave_like 'create only' + end + + context 'requested with proper token' do + let(:token) { 'TOKEN123' } + before(:each) { resource.stub :token => 'TOKEN123' } + it_should_behave_like 'access granted' + it_should_behave_like 'no index allowed' + end + + context 'requested with inproper token' do + let(:token) { 'FAIL' } + before(:each) { resource.stub :token => 'TOKEN123' } + it_should_behave_like 'create only' + end + end + + context 'for Product' do + let(:resource) { Spree::Product.new } + context 'requested by any user' do + it_should_behave_like 'read only' + end + end + + context 'for Taxons' do + let(:resource) { Spree::Taxon.new } + context 'requested by any user' do + it_should_behave_like 'read only' + end + end +end diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb new file mode 100644 index 00000000..b819c737 --- /dev/null +++ b/spec/models/order_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe Spree::Order do + let(:order) { Spree::Order.new } + + context '#associate_user!' do + let(:user) { mock_model Spree::User, :email => 'spree@example.com', :anonymous? => false } + before { order.stub(:save! => true) } + + it 'should associate the order with the specified user' do + order.associate_user! user + order.user.should == user + end + + it "should set the order's email attribute to that of the specified user" do + order.associate_user! user + order.email.should == user.email + end + + it 'should destroy any previous association with a guest user' do + guest_user = mock_model Spree::User + order.user = guest_user + order.associate_user! user + order.user.should_not == guest_user + end + end + + context 'with bogus email' do + it 'should not be valid' do + order.stub(:new_record? => false) + order.email = 'foo' + order.state = 'address' + order.should_not be_valid + end + end + + context '#create' do + it 'should create a token permission' do + order.save + order.token.should_not be_nil + end + end +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 00000000..487fc89b --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,66 @@ +require 'spec_helper' + +describe Spree::User do + before(:all) { Spree::Role.create :name => 'admin' } + + it 'should generate the reset password token' do + user = build(:user) + Spree::UserMailer.should_receive(:reset_password_instructions).with(user).and_return(double(:deliver => true)) + user.send_reset_password_instructions + user.reset_password_token.should_not be_nil + end + + context '#create' do + let(:user) { build(:user) } + + it 'should not be anonymous' do + user.should_not be_anonymous + end + end + + context '#destroy' do + it 'can not delete if it has completed orders' do + order = build(:order, :completed_at => Time.now) + order.save + user = order.user + + lambda { user.destroy }.should raise_exception(Spree::User::DestroyWithOrdersError) + end + end + + context 'anonymous!' do + let(:user) { Spree::User.anonymous! } + + it 'should create a new user' do + user.new_record?.should be_false + end + + it 'should create a user with an example.net email' do + user.email.should =~ /@example.net$/ + end + + it 'should be anonymous' do + user.should be_anonymous + end + end + + context '#save' do + let(:user) { build(:user) } + + context 'when there are no admin users' do + it 'should assign the user an admin role' do + user.save + user.has_role?('admin').should be_true + end + end + + context 'when there are existing admin users' do + before { create(:admin_user) } + + it 'should not assign the user an admin role' do + user.save + user.has_role?('anonymous?').should be_false + end + end + end +end diff --git a/spec/requests/account_spec.rb b/spec/requests/account_spec.rb new file mode 100644 index 00000000..625c3bce --- /dev/null +++ b/spec/requests/account_spec.rb @@ -0,0 +1,52 @@ +require 'spec_helper' + +describe "Accounts" do + context "editing" do + it "should be able to edit an admin user" do + user = create(:admin_user, :email => "admin@person.com", :password => "password", :password_confirmation => "password") + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + + click_link "My Account" + page.should have_content("admin@person.com") + end + + it "should be able to edit a new user" do + Spree::Auth::Config.set(:signout_after_password_change => false) + visit spree.signup_path + fill_in "Email", :with => "email@person.com" + fill_in "Password", :with => "password" + fill_in "Password Confirmation", :with => "password" + click_button "Create" + + click_link "My Account" + page.should have_content("email@person.com") + click_link "Edit" + fill_in "Password", :with => "foobar" + fill_in "Password Confirmation", :with => "foobar" + click_button "Update" + page.should have_content("email@person.com") + page.should have_content("Account updated!") + end + + it "should be able to edit an existing user account" do + Spree::Auth::Config.set(:signout_after_password_change => false) + user = create(:user, :email => "email@person.com", :password => "secret", :password_confirmation => "secret") + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + + click_link "My Account" + page.should have_content("email@person.com") + click_link "Edit" + fill_in "Password", :with => "foobar" + fill_in "Password Confirmation", :with => "foobar" + click_button "Update" + page.should have_content("email@person.com") + page.should have_content("Account updated!") + end + end +end diff --git a/spec/requests/admin/products_spec.rb b/spec/requests/admin/products_spec.rb new file mode 100644 index 00000000..8a3ac24b --- /dev/null +++ b/spec/requests/admin/products_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' +describe "Admin products" do + context "as anonymous user" do + # regression test for #1250 + it "is redirected to login page when attempting to access product listing" do + lambda { visit spree.admin_products_path }.should_not raise_error + end + end +end diff --git a/spec/requests/admin/users_spec.rb b/spec/requests/admin/users_spec.rb new file mode 100644 index 00000000..26b877f7 --- /dev/null +++ b/spec/requests/admin/users_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe 'Users' do + before do + user = create(:admin_user, :email => "c@example.com") + sign_in_as!(user) + visit spree.admin_users_path + end + + context "editing own user" do + it "should let me edit own password" do + click_link("c@example.com") + click_link("Edit") + fill_in "user_password", :with => "welcome" + fill_in "user_password_confirmation", :with => "welcome" + click_button "Update" + + page.should have_content("successfully updated!") + end + end +end diff --git a/spec/requests/admin_permissions_spec.rb b/spec/requests/admin_permissions_spec.rb new file mode 100644 index 00000000..5dcd61d4 --- /dev/null +++ b/spec/requests/admin_permissions_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe "Admin Permissions" do + context "admin is restricted from accessing orders" do + before(:each) do + user = create(:admin_user, :email => "admin@person.com", :password => "password", :password_confirmation => "password") + Spree::Ability.register_ability(AbilityDecorator) + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + end + + it "should not be able to list orders" do + visit spree.admin_orders_path + page.should have_content("Authorization Failure") + end + + it "should not be able to edit orders" do + create(:order, :number => "R123") + visit spree.edit_admin_order_path("R123") + page.should have_content("Authorization Failure") + end + + it "should not be able to view an order" do + create(:order, :number => "R123") + visit spree.admin_order_path("R123") + page.should have_content("Authorization Failure") + end + end +end diff --git a/spec/requests/checkout_spec.rb b/spec/requests/checkout_spec.rb new file mode 100644 index 00000000..151cee01 --- /dev/null +++ b/spec/requests/checkout_spec.rb @@ -0,0 +1,313 @@ +require 'spec_helper' + +describe "Checkout", :js => true do + before(:each) do + PAYMENT_STATES = Spree::Payment.state_machine.states.keys unless defined? PAYMENT_STATES + SHIPMENT_STATES = Spree::Shipment.state_machine.states.keys unless defined? SHIPMENT_STATES + ORDER_STATES = Spree::Order.state_machine.states.keys unless defined? ORDER_STATES + sm = create(:shipping_method, :zone => Spree::Zone.find_by_name('North America')) + sm.calculator.set_preference(:amount, 10) + + create(:payment_method, :environment => 'test') + create(:product, :name => "RoR Mug") + visit spree.root_path + end + + let!(:address) { create(:address, :state => Spree::State.first) } + + it "should allow a visitor to checkout as guest, without registration" do + Spree::Auth::Config.set(:registration_step => true) + click_link "RoR Mug" + click_button "Add To Cart" + within('h1') { page.should have_content("Shopping Cart") } + click_link "Checkout" + page.should have_content("Checkout as a Guest") + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + page.should have_content("Billing Address") + page.should have_content("Shipping Address") + + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("Your order has been processed successfully") + end + + it "should associate an uncompleted guest order with user after logging in" do + user = create(:user, :email => "email@person.com", :password => "password", :password_confirmation => "password") + click_link "RoR Mug" + click_button "Add To Cart" + Spree::User.count.should == 2 + + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + + click_link "Cart" + page.should have_content("RoR Mug") + within('h1') { page.should have_content("Shopping Cart") } + + click_link "Checkout" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("Your order has been processed successfully") + Spree::Order.count.should == 1 + end + + # Regression test for #890 + it "should associate an incomplete guest order with user after successful password reset" do + user = create(:user, :email => "email@person.com", :password => "password", :password_confirmation => "password") + click_link "RoR Mug" + click_button "Add To Cart" + + visit spree.login_path + click_link "Forgot Password?" + fill_in "Email", :with => "email@person.com" + click_button "Reset my password" + + user.reload + + visit spree.edit_user_password_path(:reset_password_token => user.reset_password_token) + fill_in "Password", :with => "password" + fill_in "Password Confirmation", :with => "password" + click_button "Update my password and log me in" + + click_link "Cart" + click_link "Checkout" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + page.should_not have_content("Email is invalid") + end + + it "should allow a user to register during checkout" do + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + page.should have_content("Registration") + click_link "Create a new account" + + fill_in "Email", :with => "email@person.com" + fill_in "Password", :with => "spree123" + fill_in "Password Confirmation", :with => "spree123" + click_button "Create" + page.should have_content("You have signed up successfully.") + + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("Your order has been processed successfully") + Spree::Order.count.should == 1 + end + + it "the current payment method does not support profiles" do + create(:authorize_net_payment_method, :environment => 'test') + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + choose('Credit Card') + fill_in "card_number", :with => "4111111111111111" + fill_in "card_code", :with => "123" + click_button "Save and Continue" + page.should_not have_content("Confirm") + end + + it "when no shipping methods have been configured" do + Spree::ShippingMethod.delete_all + + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + page.should have_content("No shipping methods available") + end + + it "when no payment methods have been configured" do + Spree::PaymentMethod.delete_all + + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within("#guest_checkout") { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("No payment methods are configured for this environment") + end + + it "user submits an invalid credit card number" do + create(:bogus_payment_method, :environment => 'test') + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + choose('Credit Card') + fill_in "card_number", :with => "1234567890" + fill_in "card_code", :with => "000" + click_button "Save and Continue" + click_button "Place Order" + page.should have_content("Payment could not be processed") + end + + it "completing checkout for a free order, skipping payment step" do + create(:free_shipping_method, :zone => Spree::Zone.find_by_name('North America')) + create(:payment_method, :environment => 'test') + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("Your order has been processed successfully") + end + + it "completing checkout with an invalid address input initially" do + create(:bogus_payment_method, :environment => 'test') + click_link "RoR Mug" + click_button "Add To Cart" + click_link "Checkout" + + within('#guest_checkout') { fill_in "Email", :with => "spree@test.com" } + click_button "Continue" + page.should have_content("Shipping Address") + page.should have_content("Billing Address") + + fill_in "First Name", :with => "Test" + click_button "Save and Continue" + page.should have_content("This field is required") + + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}" + end + select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + page.should have_content("Shipping Method") + end + + it "changing country to different zone during checkout should reset shipments" do + eu_vat_zone = Spree::Zone.find_by_name("EU_VAT") + italy = create(:country, :iso_name => "ITALY", :iso => "IT", :iso3 => "ITA", :name => "Italy", :zone => eu_vat_zone) + ita_address = create(:address, :country => italy, :state_name => "Roma") + eu_shipping = create(:shipping_method, :name => "EU", :zone => eu_vat_zone) + # TODO: Figure why calculator after_create is not firing to set this + eu_shipping.calculator.set_preference(:amount, 20) + user = create(:user, :email => "email@person.com", :password => "password", :password_confirmation => "password") + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + click_link "RoR Mug" + click_button "Add To Cart" + + page.should have_content("RoR Mug") + within('h1') { page.should have_content("Shopping Cart") } + + click_link "Checkout" + + str_addr = "bill_address" + select "United States", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{ita_address.send(field)}" + end + select "Alabama", :from => "order_#{str_addr}_attributes_state_id" + check "order_use_billing" + click_button "Save and Continue" + click_button "Save and Continue" + page.should have_content("Shipping: $10.00") + click_link "Address" + + select "Italy", :from => "order_#{str_addr}_attributes_country_id" + ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field| + fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{ita_address.send(field)}" + end + fill_in "order_#{str_addr}_attributes_state_name", :with => "#{ita_address.state_name}" + check "order_use_billing" + click_button "Save and Continue" + choose "EU $20.00" + click_button "Save and Continue" + page.should have_content("Shipping: $20.00") + end +end diff --git a/spec/requests/order_spec.rb b/spec/requests/order_spec.rb new file mode 100644 index 00000000..0974c756 --- /dev/null +++ b/spec/requests/order_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe "Orders" do + it "should allow a user to view their cart at any time" do + visit spree.cart_path + page.should have_content("Your cart is empty") + end +end diff --git a/spec/requests/password_reset_spec.rb b/spec/requests/password_reset_spec.rb new file mode 100644 index 00000000..a94ce32f --- /dev/null +++ b/spec/requests/password_reset_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "Reset Password" do + it "should allow the user to indicate they have forgotten their password" do + visit spree.login_path + click_link "Forgot Password?" + page.should have_content("your password will be emailed to you") + end + + it "should allow a user to supply an email for the password reset" do + user = create(:user, :email => "foobar@example.com", :password => "secret", :password_confirmation => "secret") + visit spree.login_path + click_link "Forgot Password?" + fill_in "user_email", :with => "foobar@example.com" + click_button "Reset my password" + page.should have_content("You will receive an email with instructions") + end +end diff --git a/spec/requests/sign_in_spec.rb b/spec/requests/sign_in_spec.rb new file mode 100644 index 00000000..2185bfb2 --- /dev/null +++ b/spec/requests/sign_in_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +describe "Sign In" do + before(:each) do + @user = create(:user, :email => "email@person.com", :password => "secret", :password_confirmation => "secret") + visit spree.login_path + end + + it "should ask use to sign in" do + visit spree.admin_path + page.should_not have_content("Authorization Failure") + end + + it "should let a user sign in successfully" do + fill_in "user_email", :with => @user.email + fill_in "user_password", :with => @user.password + click_button "Login" + page.should have_content("Logged in successfully") + page.should_not have_content("Login") + page.should have_content("Logout") + current_path.should == "/products" + end + + it "should show validation erros" do + fill_in "user_email", :with => @user.email + fill_in "user_password", :with => "wrong_password" + click_button "Login" + page.should have_content("Invalid email or password") + page.should have_content("Login") + end + + it "should allow a user to access a restricted page after logging in" do + user = create(:admin_user, :email => "admin@person.com", :password => "password", :password_confirmation => "password") + visit spree.admin_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + page.should have_content("Logged in successfully") + current_path.should == "/admin" + end +end diff --git a/spec/requests/sign_out_spec.rb b/spec/requests/sign_out_spec.rb new file mode 100644 index 00000000..04df2c81 --- /dev/null +++ b/spec/requests/sign_out_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe "Sign Out" do + let!(:user) do + create(:user, + :email => "email@person.com", + :password => "secret", + :password_confirmation => "secret") + end + + before do + visit spree.login_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + # Regression test for #1257 + check "Remember me" + click_button "Login" + end + + it "should allow a signed in user to logout" do + click_link "Logout" + visit spree.root_path + page.should have_content("Login") + page.should_not have_content("Logout") + end +end diff --git a/spec/requests/sign_up_spec.rb b/spec/requests/sign_up_spec.rb new file mode 100644 index 00000000..96c92bf9 --- /dev/null +++ b/spec/requests/sign_up_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe "Sign Up" do + context "with valid data" do + it "should create a new user" do + visit spree.signup_path + fill_in "Email", :with => "email@person.com" + fill_in "Password", :with => "password" + fill_in "Password Confirmation", :with => "password" + click_button "Create" + page.should have_content("You have signed up successfully.") + Spree::User.count.should == 1 + end + end + + context "with invalid data" do + it "should not create a new user" do + visit spree.signup_path + fill_in "Email", :with => "email@person.com" + fill_in "Password", :with => "password" + fill_in "Password Confirmation", :with => "" + click_button "Create" + page.should have_css("#errorExplanation") + Spree::User.count.should == 0 + end + end +end diff --git a/spec/requests/user_spec.rb b/spec/requests/user_spec.rb new file mode 100644 index 00000000..022498e7 --- /dev/null +++ b/spec/requests/user_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' + +describe "Users" do + before(:each) do + user = create(:admin_user, :email => "admin@person.com", :password => "password", :password_confirmation => "password") + visit spree.admin_path + fill_in "user_email", :with => user.email + fill_in "user_password", :with => user.password + click_button "Login" + click_link "Users" + within('table#listing_users td.user_email') { click_link "admin@person.com" } + click_link "Edit" + page.should have_content("Editing User") + end + + it "admin editing email with validation error" do + fill_in "user_email", :with => "a" + click_button "Update" + page.should have_content("Email is invalid") + end + + it "admin editing roles" do + check "user_role_user" + click_button "Update" + page.should have_content("User has been successfully updated!") + within('table#listing_users') { click_link "Edit" } + find_field('user_role_user')['checked'].should be_true + end + + it "listing users when anonymous users are present" do + Spree::User.anonymous! + click_link "Users" + page.should_not have_content("@example.net") + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 00000000..e99220f3 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,66 @@ +# This file is copied to ~/spec when you run 'ruby script/generate rspec' +# from the project root directory. +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../dummy/config/environment', __FILE__) +require 'rspec/rails' +require 'database_cleaner' +require 'spree/core/url_helpers' + +# Requires supporting files with custom matchers and macros, etc, +# in ./support/ and its subdirectories. +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} + +require 'spree/core/testing_support/fixtures' +require 'spree/core/testing_support/factories' +require 'spree/core/testing_support/env' +require 'spree/core/testing_support/controller_requests' + +RSpec.configure do |config| + # == Mock Framework + # + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: + # + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + config.mock_with :rspec + + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, comment the following line or assign false + # instead of true. + config.use_transactional_fixtures = false + config.before(:each) do + if example.metadata[:js] + DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_zones', 'spree_zone_members', 'spree_states', 'spree_roles'] } + else + DatabaseCleaner.strategy = :transaction + end + end + + config.before(:each) do + DatabaseCleaner.start + end + + config.after(:each) do + DatabaseCleaner.clean + Spree::Ability.abilities.delete(AbilityDecorator) if Spree::Ability.abilities.include?(AbilityDecorator) + end + + config.include FactoryGirl::Syntax::Methods + config.include Spree::Core::UrlHelpers + config.include Spree::Core::TestingSupport::ControllerRequests, :type => :controller + config.include Devise::TestHelpers, :type => :controller + config.include Rack::Test::Methods, :type => :requests +end + +if defined? CanCan::Ability + class AbilityDecorator + include CanCan::Ability + + def initialize(user) + cannot :manage, Spree::Order + end + end +end diff --git a/spec/support/authentication_helpers.rb b/spec/support/authentication_helpers.rb new file mode 100644 index 00000000..2de8eb32 --- /dev/null +++ b/spec/support/authentication_helpers.rb @@ -0,0 +1,13 @@ +module AuthenticationHelpers + def sign_in_as!(user) + visit '/login' + fill_in 'Email', :with => user.email + fill_in 'Password', :with => 'secret' + click_button 'Login' + end + +end + +RSpec.configure do |c| + c.include AuthenticationHelpers, :type => :request +end diff --git a/spree_auth_devise.gemspec b/spree_auth_devise.gemspec new file mode 100644 index 00000000..81c93440 --- /dev/null +++ b/spree_auth_devise.gemspec @@ -0,0 +1,22 @@ +# encoding: UTF-8 + +Gem::Specification.new do |s| + s.platform = Gem::Platform::RUBY + s.name = 'spree_auth_devise' + s.version = '1.0.0' + s.summary = 'Provides authentication and authorization services for use with Spree by using Devise and CanCan.' + s.description = 'Required dependency for Spree' + + s.required_ruby_version = '>= 1.8.7' + s.author = 'Sean Schofield' + s.email = 'sean@spreecommerce.com' + s.homepage = 'http://spreecommerce.com' + + s.files = Dir['LICENSE', 'README.md', 'app/**/*', 'config/**/*', 'lib/**/*', 'db/**/*'] + s.require_path = 'lib' + s.requirements << 'none' + + s.add_dependency 'spree_core' + s.add_dependency 'devise', '~> 2.0' + s.add_dependency 'cancan', '= 1.6.7' +end