raffle_v1 0.0.5 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/Rakefile +3 -9
- data/app/assets/javascripts/raffle_v1/application.js +6 -5
- data/app/assets/stylesheets/raffle_v1/application.css.scss +4 -31
- data/app/assets/stylesheets/raffle_v1/framework_and_overrides.css.scss +422 -0
- data/app/controllers/raffle_v1/admin/base_controller.rb +11 -0
- data/app/controllers/raffle_v1/admin/users_controller.rb +69 -0
- data/app/controllers/raffle_v1/application_controller.rb +51 -78
- data/app/controllers/raffle_v1/pages_controller.rb +11 -178
- data/app/helpers/raffle_v1/application_helper.rb +5 -0
- data/app/models/raffle_v1/user.rb +61 -107
- data/app/views/layouts/raffle_v1/application.html.erb +28 -5
- data/app/views/raffle_v1/admin/base/index.html.erb +39 -0
- data/app/views/raffle_v1/admin/users/edit.html.erb +65 -0
- data/app/views/raffle_v1/admin/users/index.html.erb +55 -0
- data/app/views/raffle_v1/devise/confirmations/new.html.erb +31 -0
- data/app/views/raffle_v1/devise/mailer/confirmation_instructions.html.erb +12 -0
- data/app/views/raffle_v1/devise/mailer/reset_password_instructions.html.erb +15 -0
- data/app/views/raffle_v1/devise/passwords/edit.html.erb +43 -0
- data/app/views/raffle_v1/devise/passwords/new.html.erb +31 -0
- data/app/views/raffle_v1/devise/registrations/edit.html.erb +63 -0
- data/app/views/raffle_v1/devise/registrations/new.html.erb +58 -0
- data/app/views/raffle_v1/devise/sessions/new.html.erb +45 -0
- data/app/views/raffle_v1/devise/shared/_links.erb +29 -0
- data/app/views/raffle_v1/layouts/_footer.html.erb +17 -0
- data/app/views/raffle_v1/layouts/_messages.html.erb +9 -0
- data/app/views/raffle_v1/layouts/_navigation.html.erb +18 -0
- data/app/views/raffle_v1/layouts/_navigation_links.html.erb +13 -0
- data/app/views/raffle_v1/layouts/application.html.erb +37 -0
- data/app/views/raffle_v1/pages/home.html.erb +3 -0
- data/app/views/raffle_v1/pages/inside.html.erb +3 -0
- data/config/add_files/date_format.rb +27 -0
- data/config/add_files/devise.rb +267 -0
- data/config/add_files/filter_parameter_logging.rb +4 -0
- data/config/add_files/friendly_id.rb +88 -0
- data/config/add_files/kaminari_config.rb +10 -0
- data/config/add_files/rafflev1.rb +4 -0
- data/config/initializers/rafflev1.rb +1 -6
- data/config/locales/devise.en.yml +59 -0
- data/config/routes.rb +30 -5
- data/db/migrate/20130123214645_devise_create_raffle_v1_users.rb +56 -0
- data/db/migrate/{20130123214645_devise_create_users.rb → 20130124004626_devise_create_raffle_v1_admins.rb} +7 -7
- data/db/migrate/{20130124231541_create_versions.rb → 20130124231541_create_raffle_v1_versions.rb} +5 -5
- data/db/migrate/20140719165853_create_raffle_v1_friendly_id_slugs.rb +15 -0
- data/db/seeds.rb +24 -77
- data/lib/generators/raffle_v1/install/install_generator.rb +142 -54
- data/lib/generators/raffle_v1/install/templates/assets/images/raffle_v1/game.png +0 -0
- data/lib/generators/raffle_v1/install/templates/assets/images/raffle_v1/gift.png +0 -0
- data/lib/generators/raffle_v1/install/templates/assets/images/raffle_v1/lifesaver.png +0 -0
- data/lib/generators/raffle_v1/install/templates/assets/images/raffle_v1/person01.jpg +0 -0
- data/lib/generators/raffle_v1/install/templates/assets/javascripts/raffle_v1/application.js +17 -0
- data/lib/generators/raffle_v1/install/templates/assets/stylesheets/raffle_v1/application.css.scss +7 -0
- data/lib/generators/raffle_v1/install/templates/assets/stylesheets/raffle_v1/framework_and_overrides.css.scss +422 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/date_format.rb +27 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/devise.rb +269 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/filter_parameter_logging.rb +4 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/friendly_id.rb +89 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/kaminari_config.rb +11 -0
- data/lib/generators/raffle_v1/install/templates/config/initializers/rafflev1.rb +4 -0
- data/lib/generators/raffle_v1/install/templates/db/seeds.rb +28 -0
- data/lib/raffle_v1/version.rb +2 -2
- data/test/controllers/raffle_v1/locales_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/page_layouts_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/pages_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/program_locales_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/program_settings_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/programs_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/role_users_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/roles_controller_test.rb +51 -0
- data/test/controllers/raffle_v1/style_sheets_controller_test.rb +51 -0
- data/test/dummy/Guardfile +24 -0
- data/test/dummy/README.rdoc +15 -248
- data/test/dummy/Rakefile +1 -2
- data/test/dummy/app/assets/javascripts/application.js +3 -5
- data/test/dummy/app/assets/stylesheets/application.css +5 -3
- data/test/dummy/app/controllers/application_controller.rb +3 -1
- data/test/dummy/app/models/user.rb +4 -0
- data/test/dummy/app/views/layouts/application.html.erb +2 -2
- data/test/dummy/assets/javascripts/application.js +17 -0
- data/test/dummy/assets/stylesheets/application.css.scss +7 -0
- data/test/dummy/assets/stylesheets/framework_and_overrides.css.scss +422 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +1 -1
- data/test/dummy/config/application.rb +29 -47
- data/test/dummy/config/boot.rb +4 -9
- data/test/dummy/config/database.yml +48 -13
- data/test/dummy/config/environment.rb +3 -3
- data/test/dummy/config/environments/development.rb +19 -19
- data/test/dummy/config/environments/production.rb +44 -28
- data/test/dummy/config/environments/test.rb +17 -15
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/date_format.rb +27 -0
- data/test/dummy/config/initializers/devise.rb +269 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/friendly_id.rb +89 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/kaminari_config.rb +11 -0
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/rafflev1.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +1 -6
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/test/dummy/config/locales/en.yml +20 -2
- data/{lib/database_cleaner-0.7.2/examples/db/sqlite_databases_go_here → test/dummy/config/rafflev1.yml} +0 -0
- data/test/dummy/config/routes.rb +3 -1
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/migrate/20140719173448_devise_create_raffle_v1_users.raffle_v1.rb +57 -0
- data/{db/migrate/20130124004626_devise_create_admins.rb → test/dummy/db/migrate/20140719173449_devise_create_raffle_v1_admins.raffle_v1.rb} +8 -7
- data/test/dummy/db/migrate/20140719173450_create_raffle_v1_versions.raffle_v1.rb +19 -0
- data/test/dummy/db/migrate/20140719173451_create_raffle_v1_friendly_id_slugs.raffle_v1.rb +16 -0
- data/test/dummy/db/schema.rb +72 -12
- data/test/dummy/db/seeds.rb +30 -0
- data/test/dummy/public/404.html +54 -13
- data/test/dummy/public/422.html +54 -13
- data/test/dummy/public/500.html +53 -12
- data/test/dummy/spec/factories.rb +5 -0
- data/test/dummy/spec/models/user_spec.rb +5 -0
- data/test/dummy/spec/rails_helper.rb +66 -0
- data/test/dummy/spec/spec_helper.rb +78 -0
- data/test/dummy/test/factories/users.rb +6 -0
- data/test/dummy/vendor/assets/javascripts/all_file.js +0 -0
- data/test/dummy/vendor/assets/javascripts/all_raffle_v1.js +7 -0
- data/test/dummy/vendor/assets/stylesheets/all_file.css +0 -0
- data/test/dummy/vendor/assets/stylesheets/all_raffle_v1.css +9 -0
- data/test/fixtures/raffle_v1/abilities.yml +11 -0
- data/test/fixtures/raffle_v1/add_name_to_users.yml +11 -0
- data/test/fixtures/raffle_v1/admin_abilities.yml +11 -0
- data/test/fixtures/raffle_v1/admins.yml +11 -0
- data/test/fixtures/raffle_v1/locales.yml +9 -0
- data/test/fixtures/raffle_v1/page_layouts.yml +11 -0
- data/test/fixtures/raffle_v1/pages.yml +41 -0
- data/test/fixtures/raffle_v1/program_locales.yml +9 -0
- data/test/fixtures/raffle_v1/program_settings.yml +7 -0
- data/test/fixtures/raffle_v1/programs.yml +23 -0
- data/test/fixtures/raffle_v1/role_users.yml +9 -0
- data/test/fixtures/raffle_v1/roles.yml +7 -0
- data/test/fixtures/raffle_v1/style_sheets.yml +17 -0
- data/test/fixtures/raffle_v1/stylesheets.yml +11 -0
- data/test/fixtures/raffle_v1/terms_and_conditions.yml +11 -0
- data/test/fixtures/raffle_v1/testers.yml +11 -0
- data/test/fixtures/raffle_v1/translation_keys.yml +11 -0
- data/test/fixtures/raffle_v1/translation_objects.yml +11 -0
- data/test/fixtures/raffle_v1/translations.yml +11 -0
- data/test/fixtures/raffle_v1/users.yml +11 -0
- data/test/helpers/raffle_v1/locales_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/page_layouts_helper_test.rb +6 -0
- data/test/{unit/helpers/raffle_v1/posts_helper_test.rb → helpers/raffle_v1/pages_helper_test.rb} +1 -1
- data/test/helpers/raffle_v1/program_locales_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/program_settings_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/programs_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/role_users_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/roles_helper_test.rb +6 -0
- data/test/helpers/raffle_v1/style_sheets_helper_test.rb +6 -0
- data/test/{unit/raffle_v1/comment_test.rb → models/raffle_v1/ability_test.rb} +1 -1
- data/test/{functional/raffle_v1/comments_controller_test.rb → models/raffle_v1/add_name_to_user_test.rb} +1 -1
- data/test/models/raffle_v1/admin_ability_test.rb +9 -0
- data/test/models/raffle_v1/admin_test.rb +9 -0
- data/test/models/raffle_v1/locale_test.rb +9 -0
- data/test/models/raffle_v1/page_layout_test.rb +9 -0
- data/test/{unit/raffle_v1/post_test.rb → models/raffle_v1/page_test.rb} +1 -1
- data/test/models/raffle_v1/program_locale_test.rb +9 -0
- data/test/models/raffle_v1/program_setting_test.rb +9 -0
- data/test/models/raffle_v1/program_test.rb +9 -0
- data/test/models/raffle_v1/role_test.rb +9 -0
- data/test/models/raffle_v1/role_user_test.rb +9 -0
- data/test/models/raffle_v1/style_sheet_test.rb +9 -0
- data/test/models/raffle_v1/stylesheet_test.rb +9 -0
- data/test/models/raffle_v1/terms_and_condition_test.rb +9 -0
- data/test/models/raffle_v1/tester_test.rb +9 -0
- data/test/models/raffle_v1/translation_key_test.rb +9 -0
- data/test/models/raffle_v1/translation_object_test.rb +9 -0
- data/test/models/raffle_v1/translation_test.rb +9 -0
- data/test/models/raffle_v1/user_test.rb +9 -0
- metadata +409 -278
- data/README.md +0 -53
- data/app/assets/javascripts/raffle_v1/comments.js +0 -2
- data/app/assets/javascripts/raffle_v1/home.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/locales.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/page_layouts.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/pages.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/posts.js +0 -2
- data/app/assets/javascripts/raffle_v1/programs.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/roles.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/stylesheets.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/terms_and_conditions.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/terms_of_conditions.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/translation_keys.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/translation_objects.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/user.js.coffee +0 -3
- data/app/assets/javascripts/raffle_v1/versions.js.coffee +0 -3
- data/app/assets/stylesheets/raffle_v1/TableTools.css +0 -264
- data/app/assets/stylesheets/raffle_v1/TableTools.css.scss +0 -264
- data/app/assets/stylesheets/raffle_v1/TableTools_JUI.css +0 -182
- data/app/assets/stylesheets/raffle_v1/TableTools_JUI.css.scss +0 -183
- data/app/assets/stylesheets/raffle_v1/_custom.css.scss +0 -3310
- data/app/assets/stylesheets/raffle_v1/_variable.scss +0 -122
- data/app/assets/stylesheets/raffle_v1/_variable_defaults.scss +0 -83
- data/app/assets/stylesheets/raffle_v1/application.css +0 -13
- data/app/assets/stylesheets/raffle_v1/application.css.scss.erb +0 -32
- data/app/assets/stylesheets/raffle_v1/bootstrap-responsive.css +0 -570
- data/app/assets/stylesheets/raffle_v1/bootstrap-responsive.css.scss +0 -570
- data/app/assets/stylesheets/raffle_v1/bootstrap.css +0 -4226
- data/app/assets/stylesheets/raffle_v1/bootstrap.css.scss +0 -4226
- data/app/assets/stylesheets/raffle_v1/colorbox.css +0 -88
- data/app/assets/stylesheets/raffle_v1/colorbox.css.scss +0 -88
- data/app/assets/stylesheets/raffle_v1/comments.css +0 -4
- data/app/assets/stylesheets/raffle_v1/grid.css.scss +0 -258
- data/app/assets/stylesheets/raffle_v1/hierarchy.css.scss +0 -16
- data/app/assets/stylesheets/raffle_v1/home.css.scss +0 -18
- data/app/assets/stylesheets/raffle_v1/jquery.dataTables.css +0 -83
- data/app/assets/stylesheets/raffle_v1/jquery.dataTables.css.scss +0 -83
- data/app/assets/stylesheets/raffle_v1/jquery.jcarousel.css +0 -206
- data/app/assets/stylesheets/raffle_v1/jquery.wysiwyg.css +0 -57
- data/app/assets/stylesheets/raffle_v1/jquery.wysiwyg.css.scss +0 -57
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.core.css +0 -38
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.core.css.scss +0 -38
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.dialog.css +0 -21
- data/app/assets/stylesheets/raffle_v1/jqueryui/jquery.ui.dialog.css.scss +0 -21
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/jquery-ui-1.8.18.custom.css +0 -563
- data/app/assets/stylesheets/raffle_v1/jqueryui/ui-lightness/jquery-ui-1.8.18.custom.css.scss +0 -563
- data/app/assets/stylesheets/raffle_v1/locales.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/page_layouts.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/pages.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/posts.css +0 -4
- data/app/assets/stylesheets/raffle_v1/programs.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/reset.css.scss +0 -96
- data/app/assets/stylesheets/raffle_v1/roles.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/scaffolds.css.scss +0 -42
- data/app/assets/stylesheets/raffle_v1/stylesheets.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/terms_and_conditions.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/terms_of_conditions.css.scss +0 -4
- data/app/assets/stylesheets/raffle_v1/translation_keys.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/translation_objects.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/ui.multiselect.css +0 -33
- data/app/assets/stylesheets/raffle_v1/ui.multiselect.css.scss +0 -33
- data/app/assets/stylesheets/raffle_v1/user.css.scss +0 -3
- data/app/assets/stylesheets/raffle_v1/versions.css.scss +0 -3
- data/app/assets/stylesheets/scaffold.css +0 -56
- data/app/controllers/raffle_v1/comments_controller.rb +0 -30
- data/app/controllers/raffle_v1/home_controller.rb +0 -15
- data/app/controllers/raffle_v1/locales_controller.rb +0 -87
- data/app/controllers/raffle_v1/page_layouts_controller.rb +0 -87
- data/app/controllers/raffle_v1/posts_controller.rb +0 -87
- data/app/controllers/raffle_v1/programs_controller.rb +0 -140
- data/app/controllers/raffle_v1/roles_controller.rb +0 -87
- data/app/controllers/raffle_v1/stylesheets_controller.rb +0 -19
- data/app/controllers/raffle_v1/terms_and_conditions_controller.rb +0 -118
- data/app/controllers/raffle_v1/translation_keys_controller.rb +0 -119
- data/app/controllers/raffle_v1/translation_objects_controller.rb +0 -87
- data/app/controllers/raffle_v1/user_controller.rb +0 -138
- data/app/controllers/raffle_v1/versions_controller.rb +0 -15
- data/app/helpers/raffle_v1/comments_helper.rb +0 -4
- data/app/helpers/raffle_v1/posts_helper.rb +0 -4
- data/app/models/raffle_v1/ability.rb +0 -30
- data/app/models/raffle_v1/admin.rb +0 -35
- data/app/models/raffle_v1/admin_ability.rb +0 -28
- data/app/models/raffle_v1/comment.rb +0 -7
- data/app/models/raffle_v1/locale.rb +0 -29
- data/app/models/raffle_v1/page.rb +0 -26
- data/app/models/raffle_v1/page_layout.rb +0 -6
- data/app/models/raffle_v1/post.rb +0 -7
- data/app/models/raffle_v1/program.rb +0 -84
- data/app/models/raffle_v1/program_locale.rb +0 -11
- data/app/models/raffle_v1/program_setting.rb +0 -5
- data/app/models/raffle_v1/role.rb +0 -5
- data/app/models/raffle_v1/roles_users.rb +0 -5
- data/app/models/raffle_v1/stylesheet.rb +0 -9
- data/app/models/raffle_v1/terms_and_condition.rb +0 -17
- data/app/models/raffle_v1/translation.rb +0 -29
- data/app/models/raffle_v1/translation_key.rb +0 -35
- data/app/models/raffle_v1/translation_object.rb +0 -11
- data/app/views/raffle_v1/comments/_comment.html.erb +0 -1
- data/app/views/raffle_v1/comments/_form.html.erb +0 -8
- data/app/views/raffle_v1/comments/index.html.erb +0 -13
- data/app/views/raffle_v1/posts/_form.html.erb +0 -25
- data/app/views/raffle_v1/posts/edit.html.erb +0 -6
- data/app/views/raffle_v1/posts/index.html.erb +0 -25
- data/app/views/raffle_v1/posts/new.html.erb +0 -5
- data/app/views/raffle_v1/posts/show.html.erb +0 -19
- data/config/rafflev1.rb +0 -6
- data/db/migrate/20130127235347_create_programs.rb +0 -9
- data/db/migrate/20130129155515_add_domain_fields_to_programs.rb +0 -6
- data/db/migrate/20130129160949_create_terms_and_conditions.rb +0 -18
- data/db/migrate/20130129183112_add_program_to_users.rb +0 -5
- data/db/migrate/20130129204204_add_username_to_users.rb +0 -6
- data/db/migrate/20130129211205_create_roles.rb +0 -9
- data/db/migrate/20130129212302_create_roles_users.rb +0 -12
- data/db/migrate/20130130013315_create_locales.rb +0 -11
- data/db/migrate/20130130154500_create_program_locales.rb +0 -8
- data/db/migrate/20130130223342_add_settings_to_users.rb +0 -5
- data/db/migrate/20130130223609_add_locale_available_to_program.rb +0 -5
- data/db/migrate/20130130223810_add_locales_to_versions.rb +0 -5
- data/db/migrate/20130130224141_add_locale_name_to_program.rb +0 -5
- data/db/migrate/20130130224327_add_admin_type_to_admins.rb +0 -5
- data/db/migrate/20130130225223_add_deleted_at_to_models.rb +0 -9
- data/db/migrate/20130130230516_create_translations.rb +0 -13
- data/db/migrate/20130131005653_add_timeout_field_to_program.rb +0 -7
- data/db/migrate/20130131144951_create_stylesheets.rb +0 -14
- data/db/migrate/20130202132442_add_tos_to_program.rb +0 -5
- data/db/migrate/20130202133149_add_programid_to_terms.rb +0 -23
- data/db/migrate/20130202193646_add_akm_to_terms_and_conditions.rb +0 -5
- data/db/migrate/20130203035054_create_translation_keys.rb +0 -10
- data/db/migrate/20130203214314_create_program_settings.rb +0 -9
- data/db/migrate/20130204025824_add_translationkey_to_translation.rb +0 -5
- data/db/migrate/20130204030555_create_translation_objects.rb +0 -39
- data/db/migrate/20130205203152_create_pages.rb +0 -25
- data/db/migrate/20130208042652_add_fields_to_page.rb +0 -6
- data/db/migrate/20130208043123_create_page_layouts.rb +0 -12
- data/db/migrate/20130208051925_add_statusitem_to_page.rb +0 -5
- data/db/migrate/20130306012135_add_fields_to_user.rb +0 -40
- data/db/migrate/20130306162357_change_bad_fields_on_user.rb +0 -11
- data/db/migrate/20130306163554_add_password_created_at_to_user.rb +0 -6
- data/db/migrate/20130306165455_add_confirmable_to_user.rb +0 -14
- data/db/migrate/20130306211253_add_username_index_to_user.rb +0 -41
- data/db/migrate/20130313011833_add_field_to_user.rb +0 -5
- data/db/migrate/20130326135125_create_raffle_v1_posts.rb +0 -10
- data/db/migrate/20130326174121_create_raffle_v1_comments.rb +0 -10
- data/lib/database_cleaner-0.7.2/Gemfile.lock +0 -163
- data/lib/database_cleaner-0.7.2/History.txt +0 -209
- data/lib/database_cleaner-0.7.2/LICENSE +0 -20
- data/lib/database_cleaner-0.7.2/README.textile +0 -223
- data/lib/database_cleaner-0.7.2/Rakefile +0 -65
- data/lib/database_cleaner-0.7.2/TODO +0 -3
- data/lib/database_cleaner-0.7.2/VERSION.yml +0 -5
- data/lib/database_cleaner-0.7.2/cucumber.yml +0 -1
- data/lib/database_cleaner-0.7.2/examples/Gemfile +0 -49
- data/lib/database_cleaner-0.7.2/examples/Gemfile.lock +0 -163
- data/lib/database_cleaner-0.7.2/examples/config/database.yml.example +0 -8
- data/lib/database_cleaner-0.7.2/examples/features/example.feature +0 -11
- data/lib/database_cleaner-0.7.2/examples/features/example_multiple_db.feature +0 -23
- data/lib/database_cleaner-0.7.2/examples/features/example_multiple_orm.feature +0 -22
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/activerecord_steps.rb +0 -31
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/couchpotato_steps.rb +0 -31
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/datamapper_steps.rb +0 -37
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/mongoid_steps.rb +0 -23
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/mongomapper_steps.rb +0 -31
- data/lib/database_cleaner-0.7.2/examples/features/step_definitions/translation_steps.rb +0 -55
- data/lib/database_cleaner-0.7.2/examples/features/support/env.rb +0 -62
- data/lib/database_cleaner-0.7.2/examples/lib/activerecord_models.rb +0 -41
- data/lib/database_cleaner-0.7.2/examples/lib/couchpotato_models.rb +0 -61
- data/lib/database_cleaner-0.7.2/examples/lib/datamapper_models.rb +0 -50
- data/lib/database_cleaner-0.7.2/examples/lib/mongoid_models.rb +0 -49
- data/lib/database_cleaner-0.7.2/examples/lib/mongomapper_models.rb +0 -51
- data/lib/database_cleaner-0.7.2/features/cleaning.feature +0 -22
- data/lib/database_cleaner-0.7.2/features/cleaning_default_strategy.feature +0 -19
- data/lib/database_cleaner-0.7.2/features/cleaning_multiple_dbs.feature +0 -21
- data/lib/database_cleaner-0.7.2/features/cleaning_multiple_orms.feature +0 -29
- data/lib/database_cleaner-0.7.2/features/step_definitions/database_cleaner_steps.rb +0 -32
- data/lib/database_cleaner-0.7.2/features/support/env.rb +0 -7
- data/lib/database_cleaner-0.7.2/features/support/feature_runner.rb +0 -39
- data/lib/database_cleaner-0.7.2/lib/database_cleaner.rb +0 -3
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/base.rb +0 -53
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/deletion.rb +0 -69
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/transaction.rb +0 -28
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/active_record/truncation.rb +0 -151
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/base.rb +0 -138
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/configuration.rb +0 -94
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/couch_potato/base.rb +0 -7
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/couch_potato/truncation.rb +0 -28
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/cucumber.rb +0 -11
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/base.rb +0 -21
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/transaction.rb +0 -26
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/data_mapper/truncation.rb +0 -175
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/generic/base.rb +0 -20
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/generic/truncation.rb +0 -37
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo/truncation.rb +0 -22
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo_mapper/base.rb +0 -20
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongo_mapper/truncation.rb +0 -19
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongoid/base.rb +0 -20
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/mongoid/truncation.rb +0 -20
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/null_strategy.rb +0 -15
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/base.rb +0 -22
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/transaction.rb +0 -25
- data/lib/database_cleaner-0.7.2/lib/database_cleaner/sequel/truncation.rb +0 -50
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/base_spec.rb +0 -144
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/transaction_spec.rb +0 -77
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/active_record/truncation_spec.rb +0 -76
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/base_spec.rb +0 -493
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/configuration_spec.rb +0 -294
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/couch_potato/truncation_spec.rb +0 -41
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/base_spec.rb +0 -30
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/transaction_spec.rb +0 -23
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/data_mapper/truncation_spec.rb +0 -11
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/generic/base_spec.rb +0 -22
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/generic/truncation_spec.rb +0 -78
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/base_spec.rb +0 -33
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/mongo_examples.rb +0 -8
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/mongo_mapper/truncation_spec.rb +0 -74
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/base_spec.rb +0 -32
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/transaction_spec.rb +0 -21
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/sequel/truncation_spec.rb +0 -13
- data/lib/database_cleaner-0.7.2/spec/database_cleaner/shared_strategy_spec.rb +0 -13
- data/lib/database_cleaner-0.7.2/spec/rcov.opts +0 -1
- data/lib/database_cleaner-0.7.2/spec/spec.opts +0 -7
- data/lib/database_cleaner-0.7.2/spec/spec_helper.rb +0 -19
- data/lib/generators/raffle_v1/install/USAGE +0 -8
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/script/rails +0 -6
- data/test/fixtures/raffle_v1/comments.yml +0 -9
- data/test/fixtures/raffle_v1/posts.yml +0 -9
- data/test/functional/raffle_v1/posts_controller_test.rb +0 -51
- data/test/unit/helpers/raffle_v1/comments_helper_test.rb +0 -6
@@ -1,294 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
module DatabaseCleaner
|
4
|
-
class << self
|
5
|
-
def reset
|
6
|
-
@connections = nil
|
7
|
-
end
|
8
|
-
|
9
|
-
def connections_stub!(array)
|
10
|
-
@connections = array
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe ::DatabaseCleaner do
|
16
|
-
before(:each) { ::DatabaseCleaner.reset }
|
17
|
-
|
18
|
-
context "orm specification" do
|
19
|
-
it "should not accept unrecognised orms" do
|
20
|
-
expect { ::DatabaseCleaner[nil] }.should raise_error(::DatabaseCleaner::NoORMDetected)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should accept :active_record" do
|
24
|
-
cleaner = ::DatabaseCleaner[:active_record]
|
25
|
-
cleaner.should be_a(::DatabaseCleaner::Base)
|
26
|
-
cleaner.orm.should == :active_record
|
27
|
-
::DatabaseCleaner.connections.size.should == 1
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should accept :data_mapper" do
|
31
|
-
cleaner = ::DatabaseCleaner[:data_mapper]
|
32
|
-
cleaner.should be_a(::DatabaseCleaner::Base)
|
33
|
-
cleaner.orm.should == :data_mapper
|
34
|
-
::DatabaseCleaner.connections.size.should == 1
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should accept :mongo_mapper" do
|
38
|
-
cleaner = ::DatabaseCleaner[:mongo_mapper]
|
39
|
-
cleaner.should be_a(::DatabaseCleaner::Base)
|
40
|
-
cleaner.orm.should == :mongo_mapper
|
41
|
-
::DatabaseCleaner.connections.size.should == 1
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should accept :couch_potato" do
|
45
|
-
cleaner = ::DatabaseCleaner[:couch_potato]
|
46
|
-
cleaner.should be_a(::DatabaseCleaner::Base)
|
47
|
-
cleaner.orm.should == :couch_potato
|
48
|
-
::DatabaseCleaner.connections.size.should == 1
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should accept multiple orm's" do
|
53
|
-
::DatabaseCleaner[:couch_potato]
|
54
|
-
::DatabaseCleaner[:data_mapper]
|
55
|
-
::DatabaseCleaner.connections.size.should == 2
|
56
|
-
::DatabaseCleaner.connections[0].orm.should == :couch_potato
|
57
|
-
::DatabaseCleaner.connections[1].orm.should == :data_mapper
|
58
|
-
end
|
59
|
-
|
60
|
-
context "connection/db specification" do
|
61
|
-
it "should accept a connection parameter and store it" do
|
62
|
-
cleaner = ::DatabaseCleaner[:active_record, {:connection => :first_connection}]
|
63
|
-
cleaner.should be_a(::DatabaseCleaner::Base)
|
64
|
-
cleaner.orm.should == :active_record
|
65
|
-
cleaner.db.should == :first_connection
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should accept multiple connections for a single orm" do
|
69
|
-
::DatabaseCleaner[:data_mapper,{:connection => :first_db}]
|
70
|
-
::DatabaseCleaner[:data_mapper,{:connection => :second_db}]
|
71
|
-
::DatabaseCleaner.connections.size.should == 2
|
72
|
-
::DatabaseCleaner.connections[0].orm.should == :data_mapper
|
73
|
-
::DatabaseCleaner.connections[0].db.should == :first_db
|
74
|
-
::DatabaseCleaner.connections[1].orm.should == :data_mapper
|
75
|
-
::DatabaseCleaner.connections[1].db.should == :second_db
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should accept multiple connections and multiple orms" do
|
79
|
-
::DatabaseCleaner[:data_mapper, {:connection => :first_db} ]
|
80
|
-
::DatabaseCleaner[:active_record,{:connection => :second_db}]
|
81
|
-
::DatabaseCleaner[:active_record,{:connection => :first_db} ]
|
82
|
-
::DatabaseCleaner[:data_mapper, {:connection => :second_db}]
|
83
|
-
|
84
|
-
::DatabaseCleaner.connections.size.should == 4
|
85
|
-
|
86
|
-
::DatabaseCleaner.connections[0].orm.should == :data_mapper
|
87
|
-
::DatabaseCleaner.connections[0].db.should == :first_db
|
88
|
-
|
89
|
-
::DatabaseCleaner.connections[1].orm.should == :active_record
|
90
|
-
::DatabaseCleaner.connections[1].db.should == :second_db
|
91
|
-
|
92
|
-
::DatabaseCleaner.connections[2].orm.should == :active_record
|
93
|
-
::DatabaseCleaner.connections[2].db.should == :first_db
|
94
|
-
|
95
|
-
::DatabaseCleaner.connections[3].orm.should == :data_mapper
|
96
|
-
::DatabaseCleaner.connections[3].db.should == :second_db
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
context "connection/db retrieval" do
|
101
|
-
it "should retrieve a db rather than create a new one" do
|
102
|
-
pending
|
103
|
-
connection = ::DatabaseCleaner[:active_record].strategy = :truncation
|
104
|
-
::DatabaseCleaner[:active_record].should == connection
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
context "class methods" do
|
109
|
-
subject { ::DatabaseCleaner }
|
110
|
-
|
111
|
-
its(:connections) { should respond_to(:each) }
|
112
|
-
|
113
|
-
it "should give me a default (autodetection) databasecleaner by default" do
|
114
|
-
cleaner = mock("cleaner").as_null_object
|
115
|
-
::DatabaseCleaner::Base.should_receive(:new).with().and_return(cleaner)
|
116
|
-
|
117
|
-
::DatabaseCleaner.connections.should have(1).items
|
118
|
-
::DatabaseCleaner.connections.first.should == cleaner
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
context "single orm single connection" do
|
123
|
-
let(:connection) { ::DatabaseCleaner.connections.first }
|
124
|
-
|
125
|
-
it "should proxy strategy=" do
|
126
|
-
stratagum = mock("stratagum")
|
127
|
-
connection.should_receive(:strategy=).with(stratagum)
|
128
|
-
::DatabaseCleaner.strategy = stratagum
|
129
|
-
end
|
130
|
-
|
131
|
-
it "should proxy orm=" do
|
132
|
-
orm = mock("orm")
|
133
|
-
connection.should_receive(:orm=).with(orm)
|
134
|
-
::DatabaseCleaner.orm = orm
|
135
|
-
end
|
136
|
-
|
137
|
-
it "should proxy start" do
|
138
|
-
connection.should_receive(:start)
|
139
|
-
::DatabaseCleaner.start
|
140
|
-
end
|
141
|
-
|
142
|
-
it "should proxy clean" do
|
143
|
-
connection.should_receive(:clean)
|
144
|
-
::DatabaseCleaner.clean
|
145
|
-
end
|
146
|
-
|
147
|
-
it "should proxy clean_with" do
|
148
|
-
stratagem = mock("stratgem")
|
149
|
-
connection.should_receive(:clean_with).with(stratagem, {})
|
150
|
-
::DatabaseCleaner.clean_with stratagem, {}
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
context "multiple connections" do
|
155
|
-
|
156
|
-
#these are relativly simple, all we need to do is make sure all connections are cleaned/started/cleaned_with appropriatly.
|
157
|
-
context "simple proxy methods" do
|
158
|
-
|
159
|
-
let(:active_record) { mock("active_mock") }
|
160
|
-
let(:data_mapper) { mock("data_mock") }
|
161
|
-
|
162
|
-
before(:each) do
|
163
|
-
::DatabaseCleaner.stub!(:connections).and_return([active_record,data_mapper])
|
164
|
-
end
|
165
|
-
|
166
|
-
it "should proxy orm to all connections" do
|
167
|
-
active_record.should_receive(:orm=)
|
168
|
-
data_mapper.should_receive(:orm=)
|
169
|
-
|
170
|
-
::DatabaseCleaner.orm = mock("orm")
|
171
|
-
end
|
172
|
-
|
173
|
-
it "should proxy start to all connections" do
|
174
|
-
active_record.should_receive(:start)
|
175
|
-
data_mapper.should_receive(:start)
|
176
|
-
|
177
|
-
::DatabaseCleaner.start
|
178
|
-
end
|
179
|
-
|
180
|
-
it "should proxy clean to all connections" do
|
181
|
-
active_record.should_receive(:clean)
|
182
|
-
data_mapper.should_receive(:clean)
|
183
|
-
|
184
|
-
::DatabaseCleaner.clean
|
185
|
-
end
|
186
|
-
|
187
|
-
it "should proxy clean_with to all connections" do
|
188
|
-
stratagem = mock("stratgem")
|
189
|
-
active_record.should_receive(:clean_with).with(stratagem)
|
190
|
-
data_mapper.should_receive(:clean_with).with(stratagem)
|
191
|
-
|
192
|
-
::DatabaseCleaner.clean_with stratagem
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
# ah now we have some difficulty, we mustn't allow duplicate connections to exist, but they could
|
197
|
-
# plausably want to force orm/strategy change on two sets of orm that differ only on db
|
198
|
-
context "multiple orm proxy methods" do
|
199
|
-
|
200
|
-
it "should proxy orm to all connections and remove duplicate connections" do
|
201
|
-
active_record_1 = mock("active_mock_on_db_one").as_null_object
|
202
|
-
active_record_2 = mock("active_mock_on_db_two").as_null_object
|
203
|
-
data_mapper_1 = mock("data_mock_on_db_one").as_null_object
|
204
|
-
|
205
|
-
::DatabaseCleaner.connections_stub! [active_record_1,active_record_2,data_mapper_1]
|
206
|
-
|
207
|
-
active_record_1.should_receive(:orm=).with(:data_mapper)
|
208
|
-
active_record_2.should_receive(:orm=).with(:data_mapper)
|
209
|
-
data_mapper_1.should_receive(:orm=).with(:data_mapper)
|
210
|
-
|
211
|
-
active_record_1.should_receive(:==).with(data_mapper_1).and_return(true)
|
212
|
-
|
213
|
-
::DatabaseCleaner.connections.size.should == 3
|
214
|
-
::DatabaseCleaner.orm = :data_mapper
|
215
|
-
::DatabaseCleaner.connections.size.should == 2
|
216
|
-
end
|
217
|
-
|
218
|
-
it "should proxy strategy to all connections and remove duplicate connections" do
|
219
|
-
active_record_1 = mock("active_mock_strategy_one").as_null_object
|
220
|
-
active_record_2 = mock("active_mock_strategy_two").as_null_object
|
221
|
-
strategy = mock("strategy")
|
222
|
-
|
223
|
-
::DatabaseCleaner.connections_stub! [active_record_1,active_record_2]
|
224
|
-
|
225
|
-
active_record_1.should_receive(:strategy=).with(strategy)
|
226
|
-
active_record_2.should_receive(:strategy=).with(strategy)
|
227
|
-
|
228
|
-
active_record_1.should_receive(:==).with(active_record_2).and_return(true)
|
229
|
-
|
230
|
-
::DatabaseCleaner.connections.size.should == 2
|
231
|
-
::DatabaseCleaner.strategy = strategy
|
232
|
-
::DatabaseCleaner.connections.size.should == 1
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
236
|
-
|
237
|
-
describe "remove_duplicates" do
|
238
|
-
it "should remove duplicates if they are identical" do
|
239
|
-
orm = mock("orm")
|
240
|
-
connection = mock("a datamapper connection", :orm => orm )
|
241
|
-
|
242
|
-
::DatabaseCleaner.connections_stub! [connection,connection,connection]
|
243
|
-
|
244
|
-
::DatabaseCleaner.remove_duplicates
|
245
|
-
::DatabaseCleaner.connections.size.should == 1
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
describe "app_root" do
|
250
|
-
it "should default to Dir.pwd" do
|
251
|
-
DatabaseCleaner.app_root.should == Dir.pwd
|
252
|
-
end
|
253
|
-
|
254
|
-
it "should store specific paths" do
|
255
|
-
DatabaseCleaner.app_root = '/path/to'
|
256
|
-
DatabaseCleaner.app_root.should == '/path/to'
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
describe "orm_module" do
|
261
|
-
subject { ::DatabaseCleaner }
|
262
|
-
|
263
|
-
it "should return DatabaseCleaner::ActiveRecord for :active_record" do
|
264
|
-
::DatabaseCleaner::ActiveRecord = mock("ar module") unless defined? ::DatabaseCleaner::ActiveRecord
|
265
|
-
subject.orm_module(:active_record).should == DatabaseCleaner::ActiveRecord
|
266
|
-
end
|
267
|
-
|
268
|
-
it "should return DatabaseCleaner::DataMapper for :data_mapper" do
|
269
|
-
::DatabaseCleaner::DataMapper = mock("dm module") unless defined? ::DatabaseCleaner::DataMapper
|
270
|
-
subject.orm_module(:data_mapper).should == DatabaseCleaner::DataMapper
|
271
|
-
end
|
272
|
-
|
273
|
-
it "should return DatabaseCleaner::MongoMapper for :mongo_mapper" do
|
274
|
-
::DatabaseCleaner::MongoMapper = mock("mm module") unless defined? ::DatabaseCleaner::MongoMapper
|
275
|
-
subject.orm_module(:mongo_mapper).should == DatabaseCleaner::MongoMapper
|
276
|
-
end
|
277
|
-
|
278
|
-
it "should return DatabaseCleaner::Mongoid for :mongoid" do
|
279
|
-
::DatabaseCleaner::Mongoid = mock("mongoid module") unless defined? ::DatabaseCleaner::Mongoid
|
280
|
-
subject.orm_module(:mongoid).should == DatabaseCleaner::Mongoid
|
281
|
-
end
|
282
|
-
|
283
|
-
it "should return DatabaseCleaner::Mongo for :mongo" do
|
284
|
-
::DatabaseCleaner::Mongo = mock("mongo module") unless defined? ::DatabaseCleaner::Mongo
|
285
|
-
subject.orm_module(:mongo).should == DatabaseCleaner::Mongo
|
286
|
-
end
|
287
|
-
|
288
|
-
it "should return DatabaseCleaner::CouchPotato for :couch_potato" do
|
289
|
-
::DatabaseCleaner::CouchPotato = mock("cp module") unless defined? ::DatabaseCleaner::CouchPotato
|
290
|
-
subject.orm_module(:couch_potato).should == DatabaseCleaner::CouchPotato
|
291
|
-
end
|
292
|
-
|
293
|
-
end
|
294
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require 'database_cleaner/couch_potato/truncation'
|
3
|
-
require 'couch_potato'
|
4
|
-
|
5
|
-
module DatabaseCleaner
|
6
|
-
module CouchPotato
|
7
|
-
|
8
|
-
describe Truncation do
|
9
|
-
let(:database) { mock('database') }
|
10
|
-
|
11
|
-
before(:each) do
|
12
|
-
::CouchPotato.stub!(:couchrest_database).and_return(database)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should re-create the database" do
|
16
|
-
database.should_receive(:recreate!)
|
17
|
-
|
18
|
-
Truncation.new.clean
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should raise an error when the :only option is used" do
|
22
|
-
running {
|
23
|
-
Truncation.new(:only => ['document-type'])
|
24
|
-
}.should raise_error(ArgumentError)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should raise an error when the :except option is used" do
|
28
|
-
running {
|
29
|
-
Truncation.new(:except => ['document-type'])
|
30
|
-
}.should raise_error(ArgumentError)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should raise an error when invalid options are provided" do
|
34
|
-
running {
|
35
|
-
Truncation.new(:foo => 'bar')
|
36
|
-
}.should raise_error(ArgumentError)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'database_cleaner/data_mapper/base'
|
3
|
-
require 'database_cleaner/shared_strategy_spec'
|
4
|
-
|
5
|
-
module DatabaseCleaner
|
6
|
-
describe DataMapper do
|
7
|
-
it { should respond_to(:available_strategies) }
|
8
|
-
end
|
9
|
-
|
10
|
-
module DataMapper
|
11
|
-
class ExampleStrategy
|
12
|
-
include ::DatabaseCleaner::DataMapper::Base
|
13
|
-
end
|
14
|
-
|
15
|
-
describe ExampleStrategy do
|
16
|
-
it_should_behave_like "a generic strategy"
|
17
|
-
it { should respond_to(:db) }
|
18
|
-
it { should respond_to(:db=) }
|
19
|
-
|
20
|
-
it "should store my desired db" do
|
21
|
-
subject.db = :my_db
|
22
|
-
subject.db.should == :my_db
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should default to :default" do
|
26
|
-
subject.db.should == :default
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
require 'database_cleaner/data_mapper/transaction'
|
3
|
-
require 'database_cleaner/shared_strategy_spec'
|
4
|
-
#require 'data_mapper'
|
5
|
-
|
6
|
-
module DatabaseCleaner
|
7
|
-
module DataMapper
|
8
|
-
|
9
|
-
describe Transaction do
|
10
|
-
it_should_behave_like "a generic strategy"
|
11
|
-
it_should_behave_like "a generic transaction strategy"
|
12
|
-
|
13
|
-
describe "start" do
|
14
|
-
it "should start a transaction"
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "clean" do
|
18
|
-
it "should finish a transaction"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'database_cleaner/data_mapper/truncation'
|
2
|
-
require 'database_cleaner/shared_strategy_spec'
|
3
|
-
|
4
|
-
module DatabaseCleaner
|
5
|
-
module DataMapper
|
6
|
-
describe Truncation do
|
7
|
-
it_should_behave_like "a generic strategy"
|
8
|
-
it_should_behave_like "a generic truncation strategy"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'database_cleaner/shared_strategy_spec'
|
3
|
-
require 'database_cleaner/generic/base'
|
4
|
-
|
5
|
-
module ::DatabaseCleaner
|
6
|
-
module Generic
|
7
|
-
class ExampleStrategy
|
8
|
-
include ::DatabaseCleaner::Generic::Base
|
9
|
-
end
|
10
|
-
|
11
|
-
describe ExampleStrategy do
|
12
|
-
context "class methods" do
|
13
|
-
subject { ExampleStrategy }
|
14
|
-
its(:available_strategies) { should be_empty }
|
15
|
-
end
|
16
|
-
|
17
|
-
it_should_behave_like "a generic strategy"
|
18
|
-
|
19
|
-
its(:db) { should == :default }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'database_cleaner/generic/truncation'
|
3
|
-
|
4
|
-
module ::DatabaseCleaner
|
5
|
-
module Generic
|
6
|
-
class TruncationExample
|
7
|
-
include ::DatabaseCleaner::Generic::Truncation
|
8
|
-
|
9
|
-
def only
|
10
|
-
@only
|
11
|
-
end
|
12
|
-
|
13
|
-
def except
|
14
|
-
@tables_to_exclude
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
class MigrationExample < TruncationExample
|
19
|
-
def migration_storage_name
|
20
|
-
"migration_storage_name"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe TruncationExample do
|
25
|
-
its(:start) { expect{ subject }.to_not raise_error }
|
26
|
-
its(:clean) { expect{ subject }.to raise_error(NotImplementedError) }
|
27
|
-
|
28
|
-
context "private methods" do
|
29
|
-
it { should_not respond_to(:tables_to_truncate) }
|
30
|
-
its(:tables_to_truncate) { expect{ subject }.to raise_error(NotImplementedError) }
|
31
|
-
|
32
|
-
it { should_not respond_to(:migration_storage_name) }
|
33
|
-
its(:migration_storage_name) { should be_nil }
|
34
|
-
end
|
35
|
-
|
36
|
-
describe "initialize" do
|
37
|
-
it { expect{ subject }.to_not raise_error }
|
38
|
-
|
39
|
-
it "should accept a hash of options" do
|
40
|
-
expect{ TruncationExample.new {} }.to_not raise_error
|
41
|
-
end
|
42
|
-
|
43
|
-
it { expect{ TruncationExample.new( { :a_random_param => "should raise ArgumentError" } ) }.to raise_error(ArgumentError) }
|
44
|
-
it { expect{ TruncationExample.new( { :except => "something",:only => "something else" } ) }.to raise_error(ArgumentError) }
|
45
|
-
it { expect{ TruncationExample.new( { :only => "something" } ) }.to_not raise_error(ArgumentError) }
|
46
|
-
it { expect{ TruncationExample.new( { :except => "something" } ) }.to_not raise_error(ArgumentError) }
|
47
|
-
|
48
|
-
context "" do
|
49
|
-
subject { TruncationExample.new( { :only => ["something"] } ) }
|
50
|
-
its(:only) { should == ["something"] }
|
51
|
-
its(:except) { should == [] }
|
52
|
-
end
|
53
|
-
|
54
|
-
context "" do
|
55
|
-
subject { TruncationExample.new( { :except => ["something"] } ) }
|
56
|
-
its(:only) { should == nil }
|
57
|
-
its(:except) { should include("something") }
|
58
|
-
end
|
59
|
-
|
60
|
-
context "" do
|
61
|
-
subject { MigrationExample.new }
|
62
|
-
its(:only) { should == nil }
|
63
|
-
its(:except) { should == ["migration_storage_name"] }
|
64
|
-
end
|
65
|
-
|
66
|
-
context "" do
|
67
|
-
EXCEPT_TABLES = ["something"]
|
68
|
-
subject { MigrationExample.new( { :except => EXCEPT_TABLES } ) }
|
69
|
-
|
70
|
-
it "should not modify the array of excepted tables" do
|
71
|
-
subject.except.should include("migration_storage_name")
|
72
|
-
EXCEPT_TABLES.should_not include("migration_storage_name")
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|