rails_admin-lbgraham 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +51 -0
- data/LICENSE.md +20 -0
- data/README.md +175 -0
- data/Rakefile +19 -0
- data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/rails_admin/bullet_black.png +0 -0
- data/app/assets/images/rails_admin/bullet_white.png +0 -0
- data/app/assets/images/rails_admin/calendar.png +0 -0
- data/app/assets/images/rails_admin/clock.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/select.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/select2.png +0 -0
- data/app/assets/images/rails_admin/colorpicker/slider.png +0 -0
- data/app/assets/images/rails_admin/logo.png +0 -0
- data/app/assets/images/rails_admin/magnifier.png +0 -0
- data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
- data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
- data/app/assets/javascripts/rails_admin/custom/ui.js +12 -0
- data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -0
- data/app/assets/javascripts/rails_admin/jquery.pjax.js +743 -0
- data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -0
- data/app/assets/javascripts/rails_admin/ra.datetimepicker.js +67 -0
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +142 -0
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +292 -0
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +190 -0
- data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +41 -0
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +151 -0
- data/app/assets/javascripts/rails_admin/ra.widgets.coffee +210 -0
- data/app/assets/javascripts/rails_admin/rails_admin.js.erb +28 -0
- data/app/assets/javascripts/rails_admin/themes/cerulean/ui.js +0 -0
- data/app/assets/javascripts/rails_admin/themes/default/ui.js +12 -0
- data/app/assets/javascripts/rails_admin/ui.js.coffee +66 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.css.scss +733 -0
- data/app/assets/stylesheets/rails_admin/base/README.txt +2 -0
- data/app/assets/stylesheets/rails_admin/base/mixins.css.scss +1 -0
- data/app/assets/stylesheets/rails_admin/base/theming.css.scss +270 -0
- data/app/assets/stylesheets/rails_admin/base/variables.css.scss +1 -0
- data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +12 -0
- data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +13 -0
- data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +15 -0
- data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +82 -0
- data/app/assets/stylesheets/rails_admin/jquery.colorpicker.css.scss +182 -0
- data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +69 -0
- data/app/assets/stylesheets/rails_admin/ra.calendar-additions.css.scss +25 -0
- data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +90 -0
- data/app/assets/stylesheets/rails_admin/ra.widgets.css.scss +8 -0
- data/app/assets/stylesheets/rails_admin/rails_admin.css +4 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/mixins.css.scss +0 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/theming.css.scss +97 -0
- data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.css.scss +168 -0
- data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +8 -0
- data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +11 -0
- data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +12 -0
- data/app/controllers/rails_admin/application_controller.rb +84 -0
- data/app/controllers/rails_admin/main_controller.rb +153 -0
- data/app/helpers/rails_admin/application_helper.rb +147 -0
- data/app/helpers/rails_admin/form_builder.rb +117 -0
- data/app/helpers/rails_admin/main_helper.rb +36 -0
- data/app/views/kaminari/twitter-bootstrap/_gap.html.haml +2 -0
- data/app/views/kaminari/twitter-bootstrap/_next_page.html.haml +4 -0
- data/app/views/kaminari/twitter-bootstrap/_page.html.haml +4 -0
- data/app/views/kaminari/twitter-bootstrap/_paginator.html.haml +10 -0
- data/app/views/kaminari/twitter-bootstrap/_prev_page.html.haml +4 -0
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -0
- data/app/views/layouts/rails_admin/application.html.haml +27 -0
- data/app/views/layouts/rails_admin/pjax.html.haml +16 -0
- data/app/views/rails_admin/main/_dashboard_history.html.haml +20 -0
- data/app/views/rails_admin/main/_delete_notice.html.haml +19 -0
- data/app/views/rails_admin/main/_form_colorpicker.html.haml +1 -0
- data/app/views/rails_admin/main/_form_datetime.html.haml +1 -0
- data/app/views/rails_admin/main/_form_enumeration.html.haml +18 -0
- data/app/views/rails_admin/main/_form_field.html.haml +1 -0
- data/app/views/rails_admin/main/_form_file_upload.html.haml +13 -0
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +47 -0
- data/app/views/rails_admin/main/_form_filtering_select.html.haml +37 -0
- data/app/views/rails_admin/main/_form_nested_many.html.haml +14 -0
- data/app/views/rails_admin/main/_form_nested_one.html.haml +10 -0
- data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +10 -0
- data/app/views/rails_admin/main/_form_text.html.haml +31 -0
- data/app/views/rails_admin/main/_submit_buttons.html.haml +15 -0
- data/app/views/rails_admin/main/bulk_delete.html.haml +11 -0
- data/app/views/rails_admin/main/dashboard.html.haml +35 -0
- data/app/views/rails_admin/main/delete.html.haml +18 -0
- data/app/views/rails_admin/main/edit.html.haml +2 -0
- data/app/views/rails_admin/main/export.html.haml +75 -0
- data/app/views/rails_admin/main/history.html.haml +49 -0
- data/app/views/rails_admin/main/index.html.haml +140 -0
- data/app/views/rails_admin/main/new.html.haml +2 -0
- data/app/views/rails_admin/main/show.html.haml +16 -0
- data/config/initializers/active_record_extensions.rb +19 -0
- data/config/initializers/devise_patch.rb +9 -0
- data/config/initializers/haml.rb +2 -0
- data/config/initializers/mongoid_extensions.rb +4 -0
- data/config/locales/rails_admin.en.yml +130 -0
- data/config/routes.rb +12 -0
- data/lib/generators/rails_admin/install_generator.rb +85 -0
- data/lib/generators/rails_admin/templates/drop.rb +18 -0
- data/lib/generators/rails_admin/templates/initializer.erb +100 -0
- data/lib/generators/rails_admin/templates/migration.rb +18 -0
- data/lib/generators/rails_admin/uninstall_generator.rb +22 -0
- data/lib/generators/rails_admin/utils.rb +30 -0
- data/lib/rails_admin.rb +34 -0
- data/lib/rails_admin/abstract_model.rb +128 -0
- data/lib/rails_admin/adapters/active_record.rb +296 -0
- data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
- data/lib/rails_admin/adapters/mongoid.rb +430 -0
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +43 -0
- data/lib/rails_admin/adapters/mongoid/extension.rb +45 -0
- data/lib/rails_admin/config.rb +333 -0
- data/lib/rails_admin/config/actions.rb +121 -0
- data/lib/rails_admin/config/actions/base.rb +132 -0
- data/lib/rails_admin/config/actions/bulk_delete.rb +55 -0
- data/lib/rails_admin/config/actions/dashboard.rb +52 -0
- data/lib/rails_admin/config/actions/delete.rb +56 -0
- data/lib/rails_admin/config/actions/edit.rb +55 -0
- data/lib/rails_admin/config/actions/export.rb +40 -0
- data/lib/rails_admin/config/actions/history_index.rb +38 -0
- data/lib/rails_admin/config/actions/history_show.rb +38 -0
- data/lib/rails_admin/config/actions/index.rb +85 -0
- data/lib/rails_admin/config/actions/new.rb +65 -0
- data/lib/rails_admin/config/actions/show.rb +34 -0
- data/lib/rails_admin/config/actions/show_in_app.rb +27 -0
- data/lib/rails_admin/config/configurable.rb +92 -0
- data/lib/rails_admin/config/fields.rb +87 -0
- data/lib/rails_admin/config/fields/association.rb +107 -0
- data/lib/rails_admin/config/fields/base.rb +320 -0
- data/lib/rails_admin/config/fields/factories/association.rb +32 -0
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +31 -0
- data/lib/rails_admin/config/fields/factories/devise.rb +27 -0
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +27 -0
- data/lib/rails_admin/config/fields/factories/enum.rb +11 -0
- data/lib/rails_admin/config/fields/factories/paperclip.rb +26 -0
- data/lib/rails_admin/config/fields/factories/password.rb +17 -0
- data/lib/rails_admin/config/fields/group.rb +78 -0
- data/lib/rails_admin/config/fields/types.rb +27 -0
- data/lib/rails_admin/config/fields/types/all.rb +25 -0
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +41 -0
- data/lib/rails_admin/config/fields/types/boolean.rb +38 -0
- data/lib/rails_admin/config/fields/types/bson_object_id.rb +45 -0
- data/lib/rails_admin/config/fields/types/carrierwave.rb +31 -0
- data/lib/rails_admin/config/fields/types/color.rb +37 -0
- data/lib/rails_admin/config/fields/types/date.rb +24 -0
- data/lib/rails_admin/config/fields/types/datetime.rb +164 -0
- data/lib/rails_admin/config/fields/types/decimal.rb +14 -0
- data/lib/rails_admin/config/fields/types/dragonfly.rb +41 -0
- data/lib/rails_admin/config/fields/types/enum.rb +39 -0
- data/lib/rails_admin/config/fields/types/file_upload.rb +65 -0
- data/lib/rails_admin/config/fields/types/float.rb +14 -0
- data/lib/rails_admin/config/fields/types/has_and_belongs_to_many_association.rb +14 -0
- data/lib/rails_admin/config/fields/types/has_many_association.rb +32 -0
- data/lib/rails_admin/config/fields/types/has_one_association.rb +39 -0
- data/lib/rails_admin/config/fields/types/hidden.rb +27 -0
- data/lib/rails_admin/config/fields/types/integer.rb +22 -0
- data/lib/rails_admin/config/fields/types/paperclip.rb +28 -0
- data/lib/rails_admin/config/fields/types/password.rb +39 -0
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +80 -0
- data/lib/rails_admin/config/fields/types/serialized.rb +22 -0
- data/lib/rails_admin/config/fields/types/string.rb +43 -0
- data/lib/rails_admin/config/fields/types/text.rb +97 -0
- data/lib/rails_admin/config/fields/types/time.rb +36 -0
- data/lib/rails_admin/config/fields/types/timestamp.rb +18 -0
- data/lib/rails_admin/config/groupable.rb +18 -0
- data/lib/rails_admin/config/has_fields.rb +136 -0
- data/lib/rails_admin/config/has_groups.rb +23 -0
- data/lib/rails_admin/config/hideable.rb +28 -0
- data/lib/rails_admin/config/lazy_model.rb +21 -0
- data/lib/rails_admin/config/model.rb +109 -0
- data/lib/rails_admin/config/proxyable.rb +12 -0
- data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
- data/lib/rails_admin/config/sections.rb +39 -0
- data/lib/rails_admin/config/sections/base.rb +46 -0
- data/lib/rails_admin/config/sections/create.rb +11 -0
- data/lib/rails_admin/config/sections/edit.rb +11 -0
- data/lib/rails_admin/config/sections/export.rb +11 -0
- data/lib/rails_admin/config/sections/list.rb +27 -0
- data/lib/rails_admin/config/sections/modal.rb +10 -0
- data/lib/rails_admin/config/sections/nested.rb +10 -0
- data/lib/rails_admin/config/sections/show.rb +10 -0
- data/lib/rails_admin/config/sections/update.rb +10 -0
- data/lib/rails_admin/engine.rb +27 -0
- data/lib/rails_admin/extension.rb +29 -0
- data/lib/rails_admin/extensions/cancan.rb +5 -0
- data/lib/rails_admin/extensions/cancan/authorization_adapter.rb +59 -0
- data/lib/rails_admin/extensions/history.rb +5 -0
- data/lib/rails_admin/extensions/history/auditing_adapter.rb +37 -0
- data/lib/rails_admin/extensions/history/history.rb +36 -0
- data/lib/rails_admin/extensions/paper_trail.rb +5 -0
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +93 -0
- data/lib/rails_admin/i18n_support.rb +43 -0
- data/lib/rails_admin/support/core_extensions.rb +44 -0
- data/lib/rails_admin/support/csv_converter.rb +105 -0
- data/lib/rails_admin/version.rb +18 -0
- data/lib/tasks/rails_admin.rake +48 -0
- data/spec/ci.sh +2 -0
- data/spec/controllers/rails_admin/application_controller_spec.rb +30 -0
- data/spec/controllers/rails_admin/main_controller_spec.rb +337 -0
- data/spec/dummy_app/Gemfile +48 -0
- data/spec/dummy_app/Rakefile +7 -0
- data/spec/dummy_app/app/active_record/abstract.rb +5 -0
- data/spec/dummy_app/app/active_record/another_field_test.rb +4 -0
- data/spec/dummy_app/app/active_record/ball.rb +9 -0
- data/spec/dummy_app/app/active_record/carrierwave_uploader.rb +53 -0
- data/spec/dummy_app/app/active_record/category.rb +5 -0
- data/spec/dummy_app/app/active_record/cms.rb +5 -0
- data/spec/dummy_app/app/active_record/cms/basic_page.rb +9 -0
- data/spec/dummy_app/app/active_record/cms/unscoped_page.rb +3 -0
- data/spec/dummy_app/app/active_record/comment.rb +5 -0
- data/spec/dummy_app/app/active_record/comment/confirmed.rb +3 -0
- data/spec/dummy_app/app/active_record/division.rb +15 -0
- data/spec/dummy_app/app/active_record/draft.rb +13 -0
- data/spec/dummy_app/app/active_record/fan.rb +7 -0
- data/spec/dummy_app/app/active_record/field_test.rb +19 -0
- data/spec/dummy_app/app/active_record/hardball.rb +2 -0
- data/spec/dummy_app/app/active_record/image.rb +6 -0
- data/spec/dummy_app/app/active_record/league.rb +12 -0
- data/spec/dummy_app/app/active_record/nested_field_test.rb +8 -0
- data/spec/dummy_app/app/active_record/player.rb +27 -0
- data/spec/dummy_app/app/active_record/team.rb +28 -0
- data/spec/dummy_app/app/active_record/user.rb +25 -0
- data/spec/dummy_app/app/assets/images/rails.png +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
- data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy_app/app/controllers/application_controller.rb +3 -0
- data/spec/dummy_app/app/controllers/players_controller.rb +5 -0
- data/spec/dummy_app/app/locales/models.en.yml +20 -0
- data/spec/dummy_app/app/mongoid/another_field_test.rb +6 -0
- data/spec/dummy_app/app/mongoid/ball.rb +14 -0
- data/spec/dummy_app/app/mongoid/carrierwave_uploader.rb +53 -0
- data/spec/dummy_app/app/mongoid/category.rb +7 -0
- data/spec/dummy_app/app/mongoid/cms.rb +5 -0
- data/spec/dummy_app/app/mongoid/cms/basic_page.rb +12 -0
- data/spec/dummy_app/app/mongoid/cms/unscoped_page.rb +5 -0
- data/spec/dummy_app/app/mongoid/comment.rb +9 -0
- data/spec/dummy_app/app/mongoid/comment/confirmed.rb +3 -0
- data/spec/dummy_app/app/mongoid/division.rb +14 -0
- data/spec/dummy_app/app/mongoid/draft.rb +22 -0
- data/spec/dummy_app/app/mongoid/embed.rb +6 -0
- data/spec/dummy_app/app/mongoid/fan.rb +12 -0
- data/spec/dummy_app/app/mongoid/field_test.rb +57 -0
- data/spec/dummy_app/app/mongoid/hardball.rb +2 -0
- data/spec/dummy_app/app/mongoid/image.rb +9 -0
- data/spec/dummy_app/app/mongoid/league.rb +16 -0
- data/spec/dummy_app/app/mongoid/nested_field_test.rb +13 -0
- data/spec/dummy_app/app/mongoid/player.rb +41 -0
- data/spec/dummy_app/app/mongoid/team.rb +47 -0
- data/spec/dummy_app/app/mongoid/user.rb +61 -0
- data/spec/dummy_app/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy_app/app/views/players/show.html.haml +1 -0
- data/spec/dummy_app/config.ru +4 -0
- data/spec/dummy_app/config/application.rb +69 -0
- data/spec/dummy_app/config/boot.rb +9 -0
- data/spec/dummy_app/config/database.yml +25 -0
- data/spec/dummy_app/config/environment.rb +5 -0
- data/spec/dummy_app/config/environments/development.rb +37 -0
- data/spec/dummy_app/config/environments/production.rb +67 -0
- data/spec/dummy_app/config/environments/test.rb +37 -0
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy_app/config/initializers/devise.rb +216 -0
- data/spec/dummy_app/config/initializers/dragonfly.rb +11 -0
- data/spec/dummy_app/config/initializers/inflections.rb +15 -0
- data/spec/dummy_app/config/initializers/mime_types.rb +5 -0
- data/spec/dummy_app/config/initializers/rails_admin.rb +8 -0
- data/spec/dummy_app/config/initializers/secret_token.rb +7 -0
- data/spec/dummy_app/config/initializers/session_patch.rb +16 -0
- data/spec/dummy_app/config/initializers/session_store.rb +8 -0
- data/spec/dummy_app/config/initializers/strong_parameters.rb +2 -0
- data/spec/dummy_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy_app/config/locales/fr.yml +24 -0
- data/spec/dummy_app/config/mongoid.yml +22 -0
- data/spec/dummy_app/config/routes.rb +10 -0
- data/spec/dummy_app/db/migrate/00000000000001_create_divisions_migration.rb +13 -0
- data/spec/dummy_app/db/migrate/00000000000002_create_drafts_migration.rb +19 -0
- data/spec/dummy_app/db/migrate/00000000000003_create_leagues_migration.rb +12 -0
- data/spec/dummy_app/db/migrate/00000000000004_create_players_migration.rb +20 -0
- data/spec/dummy_app/db/migrate/00000000000005_create_teams_migration.rb +22 -0
- data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +49 -0
- data/spec/dummy_app/db/migrate/00000000000007_create_histories_table.rb +16 -0
- data/spec/dummy_app/db/migrate/00000000000008_create_fans_migration.rb +12 -0
- data/spec/dummy_app/db/migrate/00000000000009_create_fans_teams_migration.rb +11 -0
- data/spec/dummy_app/db/migrate/00000000000010_add_revenue_to_team_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000011_add_suspended_to_player_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000012_add_avatar_columns_to_user.rb +16 -0
- data/spec/dummy_app/db/migrate/00000000000013_add_roles_to_user.rb +9 -0
- data/spec/dummy_app/db/migrate/00000000000014_add_color_to_team_migration.rb +9 -0
- data/spec/dummy_app/db/migrate/20101223222233_create_rel_tests.rb +15 -0
- data/spec/dummy_app/db/migrate/20110103205808_create_comments.rb +15 -0
- data/spec/dummy_app/db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb +9 -0
- data/spec/dummy_app/db/migrate/20110224184303_create_field_tests.rb +22 -0
- data/spec/dummy_app/db/migrate/20110328193014_create_cms_basic_pages.rb +14 -0
- data/spec/dummy_app/db/migrate/20110329183136_remove_league_id_from_teams.rb +9 -0
- data/spec/dummy_app/db/migrate/20110607152842_add_format_to_field_test.rb +9 -0
- data/spec/dummy_app/db/migrate/20110714095433_create_balls.rb +12 -0
- data/spec/dummy_app/db/migrate/20110831090841_add_protected_field_and_restricted_field_to_field_tests.rb +6 -0
- data/spec/dummy_app/db/migrate/20110901131551_change_division_primary_key.rb +19 -0
- data/spec/dummy_app/db/migrate/20110901142530_rename_league_id_foreign_key_on_divisions.rb +5 -0
- data/spec/dummy_app/db/migrate/20110901150912_set_primary_key_not_null_for_divisions.rb +21 -0
- data/spec/dummy_app/db/migrate/20110901154834_change_length_for_rails_admin_histories.rb +9 -0
- data/spec/dummy_app/db/migrate/20111103174459_create_unscoped_pages.rb +9 -0
- data/spec/dummy_app/db/migrate/20111108143642_add_dragonfly_and_carrierwave_to_field_tests.rb +7 -0
- data/spec/dummy_app/db/migrate/20111115041025_add_type_to_balls.rb +5 -0
- data/spec/dummy_app/db/migrate/20111123092549_create_nested_field_tests.rb +10 -0
- data/spec/dummy_app/db/migrate/20111130075338_add_dragonfly_asset_name_to_field_tests.rb +5 -0
- data/spec/dummy_app/db/migrate/20111215083258_create_foo_bars.rb +8 -0
- data/spec/dummy_app/db/migrate/20120117151733_add_custom_field_to_teams.rb +5 -0
- data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +7 -0
- data/spec/dummy_app/db/migrate/20120319041705_drop_rel_tests.rb +15 -0
- data/spec/dummy_app/db/migrate/20120720075608_create_another_field_tests.rb +8 -0
- data/spec/dummy_app/db/migrate/20120928075608_create_images.rb +8 -0
- data/spec/dummy_app/db/seeds.rb +29 -0
- data/spec/dummy_app/doc/README_FOR_APP +2 -0
- data/spec/dummy_app/public/404.html +26 -0
- data/spec/dummy_app/public/422.html +26 -0
- data/spec/dummy_app/public/500.html +25 -0
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +5 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg.meta +1 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg.meta +1 -0
- data/spec/dummy_app/public/system/paperclip_assets/1/original/Boston City Flow.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/1/thumb/Boston City Flow.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/3/original/Costa Rican Frog.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/3/thumb/Costa Rican Frog.jpg +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/6/original/liste-electorale.pdf +0 -0
- data/spec/dummy_app/public/system/paperclip_assets/6/thumb/liste-electorale.pdf +148 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/Boston_City_Flow.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/thumb_Boston_City_Flow.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/thumb_Costa_Rican_Frog.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/thumb_Pensive_Parakeet.jpg +0 -0
- data/spec/dummy_app/script/rails +6 -0
- data/spec/factories.rb +75 -0
- data/spec/helpers/rails_admin/application_helper_spec.rb +353 -0
- data/spec/helpers/rails_admin/form_builder_spec.rb +17 -0
- data/spec/integration/authorization/cancan_spec.rb +366 -0
- data/spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +25 -0
- data/spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +53 -0
- data/spec/integration/basic/create/rails_admin_basic_create_spec.rb +140 -0
- data/spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb +16 -0
- data/spec/integration/basic/delete/rails_admin_basic_delete_spec.rb +64 -0
- data/spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb +84 -0
- data/spec/integration/basic/edit/rails_admin_basic_edit_spec.rb +109 -0
- data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +106 -0
- data/spec/integration/basic/list/rails_admin_basic_list_spec.rb +444 -0
- data/spec/integration/basic/new/rails_admin_basic_new_spec.rb +73 -0
- data/spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb +31 -0
- data/spec/integration/basic/show/rails_admin_basic_show_spec.rb +82 -0
- data/spec/integration/basic/update/rails_admin_basic_update_spec.rb +229 -0
- data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +1026 -0
- data/spec/integration/config/list/rails_admin_config_list_spec.rb +441 -0
- data/spec/integration/config/show/rails_admin_config_show_spec.rb +331 -0
- data/spec/integration/history/rails_admin_history_spec.rb +88 -0
- data/spec/integration/rails_admin_spec.rb +150 -0
- data/spec/integration/relation_spec.rb +35 -0
- data/spec/orm/active_record.rb +42 -0
- data/spec/orm/mongoid.rb +21 -0
- data/spec/rails_admin/abstract_model_spec.rb +75 -0
- data/spec/rails_admin/active_record_extension_spec.rb +16 -0
- data/spec/rails_admin/adapters/active_record/abstract_object_spec.rb +132 -0
- data/spec/rails_admin/adapters/active_record_spec.rb +409 -0
- data/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb +31 -0
- data/spec/rails_admin/adapters/mongoid_spec.rb +776 -0
- data/spec/rails_admin/config/actions/base_spec.rb +32 -0
- data/spec/rails_admin/config/actions_spec.rb +180 -0
- data/spec/rails_admin/config/fields/base_spec.rb +421 -0
- data/spec/rails_admin/config/fields/date_spec.rb +74 -0
- data/spec/rails_admin/config/fields/datetime_spec.rb +55 -0
- data/spec/rails_admin/config/fields/file_upload_spec.rb +21 -0
- data/spec/rails_admin/config/fields/time_spec.rb +39 -0
- data/spec/rails_admin/config/fields/timestamp_spec.rb +20 -0
- data/spec/rails_admin/config/fields/types/datetime_spec.rb +18 -0
- data/spec/rails_admin/config/fields_spec.rb +15 -0
- data/spec/rails_admin/config/has_fields_spec.rb +30 -0
- data/spec/rails_admin/config/lazy_model_spec.rb +29 -0
- data/spec/rails_admin/config/model_spec.rb +75 -0
- data/spec/rails_admin/config/sections_spec.rb +123 -0
- data/spec/rails_admin/config_spec.rb +277 -0
- data/spec/rails_admin/support/csv_converter_spec.rb +16 -0
- data/spec/spec_helper.rb +84 -0
- metadata +868 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "RailsAdmin Basic New" do
|
4
|
+
|
5
|
+
subject { page }
|
6
|
+
|
7
|
+
describe "GET /admin/player/new" do
|
8
|
+
before(:each) do
|
9
|
+
visit new_path(:model_name => "player")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "shows \"New Model\"" do
|
13
|
+
should have_content("New Player")
|
14
|
+
end
|
15
|
+
|
16
|
+
it "shows required fields as \"Required\"" do
|
17
|
+
should have_selector("div", :text => /Name\s*Required/)
|
18
|
+
should have_selector("div", :text => /Number\s*Required/)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "shows non-required fields as \"Optional\"" do
|
22
|
+
should have_selector("#player_position_field .help-block", :text => "Optional")
|
23
|
+
should have_selector("#player_born_on_field .help-block", :text => "Optional")
|
24
|
+
should have_selector("#player_notes_field .help-block", :text => "Optional")
|
25
|
+
end
|
26
|
+
|
27
|
+
# https://github.com/sferik/rails_admin/issues/362
|
28
|
+
# test that no link uses the "wildcard route" with the main
|
29
|
+
# controller and new method
|
30
|
+
it "does not use the 'wildcard route'" do
|
31
|
+
should have_no_selector("a[href^='/rails_admin/main/new']")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "GET /admin/player/new with has-one/belongs_to/has_many association" do
|
36
|
+
before(:each) do
|
37
|
+
FactoryGirl.create :draft
|
38
|
+
visit new_path(:model_name => "player")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "shows selects" do
|
42
|
+
should have_selector("select#player_draft_id")
|
43
|
+
should have_selector("select#player_team_id")
|
44
|
+
should have_selector("select#player_comment_ids")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "GET /admin/player/new with missing label" do
|
49
|
+
before(:each) do
|
50
|
+
FactoryGirl.create :team, :name => ""
|
51
|
+
visit new_path(:model_name => "player")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "GET /admin/player/new with parameters for pre-population" do
|
56
|
+
it "populates form field when corresponding parameters are passed in" do
|
57
|
+
visit new_path(:model_name => 'player', :player => {:name => 'Sam'})
|
58
|
+
expect(page).to have_css('input[value=Sam]')
|
59
|
+
end
|
60
|
+
|
61
|
+
it "prepropulates belongs to relationships" do
|
62
|
+
@team = FactoryGirl.create :team, :name => "belongs_to association prepopulated"
|
63
|
+
visit new_path(:model_name => 'player', :associations => { :team => @team.id } )
|
64
|
+
expect(page).to have_css("select#player_team_id option[selected='selected'][value='#{@team.id}']")
|
65
|
+
end
|
66
|
+
|
67
|
+
it "prepropulates has_many relationships" do
|
68
|
+
@player = FactoryGirl.create :player, :name => "has_many association prepopulated"
|
69
|
+
visit new_path(:model_name => 'team', :associations => { :players => @player.id } )
|
70
|
+
expect(page).to have_css("select#team_player_ids option[selected='selected'][value='#{@player.id}']")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "RailsAdmin Namespaced Model New" do
|
4
|
+
|
5
|
+
subject { page }
|
6
|
+
|
7
|
+
describe "AbstractModel#to_param" do
|
8
|
+
it "turns namespaces into prefixes with ~" do
|
9
|
+
expect(RailsAdmin::AbstractModel.new("Cms::BasicPage").to_param).to eq('cms~basic_page')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "ApplicationController#to_model_name" do
|
14
|
+
it "turns cms~basic_page into Cms::BasicPage" do
|
15
|
+
expect(RailsAdmin::ApplicationController.new.to_model_name('cms~basic_page')).to eq('Cms::BasicPage')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "GET /admin/cms_basic_page/new" do
|
20
|
+
before(:each) do
|
21
|
+
visit new_path(:model_name => "cms~basic_page")
|
22
|
+
end
|
23
|
+
|
24
|
+
it "has correct input field names" do
|
25
|
+
should have_selector("label[for=cms_basic_page_title]")
|
26
|
+
should have_selector("input#cms_basic_page_title[name='cms_basic_page[title]']")
|
27
|
+
should have_selector("label[for=cms_basic_page_content]")
|
28
|
+
should have_selector("textarea#cms_basic_page_content[name='cms_basic_page[content]']")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "RailsAdmin Basic Show" do
|
4
|
+
subject { page }
|
5
|
+
|
6
|
+
describe "show" do
|
7
|
+
it "has History, Edit, Delete, Details and attributes" do
|
8
|
+
@player = FactoryGirl.create :player
|
9
|
+
visit show_path(:model_name => "player", :id => @player.id)
|
10
|
+
|
11
|
+
should have_selector("a", :text => "History")
|
12
|
+
should have_selector("a", :text => "Edit")
|
13
|
+
should have_selector("a", :text => "Delete")
|
14
|
+
should have_content("Details")
|
15
|
+
should have_content("Name")
|
16
|
+
should have_content(@player.name)
|
17
|
+
should have_content("Number")
|
18
|
+
should have_content(@player.number)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "GET /admin/players/123this-id-doesnt-exist" do
|
23
|
+
it "raises NotFound" do
|
24
|
+
visit '/admin/players/123this-id-doesnt-exist'
|
25
|
+
expect(page.driver.status_code).to eq(404)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "show with belongs_to association" do
|
30
|
+
before(:each) do
|
31
|
+
@player = FactoryGirl.create :player
|
32
|
+
@team = FactoryGirl.create :team
|
33
|
+
@player.update_attributes(:team_id => @team.id)
|
34
|
+
visit show_path(:model_name => "player", :id => @player.id)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "shows associated objects" do
|
38
|
+
should have_css("a[href='/admin/team/#{@team.id}']")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "show with has-one association" do
|
43
|
+
before(:each) do
|
44
|
+
@player = FactoryGirl.create :player
|
45
|
+
@draft = FactoryGirl.create :draft, :player => @player
|
46
|
+
visit show_path(:model_name => "player", :id => @player.id)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "shows associated objects" do
|
50
|
+
should have_css("a[href='/admin/draft/#{@draft.id}']")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "show with has-and-belongs-to-many association" do
|
55
|
+
before(:each) do
|
56
|
+
@player = FactoryGirl.create :player
|
57
|
+
@comment1 = FactoryGirl.create :comment, :commentable => @player
|
58
|
+
@comment2 = FactoryGirl.create :comment, :commentable => @player
|
59
|
+
@comment3 = FactoryGirl.create :comment, :commentable => FactoryGirl.create(:player)
|
60
|
+
|
61
|
+
visit show_path(:model_name => "player", :id => @player.id)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "shows associated objects" do
|
65
|
+
should have_css("a[href='/admin/comment/#{@comment1.id}']")
|
66
|
+
should have_css("a[href='/admin/comment/#{@comment2.id}']")
|
67
|
+
should_not have_css("a[href='/admin/comment/#{@comment3.id}']")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "show for polymorphic objects" do
|
72
|
+
before(:each) do
|
73
|
+
@player = FactoryGirl.create :player
|
74
|
+
@comment = FactoryGirl.create :comment, :commentable => @player
|
75
|
+
visit show_path(:model_name => "comment", :id => @comment.id)
|
76
|
+
end
|
77
|
+
|
78
|
+
it "shows associated object" do
|
79
|
+
should have_css("a[href='/admin/player/#{@player.id}']")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,229 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "RailsAdmin Basic Update" do
|
4
|
+
|
5
|
+
subject { page }
|
6
|
+
|
7
|
+
describe "update with errors" do
|
8
|
+
before(:each) do
|
9
|
+
@player = FactoryGirl.create :player
|
10
|
+
visit edit_path(:model_name => "player", :id => @player.id)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "returns to edit page" do
|
14
|
+
fill_in "player[name]", :with => ""
|
15
|
+
click_button "Save" # first(:button, "Save").click
|
16
|
+
expect(page.driver.status_code).to eq(406)
|
17
|
+
should have_selector "form[action='#{edit_path(:model_name => "player", :id => @player.id)}']"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "update and add another" do
|
22
|
+
before(:each) do
|
23
|
+
@player = FactoryGirl.create :player
|
24
|
+
|
25
|
+
visit edit_path(:model_name => "player", :id => @player.id)
|
26
|
+
|
27
|
+
fill_in "player[name]", :with => "Jackie Robinson"
|
28
|
+
fill_in "player[number]", :with => "42"
|
29
|
+
fill_in "player[position]", :with => "Second baseman"
|
30
|
+
click_button "Save" # first(:button, "Save").click
|
31
|
+
|
32
|
+
@player = RailsAdmin::AbstractModel.new("Player").first
|
33
|
+
end
|
34
|
+
|
35
|
+
it "updates an object with correct attributes" do
|
36
|
+
expect(@player.name).to eq("Jackie Robinson")
|
37
|
+
expect(@player.number).to eq(42)
|
38
|
+
expect(@player.position).to eq("Second baseman")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "update and edit" do
|
43
|
+
before(:each) do
|
44
|
+
@player = FactoryGirl.create :player
|
45
|
+
|
46
|
+
visit edit_path(:model_name => "player", :id => @player.id)
|
47
|
+
|
48
|
+
fill_in "player[name]", :with => "Jackie Robinson"
|
49
|
+
fill_in "player[number]", :with => "42"
|
50
|
+
fill_in "player[position]", :with => "Second baseman"
|
51
|
+
click_button "Save and edit"
|
52
|
+
|
53
|
+
@player.reload
|
54
|
+
end
|
55
|
+
|
56
|
+
it "updates an object with correct attributes" do
|
57
|
+
expect(@player.name).to eq("Jackie Robinson")
|
58
|
+
expect(@player.number).to eq(42)
|
59
|
+
expect(@player.position).to eq("Second baseman")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "update with has-one association" do
|
64
|
+
before(:each) do
|
65
|
+
@player = FactoryGirl.create :player
|
66
|
+
@draft = FactoryGirl.create :draft
|
67
|
+
@number = @draft.player.number + 1 # to avoid collision
|
68
|
+
put edit_path(:model_name => "player", :id => @player.id, :player => {:name => "Jackie Robinson", :draft_id => @draft.id, :number => @number, :position => "Second baseman"})
|
69
|
+
@player.reload
|
70
|
+
end
|
71
|
+
|
72
|
+
it "updates an object with correct attributes" do
|
73
|
+
expect(@player.name).to eq("Jackie Robinson")
|
74
|
+
expect(@player.number).to eq(@number)
|
75
|
+
expect(@player.position).to eq("Second baseman")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "updates an object with correct associations" do
|
79
|
+
@draft.reload
|
80
|
+
expect(@player.draft).to eq(@draft)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "update with has-many association" do
|
85
|
+
it "is fillable and emptyable", :active_record => true do
|
86
|
+
RailsAdmin.config do |c|
|
87
|
+
c.audit_with :history
|
88
|
+
end
|
89
|
+
|
90
|
+
@league = FactoryGirl.create :league
|
91
|
+
@divisions = 3.times.map { Division.create!(:name => "div #{Time.now.to_f}", :league => League.create!(:name => "league #{Time.now.to_f}")) }
|
92
|
+
|
93
|
+
put edit_path(:model_name => "league", :id => @league.id, :league => {:name => "National League", :division_ids => [@divisions[0].id] })
|
94
|
+
|
95
|
+
old_name = @league.name
|
96
|
+
@league.reload
|
97
|
+
expect(@league.name).to eq("National League")
|
98
|
+
@divisions[0].reload
|
99
|
+
expect(@league.divisions).to include(@divisions[0])
|
100
|
+
expect(@league.divisions).not_to include(@divisions[1])
|
101
|
+
expect(@league.divisions).not_to include(@divisions[2])
|
102
|
+
|
103
|
+
expect(RailsAdmin::History.where(:item => @league.id).collect(&:message)).to include("name: \"#{old_name}\" -> \"National League\"")
|
104
|
+
|
105
|
+
put edit_path(:model_name => "league", :id => @league.id, :league => {:division_ids => [""]})
|
106
|
+
|
107
|
+
@league.reload
|
108
|
+
expect(@league.divisions).to be_empty
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
describe "update with missing object" do
|
113
|
+
before(:each) do
|
114
|
+
put edit_path(:model_name => "player", :id => 1), :params => {:player => {:name => "Jackie Robinson", :number => 42, :position => "Second baseman"}}
|
115
|
+
end
|
116
|
+
|
117
|
+
it "raises NotFound" do
|
118
|
+
expect(response.code).to eq("404")
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "update with invalid object" do
|
123
|
+
before(:each) do
|
124
|
+
@player = FactoryGirl.create :player
|
125
|
+
|
126
|
+
visit edit_path(:model_name => "player", :id => @player.id)
|
127
|
+
|
128
|
+
fill_in "player[name]", :with => "Jackie Robinson"
|
129
|
+
fill_in "player[number]", :with => "a"
|
130
|
+
fill_in "player[position]", :with => "Second baseman"
|
131
|
+
click_button "Save" # first(:button, "Save").click
|
132
|
+
|
133
|
+
@player.reload
|
134
|
+
end
|
135
|
+
|
136
|
+
it "shows an error message" do
|
137
|
+
# TODO: Mongoid 3.0.0 lacks ability of numericality validation on Integer field.
|
138
|
+
# This is caused by change in https://github.com/mongoid/mongoid/pull/1698
|
139
|
+
# I believe this should be a bug in Mongoid.
|
140
|
+
expect(Capybara.string(body)).to have_content("Player failed to be updated") unless CI_ORM == :mongoid && Mongoid::VERSION >= '3.0.0'
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
describe "update with serialized objects" do
|
145
|
+
before(:each) do
|
146
|
+
RailsAdmin.config do |c|
|
147
|
+
c.model User do
|
148
|
+
configure :roles, :serialized
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
@user = FactoryGirl.create :user
|
153
|
+
|
154
|
+
visit edit_path(:model_name => "user", :id => @user.id)
|
155
|
+
|
156
|
+
fill_in "user[roles]", :with => %{['admin', 'user']}
|
157
|
+
click_button "Save" # first(:button, "Save").click
|
158
|
+
|
159
|
+
@user.reload
|
160
|
+
end
|
161
|
+
|
162
|
+
it "saves the serialized data" do
|
163
|
+
expect(@user.roles).to eq(['admin','user'])
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
describe "update with serialized objects of Mongoid", :mongoid => true do
|
168
|
+
before(:each) do
|
169
|
+
@field_test = FactoryGirl.create :field_test
|
170
|
+
|
171
|
+
visit edit_path(:model_name => "field_test", :id => @field_test.id)
|
172
|
+
end
|
173
|
+
|
174
|
+
it "saves the serialized data" do
|
175
|
+
fill_in "field_test[array_field]", :with => "[4, 2]"
|
176
|
+
fill_in "field_test[hash_field]", :with => "{ a: 6, b: 2 }"
|
177
|
+
click_button "Save" # first(:button, "Save").click
|
178
|
+
|
179
|
+
@field_test.reload
|
180
|
+
expect(@field_test.array_field).to eq([4, 2])
|
181
|
+
expect(@field_test.hash_field).to eq({ "a" => 6, "b" => 2 })
|
182
|
+
end
|
183
|
+
|
184
|
+
it "clears data when empty string is passed" do
|
185
|
+
fill_in "field_test[array_field]", :with => ""
|
186
|
+
fill_in "field_test[hash_field]", :with => ""
|
187
|
+
click_button "Save" # first(:button, "Save").click
|
188
|
+
|
189
|
+
@field_test.reload
|
190
|
+
expect(@field_test.array_field).to eq(nil)
|
191
|
+
expect(@field_test.hash_field).to eq(nil)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
describe "update with overridden to_param" do
|
196
|
+
before(:each) do
|
197
|
+
@ball = FactoryGirl.create :ball
|
198
|
+
|
199
|
+
visit edit_path(:model_name => "ball", :id => @ball.id)
|
200
|
+
|
201
|
+
fill_in "ball[color]", :with => "gray"
|
202
|
+
click_button "Save and edit"
|
203
|
+
|
204
|
+
@ball.reload
|
205
|
+
end
|
206
|
+
|
207
|
+
it "updates an object with correct attributes" do
|
208
|
+
expect(@ball.color).to eq("gray")
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
describe "update of STI subclass on superclass view" do
|
213
|
+
before(:each) do
|
214
|
+
@hardball = FactoryGirl.create :hardball
|
215
|
+
|
216
|
+
visit edit_path(:model_name => "ball", :id => @hardball.id)
|
217
|
+
|
218
|
+
fill_in "ball[color]", :with => "cyan"
|
219
|
+
click_button "Save and edit"
|
220
|
+
|
221
|
+
@hardball.reload
|
222
|
+
end
|
223
|
+
|
224
|
+
it "updates an object with correct attributes" do
|
225
|
+
expect(@hardball.color).to eq("cyan")
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
@@ -0,0 +1,1026 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe "RailsAdmin Config DSL Edit Section" do
|
6
|
+
|
7
|
+
subject { page }
|
8
|
+
|
9
|
+
describe " a field with 'format' as a name (Kernel function)" do
|
10
|
+
|
11
|
+
it "is updatable without any error" do
|
12
|
+
RailsAdmin.config FieldTest do
|
13
|
+
edit do
|
14
|
+
field :format
|
15
|
+
end
|
16
|
+
end
|
17
|
+
visit new_path(:model_name => "field_test")
|
18
|
+
fill_in "field_test[format]", :with => "test for format"
|
19
|
+
click_button "Save" # first(:button, "Save").click
|
20
|
+
@record = RailsAdmin::AbstractModel.new("FieldTest").first
|
21
|
+
expect(@record.format).to eq("test for format")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "default_value" do
|
26
|
+
|
27
|
+
it "is set for all types of input fields" do
|
28
|
+
RailsAdmin.config do |config|
|
29
|
+
config.excluded_models = []
|
30
|
+
config.model(FieldTest) do
|
31
|
+
|
32
|
+
field :string_field do
|
33
|
+
default_value 'string_field default_value'
|
34
|
+
end
|
35
|
+
field :text_field do
|
36
|
+
default_value 'string_field text_field'
|
37
|
+
end
|
38
|
+
field :boolean_field do
|
39
|
+
default_value true
|
40
|
+
end
|
41
|
+
field :date_field do
|
42
|
+
default_value Date.today
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
visit new_path(:model_name => "field_test")
|
48
|
+
# In Rails 3.2.3 behavior of textarea has changed to insert newline after the opening tag,
|
49
|
+
# but Capybara's RackTest driver is not up to this behavior change.
|
50
|
+
# (https://github.com/jnicklas/capybara/issues/677)
|
51
|
+
# So we manually cut off first newline character as a workaround here.
|
52
|
+
expect(find_field('field_test[string_field]').value.gsub(/^\n/, '')).to eq('string_field default_value')
|
53
|
+
expect(find_field('field_test[text_field]').value.gsub(/^\n/, '')).to eq('string_field text_field')
|
54
|
+
expect(find_field('field_test[date_field]').value).to eq(Date.today.to_s)
|
55
|
+
expect(has_checked_field?('field_test[boolean_field]')).to be_true
|
56
|
+
end
|
57
|
+
|
58
|
+
it "sets default value for selects" do
|
59
|
+
RailsAdmin.config(Team) do
|
60
|
+
field :color, :enum do
|
61
|
+
default_value 'black'
|
62
|
+
enum do
|
63
|
+
['black', 'white']
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
visit new_path(:model_name => "team")
|
68
|
+
expect(find_field('team[color]').value).to eq('black')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "attr_accessible" do
|
73
|
+
|
74
|
+
|
75
|
+
it "is configurable in the controller scope" do
|
76
|
+
|
77
|
+
RailsAdmin.config do |config|
|
78
|
+
config.excluded_models = []
|
79
|
+
config.attr_accessible_role do
|
80
|
+
_current_user.attr_accessible_role # sould be :custom_role
|
81
|
+
end
|
82
|
+
|
83
|
+
config.model FieldTest do
|
84
|
+
edit do
|
85
|
+
field :string_field
|
86
|
+
field :restricted_field
|
87
|
+
field :protected_field
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
visit new_path(:model_name => "field_test")
|
93
|
+
fill_in "field_test[string_field]", :with => "No problem here"
|
94
|
+
fill_in "field_test[restricted_field]", :with => "I'm allowed to do that as :custom_role only"
|
95
|
+
should have_no_selector "field_test[protected_field]"
|
96
|
+
click_button "Save" # first(:button, "Save").click
|
97
|
+
@field_test = FieldTest.first
|
98
|
+
expect(@field_test.string_field).to eq("No problem here")
|
99
|
+
expect(@field_test.restricted_field).to eq("I'm allowed to do that as :custom_role only")
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "css hooks" do
|
104
|
+
it "is present" do
|
105
|
+
visit new_path(:model_name => "team")
|
106
|
+
should have_selector("#team_division_id_field.belongs_to_association_type.division_field")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe "field groupings" do
|
111
|
+
|
112
|
+
it "is hideable" do
|
113
|
+
RailsAdmin.config Team do
|
114
|
+
edit do
|
115
|
+
group :default do
|
116
|
+
label "Hidden group"
|
117
|
+
hide
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
visit new_path(:model_name => "team")
|
122
|
+
# Should not have the group header
|
123
|
+
should have_no_selector("legend", :text => "Hidden Group")
|
124
|
+
# Should not have any of the group's fields either
|
125
|
+
should have_no_selector("select#team_division")
|
126
|
+
should have_no_selector("input#team_name")
|
127
|
+
should have_no_selector("input#team_logo_url")
|
128
|
+
should have_no_selector("input#team_manager")
|
129
|
+
should have_no_selector("input#team_ballpark")
|
130
|
+
should have_no_selector("input#team_mascot")
|
131
|
+
should have_no_selector("input#team_founded")
|
132
|
+
should have_no_selector("input#team_wins")
|
133
|
+
should have_no_selector("input#team_losses")
|
134
|
+
should have_no_selector("input#team_win_percentage")
|
135
|
+
should have_no_selector("input#team_revenue")
|
136
|
+
end
|
137
|
+
|
138
|
+
it "hides association groupings" do
|
139
|
+
RailsAdmin.config Team do
|
140
|
+
edit do
|
141
|
+
group :players do
|
142
|
+
label "Players"
|
143
|
+
field :players
|
144
|
+
hide
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
visit new_path(:model_name => "team")
|
149
|
+
# Should not have the group header
|
150
|
+
should have_no_selector("legend", :text => "Players")
|
151
|
+
# Should not have any of the group's fields either
|
152
|
+
should have_no_selector("select#team_player_ids")
|
153
|
+
end
|
154
|
+
|
155
|
+
it "is renameable" do
|
156
|
+
RailsAdmin.config Team do
|
157
|
+
edit do
|
158
|
+
group :default do
|
159
|
+
label "Renamed group"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
visit new_path(:model_name => "team")
|
164
|
+
# NOTE: capybara 2.0 is exceedingly reluctant to reveal the text of invisible elements. This was
|
165
|
+
# the least terrible option I was able to find. It would probably be better to refactor the test
|
166
|
+
# so the label we're looking for is displayed.
|
167
|
+
expect(find("legend", :visible => false).native.text).to include("Renamed group")
|
168
|
+
end
|
169
|
+
|
170
|
+
describe "help" do
|
171
|
+
before(:each) do
|
172
|
+
class HelpTest < Tableless
|
173
|
+
column :name, 'string(50)'
|
174
|
+
column :division, :string
|
175
|
+
end
|
176
|
+
RailsAdmin.config.included_models = [HelpTest, Team]
|
177
|
+
end
|
178
|
+
|
179
|
+
after(:each) do
|
180
|
+
# restore validation setting
|
181
|
+
HelpTest._validators[:name] = []
|
182
|
+
HelpTest.reset_callbacks(:validate)
|
183
|
+
end
|
184
|
+
|
185
|
+
context "using mongoid", :skip_active_record => true do
|
186
|
+
it "uses the db column size for the maximum length" do
|
187
|
+
visit new_path(:model_name => "help_test")
|
188
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 255.")
|
189
|
+
end
|
190
|
+
|
191
|
+
it "returns nil for the maximum length" do
|
192
|
+
visit new_path(:model_name => "team")
|
193
|
+
expect(find("#team_custom_field_field .help-block")).not_to have_content("Length")
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
context "using active_record", :skip_mongoid => true do
|
198
|
+
it "uses the db column size for the maximum length" do
|
199
|
+
visit new_path(:model_name => "help_test")
|
200
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 50.")
|
201
|
+
end
|
202
|
+
|
203
|
+
it "uses the :minimum setting from the validation" do
|
204
|
+
HelpTest.class_eval do
|
205
|
+
validates_length_of :name, :minimum => 1
|
206
|
+
end
|
207
|
+
visit new_path(:model_name => "help_test")
|
208
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length of 1-50.")
|
209
|
+
end
|
210
|
+
|
211
|
+
it "uses the minimum of db column size or :maximum setting from the validation" do
|
212
|
+
HelpTest.class_eval do
|
213
|
+
validates_length_of :name, :maximum => 51
|
214
|
+
end
|
215
|
+
visit new_path(:model_name => "help_test")
|
216
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 50.")
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
it "shows help section if present" do
|
221
|
+
RailsAdmin.config HelpTest do
|
222
|
+
edit do
|
223
|
+
group :default do
|
224
|
+
help "help paragraph to display"
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
visit new_path(:model_name => "help_test")
|
229
|
+
should have_selector('fieldset>p', :text => "help paragraph to display")
|
230
|
+
end
|
231
|
+
|
232
|
+
it "does not show help if not present" do
|
233
|
+
RailsAdmin.config HelpTest do
|
234
|
+
edit do
|
235
|
+
group :default do
|
236
|
+
label 'no help'
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
visit new_path(:model_name => "help_test")
|
241
|
+
should_not have_selector('fieldset>p')
|
242
|
+
end
|
243
|
+
|
244
|
+
it "is able to display multiple help if there are multiple sections" do
|
245
|
+
RailsAdmin.config HelpTest do
|
246
|
+
edit do
|
247
|
+
group :default do
|
248
|
+
field :name
|
249
|
+
help 'help for default'
|
250
|
+
end
|
251
|
+
group :other_section do
|
252
|
+
label "Other Section"
|
253
|
+
field :division
|
254
|
+
help 'help for other section'
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
visit new_path(:model_name => "help_test")
|
259
|
+
should have_selector("fieldset>p", :text => 'help for default')
|
260
|
+
should have_selector("fieldset>p", :text => 'help for other section')
|
261
|
+
should have_selector("fieldset>p", :count => 2)
|
262
|
+
end
|
263
|
+
|
264
|
+
it "uses the :is setting from the validation" do
|
265
|
+
HelpTest.class_eval do
|
266
|
+
validates_length_of :name, :is => 3
|
267
|
+
end
|
268
|
+
visit new_path(:model_name => "help_test")
|
269
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length of 3.")
|
270
|
+
end
|
271
|
+
|
272
|
+
it "uses the :maximum setting from the validation" do
|
273
|
+
HelpTest.class_eval do
|
274
|
+
validates_length_of :name, :maximum => 49
|
275
|
+
end
|
276
|
+
visit new_path(:model_name => "help_test")
|
277
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 49.")
|
278
|
+
end
|
279
|
+
|
280
|
+
it "uses the :minimum and :maximum from the validation" do
|
281
|
+
HelpTest.class_eval do
|
282
|
+
validates_length_of :name, :minimum => 1, :maximum => 49
|
283
|
+
end
|
284
|
+
visit new_path(:model_name => "help_test")
|
285
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length of 1-49.")
|
286
|
+
end
|
287
|
+
|
288
|
+
it "uses the range from the validation" do
|
289
|
+
HelpTest.class_eval do
|
290
|
+
validates_length_of :name, :in => 1..49
|
291
|
+
end
|
292
|
+
visit new_path(:model_name => "help_test")
|
293
|
+
expect(find("#help_test_name_field .help-block")).to have_content("Length of 1-49.")
|
294
|
+
end
|
295
|
+
|
296
|
+
end
|
297
|
+
|
298
|
+
it "has accessor for its fields" do
|
299
|
+
RailsAdmin.config Team do
|
300
|
+
edit do
|
301
|
+
group :default do
|
302
|
+
field :name
|
303
|
+
field :logo_url
|
304
|
+
end
|
305
|
+
group :belongs_to_associations do
|
306
|
+
label "Belong's to associations"
|
307
|
+
field :division
|
308
|
+
end
|
309
|
+
group :basic_info do
|
310
|
+
field :manager
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
314
|
+
visit new_path(:model_name => "team")
|
315
|
+
should have_selector("legend", :text => "Basic info", :visible => false)
|
316
|
+
should have_selector("legend", :text => "Basic info", :visible => true)
|
317
|
+
should have_selector("legend", :text => "Belong's to associations")
|
318
|
+
should have_selector("label", :text => "Name")
|
319
|
+
should have_selector("label", :text => "Logo url")
|
320
|
+
should have_selector("label", :text => "Division")
|
321
|
+
should have_selector(".control-group", :count => 4)
|
322
|
+
end
|
323
|
+
|
324
|
+
it "has accessor for its fields by type" do
|
325
|
+
RailsAdmin.config Team do
|
326
|
+
edit do
|
327
|
+
group :default do
|
328
|
+
field :name
|
329
|
+
field :logo_url
|
330
|
+
end
|
331
|
+
group :other do
|
332
|
+
field :division_id
|
333
|
+
field :manager
|
334
|
+
field :ballpark
|
335
|
+
fields_of_type :string do
|
336
|
+
label { "#{label} (STRING)" }
|
337
|
+
end
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
341
|
+
visit new_path(:model_name => "team")
|
342
|
+
should have_selector("label", :text => "Name")
|
343
|
+
should have_selector("label", :text => "Logo url")
|
344
|
+
should have_selector("label", :text => "Division")
|
345
|
+
should have_selector("label", :text => "Manager (STRING)")
|
346
|
+
should have_selector("label", :text => "Ballpark (STRING)")
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
describe "items' fields" do
|
351
|
+
|
352
|
+
it "shows all by default" do
|
353
|
+
visit new_path(:model_name => "team")
|
354
|
+
should have_selector("select#team_division_id")
|
355
|
+
should have_selector("input#team_name")
|
356
|
+
should have_selector("input#team_logo_url")
|
357
|
+
should have_selector("input#team_manager")
|
358
|
+
should have_selector("input#team_ballpark")
|
359
|
+
should have_selector("input#team_mascot")
|
360
|
+
should have_selector("input#team_founded")
|
361
|
+
should have_selector("input#team_wins")
|
362
|
+
should have_selector("input#team_losses")
|
363
|
+
should have_selector("input#team_win_percentage")
|
364
|
+
should have_selector("input#team_revenue")
|
365
|
+
should have_selector("select#team_player_ids")
|
366
|
+
should have_selector("select#team_fan_ids")
|
367
|
+
end
|
368
|
+
|
369
|
+
it "appears in order defined" do
|
370
|
+
RailsAdmin.config Team do
|
371
|
+
edit do
|
372
|
+
field :manager
|
373
|
+
field :division
|
374
|
+
field :name
|
375
|
+
end
|
376
|
+
end
|
377
|
+
visit new_path(:model_name => "team")
|
378
|
+
should have_selector(:xpath, "//*[contains(@class, 'field')][1]//*[@id='team_manager']")
|
379
|
+
should have_selector(:xpath, "//*[contains(@class, 'field')][2]//*[@id='team_division_id']")
|
380
|
+
should have_selector(:xpath, "//*[contains(@class, 'field')][3]//*[@id='team_name']")
|
381
|
+
end
|
382
|
+
|
383
|
+
it "only shows the defined fields if some fields are defined" do
|
384
|
+
RailsAdmin.config Team do
|
385
|
+
edit do
|
386
|
+
field :division
|
387
|
+
field :name
|
388
|
+
end
|
389
|
+
end
|
390
|
+
visit new_path(:model_name => "team")
|
391
|
+
should have_selector("label", :text => "Division")
|
392
|
+
should have_selector("label", :text => "Name")
|
393
|
+
should have_selector(".control-group", :count => 2)
|
394
|
+
end
|
395
|
+
|
396
|
+
describe "I18n awarly" do
|
397
|
+
after :each do
|
398
|
+
I18n.locale = :en
|
399
|
+
end
|
400
|
+
|
401
|
+
it "delegates the label option to the ActiveModel API and memoizes it" do
|
402
|
+
RailsAdmin.config Team do
|
403
|
+
edit do
|
404
|
+
field :manager
|
405
|
+
field :fans
|
406
|
+
end
|
407
|
+
end
|
408
|
+
visit new_path(:model_name => "team")
|
409
|
+
should have_selector("label", :text => "Team Manager")
|
410
|
+
should have_selector("label", :text => "Some Fans")
|
411
|
+
I18n.locale = :fr
|
412
|
+
visit new_path(:model_name => "team")
|
413
|
+
should have_selector("label", :text => "Manager de l'équipe")
|
414
|
+
should have_selector("label", :text => "Quelques fans")
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
it "is renameable" do
|
419
|
+
RailsAdmin.config Team do
|
420
|
+
edit do
|
421
|
+
field :manager do
|
422
|
+
label "Renamed field"
|
423
|
+
end
|
424
|
+
field :division
|
425
|
+
field :name
|
426
|
+
end
|
427
|
+
end
|
428
|
+
visit new_path(:model_name => "team")
|
429
|
+
should have_selector("label", :text => "Renamed field")
|
430
|
+
should have_selector("label", :text => "Division")
|
431
|
+
should have_selector("label", :text => "Name")
|
432
|
+
end
|
433
|
+
|
434
|
+
it "is renameable by type" do
|
435
|
+
RailsAdmin.config Team do
|
436
|
+
edit do
|
437
|
+
fields_of_type :string do
|
438
|
+
label { "#{label} (STRING)" }
|
439
|
+
end
|
440
|
+
end
|
441
|
+
end
|
442
|
+
visit new_path(:model_name => "team")
|
443
|
+
should have_selector("label", :text => "Division")
|
444
|
+
should have_selector("label", :text => "Name (STRING)")
|
445
|
+
should have_selector("label", :text => "Logo url (STRING)")
|
446
|
+
should have_selector("label", :text => "Manager (STRING)")
|
447
|
+
should have_selector("label", :text => "Ballpark (STRING)")
|
448
|
+
should have_selector("label", :text => "Mascot (STRING)")
|
449
|
+
should have_selector("label", :text => "Founded")
|
450
|
+
should have_selector("label", :text => "Wins")
|
451
|
+
should have_selector("label", :text => "Losses")
|
452
|
+
should have_selector("label", :text => "Win percentage")
|
453
|
+
should have_selector("label", :text => "Revenue")
|
454
|
+
should have_selector("label", :text => "Players")
|
455
|
+
should have_selector("label", :text => "Fans")
|
456
|
+
end
|
457
|
+
|
458
|
+
it "is globally renameable by type" do
|
459
|
+
RailsAdmin.config Team do
|
460
|
+
edit do
|
461
|
+
fields_of_type :string do
|
462
|
+
label { "#{label} (STRING)" }
|
463
|
+
end
|
464
|
+
end
|
465
|
+
end
|
466
|
+
visit new_path(:model_name => "team")
|
467
|
+
should have_selector("label", :text => "Division")
|
468
|
+
should have_selector("label", :text => "Name (STRING)")
|
469
|
+
should have_selector("label", :text => "Logo url (STRING)")
|
470
|
+
should have_selector("label", :text => "Manager (STRING)")
|
471
|
+
should have_selector("label", :text => "Ballpark (STRING)")
|
472
|
+
should have_selector("label", :text => "Mascot (STRING)")
|
473
|
+
should have_selector("label", :text => "Founded")
|
474
|
+
should have_selector("label", :text => "Wins")
|
475
|
+
should have_selector("label", :text => "Losses")
|
476
|
+
should have_selector("label", :text => "Win percentage")
|
477
|
+
should have_selector("label", :text => "Revenue")
|
478
|
+
should have_selector("label", :text => "Players")
|
479
|
+
should have_selector("label", :text => "Fans")
|
480
|
+
end
|
481
|
+
|
482
|
+
it "is flaggable as read only and be configurable with formatted_value" do
|
483
|
+
RailsAdmin.config Team do
|
484
|
+
edit do
|
485
|
+
field :name do
|
486
|
+
read_only true
|
487
|
+
formatted_value do
|
488
|
+
"I'm outputed in the form"
|
489
|
+
end
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
493
|
+
visit new_path(:model_name => "team")
|
494
|
+
should have_content("I'm outputed in the form")
|
495
|
+
end
|
496
|
+
|
497
|
+
it "is hideable" do
|
498
|
+
RailsAdmin.config Team do
|
499
|
+
edit do
|
500
|
+
field :manager do
|
501
|
+
hide
|
502
|
+
end
|
503
|
+
field :division
|
504
|
+
field :name
|
505
|
+
end
|
506
|
+
end
|
507
|
+
visit new_path(:model_name => "team")
|
508
|
+
should have_no_selector("#team_manager")
|
509
|
+
should have_selector("#team_division_id")
|
510
|
+
should have_selector("#team_name")
|
511
|
+
end
|
512
|
+
|
513
|
+
it "is hideable by type" do
|
514
|
+
RailsAdmin.config Team do
|
515
|
+
edit do
|
516
|
+
fields_of_type :string do
|
517
|
+
hide
|
518
|
+
end
|
519
|
+
end
|
520
|
+
end
|
521
|
+
visit new_path(:model_name => "team")
|
522
|
+
should have_selector("label", :text => "Division")
|
523
|
+
should have_no_selector("label", :text => "Name")
|
524
|
+
should have_no_selector("label", :text => "Logo url")
|
525
|
+
should have_no_selector("label", :text => "Manager")
|
526
|
+
should have_no_selector("label", :text => "Ballpark")
|
527
|
+
should have_no_selector("label", :text => "Mascot")
|
528
|
+
should have_selector("label", :text => "Founded")
|
529
|
+
should have_selector("label", :text => "Wins")
|
530
|
+
should have_selector("label", :text => "Losses")
|
531
|
+
should have_selector("label", :text => "Win percentage")
|
532
|
+
should have_selector("label", :text => "Revenue")
|
533
|
+
should have_selector("label", :text => "Players")
|
534
|
+
should have_selector("label", :text => "Fans")
|
535
|
+
end
|
536
|
+
|
537
|
+
it "is globally hideable by type" do
|
538
|
+
RailsAdmin.config Team do
|
539
|
+
edit do
|
540
|
+
fields_of_type :string do
|
541
|
+
hide
|
542
|
+
end
|
543
|
+
end
|
544
|
+
end
|
545
|
+
visit new_path(:model_name => "team")
|
546
|
+
should have_selector("label", :text => "Division")
|
547
|
+
should have_no_selector("label", :text => "Name")
|
548
|
+
should have_no_selector("label", :text => "Logo url")
|
549
|
+
should have_no_selector("label", :text => "Manager")
|
550
|
+
should have_no_selector("label", :text => "Ballpark")
|
551
|
+
should have_no_selector("label", :text => "Mascot")
|
552
|
+
should have_selector("label", :text => "Founded")
|
553
|
+
should have_selector("label", :text => "Wins")
|
554
|
+
should have_selector("label", :text => "Losses")
|
555
|
+
should have_selector("label", :text => "Win percentage")
|
556
|
+
should have_selector("label", :text => "Revenue")
|
557
|
+
should have_selector("label", :text => "Players")
|
558
|
+
should have_selector("label", :text => "Fans")
|
559
|
+
end
|
560
|
+
|
561
|
+
it "has option to customize the help text" do
|
562
|
+
RailsAdmin.config Team do
|
563
|
+
edit do
|
564
|
+
field :manager do
|
565
|
+
help "#{help} Additional help text for manager field."
|
566
|
+
end
|
567
|
+
field :division
|
568
|
+
field :name
|
569
|
+
end
|
570
|
+
end
|
571
|
+
visit new_path(:model_name => "team")
|
572
|
+
expect(find("#team_manager_field .help-block")).to have_content("Required. Length up to 100. Additional help text for manager field.")
|
573
|
+
expect(find("#team_division_id_field .help-block")).to have_content("Required")
|
574
|
+
expect(find("#team_name_field .help-block")).not_to have_content("Additional help text")
|
575
|
+
end
|
576
|
+
|
577
|
+
it "has option to override required status" do
|
578
|
+
RailsAdmin.config Team do
|
579
|
+
edit do
|
580
|
+
field :manager do
|
581
|
+
optional true
|
582
|
+
end
|
583
|
+
field :division do
|
584
|
+
optional true
|
585
|
+
end
|
586
|
+
field :name do
|
587
|
+
required true
|
588
|
+
end
|
589
|
+
end
|
590
|
+
end
|
591
|
+
visit new_path(:model_name => "team")
|
592
|
+
expect(find("#team_manager_field .help-block")).to have_content("Optional")
|
593
|
+
expect(find("#team_division_id_field .help-block")).to have_content("Optional")
|
594
|
+
expect(find("#team_name_field .help-block")).to have_content("Required")
|
595
|
+
end
|
596
|
+
end
|
597
|
+
|
598
|
+
describe "bindings" do
|
599
|
+
it "is present at creation time" do
|
600
|
+
RailsAdmin.config do |config|
|
601
|
+
config.excluded_models = []
|
602
|
+
end
|
603
|
+
RailsAdmin.config Category do
|
604
|
+
field :parent_category do
|
605
|
+
visible do
|
606
|
+
!bindings[:object].new_record?
|
607
|
+
end
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
visit new_path(:model_name => 'category')
|
612
|
+
should have_no_css('#category_parent_category_id')
|
613
|
+
click_button "Save" # first(:button, "Save").click
|
614
|
+
visit edit_path(:model_name => 'category', :id => Category.first)
|
615
|
+
should have_css('#category_parent_category_id')
|
616
|
+
click_button "Save" # first(:button, "Save").click
|
617
|
+
should have_content('Category successfully updated')
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
describe "nested form" do
|
622
|
+
it "works" do
|
623
|
+
@record = FactoryGirl.create :field_test
|
624
|
+
@record.nested_field_tests = [NestedFieldTest.create!(:title => 'title 1'), NestedFieldTest.create!(:title => 'title 2')]
|
625
|
+
visit edit_path(:model_name => "field_test", :id => @record.id)
|
626
|
+
fill_in "field_test_comment_attributes_content", :with => 'nested comment content'
|
627
|
+
fill_in "field_test_nested_field_tests_attributes_0_title", :with => 'nested field test title 1 edited'
|
628
|
+
page.find('#field_test_nested_field_tests_attributes_1__destroy').set('true')
|
629
|
+
click_button "Save" # first(:button, "Save").click
|
630
|
+
@record.reload
|
631
|
+
expect(@record.comment.content).to eq('nested comment content')
|
632
|
+
expect(@record.nested_field_tests.length).to eq(1)
|
633
|
+
expect(@record.nested_field_tests[0].title).to eq('nested field test title 1 edited')
|
634
|
+
end
|
635
|
+
|
636
|
+
it "sets bindings[:object] to nested object" do
|
637
|
+
RailsAdmin.config(NestedFieldTest) do
|
638
|
+
nested do
|
639
|
+
field :title do
|
640
|
+
label do
|
641
|
+
bindings[:object].class.name
|
642
|
+
end
|
643
|
+
end
|
644
|
+
end
|
645
|
+
end
|
646
|
+
@record = FieldTest.create
|
647
|
+
@record.nested_field_tests << NestedFieldTest.create!(:title => 'title 1')
|
648
|
+
visit edit_path(:model_name => "field_test", :id => @record.id)
|
649
|
+
expect(find('#field_test_nested_field_tests_attributes_0_title_field')).to have_content('NestedFieldTest')
|
650
|
+
end
|
651
|
+
|
652
|
+
it "is desactivable" do
|
653
|
+
visit new_path(:model_name => "field_test")
|
654
|
+
should have_selector('#field_test_nested_field_tests_attributes_field .add_nested_fields')
|
655
|
+
RailsAdmin.config(FieldTest) do
|
656
|
+
configure :nested_field_tests do
|
657
|
+
nested_form false
|
658
|
+
end
|
659
|
+
end
|
660
|
+
visit new_path(:model_name => "field_test")
|
661
|
+
should have_no_selector('#field_test_nested_field_tests_attributes_field .add_nested_fields')
|
662
|
+
end
|
663
|
+
|
664
|
+
describe "with nested_attributes_options given" do
|
665
|
+
before do
|
666
|
+
FieldTest.nested_attributes_options.stub(:[]).with(any_args()).
|
667
|
+
and_return({:allow_destroy=>true, :update_only=>false})
|
668
|
+
end
|
669
|
+
|
670
|
+
it "does not show add button when :update_only is true" do
|
671
|
+
FieldTest.nested_attributes_options.stub(:[]).with(:nested_field_tests).
|
672
|
+
and_return({:allow_destroy=>true, :update_only=>true})
|
673
|
+
visit new_path(:model_name => "field_test")
|
674
|
+
should have_selector('.toggler')
|
675
|
+
should_not have_selector('#field_test_nested_field_tests_attributes_field .add_nested_fields')
|
676
|
+
end
|
677
|
+
|
678
|
+
it "does not show destroy button except for newly created when :allow_destroy is false" do
|
679
|
+
@record = FieldTest.create
|
680
|
+
@record.nested_field_tests << NestedFieldTest.create!(:title => 'nested title 1')
|
681
|
+
FieldTest.nested_attributes_options.stub(:[]).with(:nested_field_tests).
|
682
|
+
and_return({:allow_destroy=>false, :update_only=>false})
|
683
|
+
visit edit_path(:model_name => "field_test", :id => @record.id)
|
684
|
+
expect(find('#field_test_nested_field_tests_attributes_0_title').value).to eq('nested title 1')
|
685
|
+
should_not have_selector('form .remove_nested_fields')
|
686
|
+
expect(find('div#nested_field_tests_fields_blueprint')[:'data-blueprint']).to match(
|
687
|
+
/<a[^>]* class="remove_nested_fields"[^>]*>/)
|
688
|
+
end
|
689
|
+
end
|
690
|
+
|
691
|
+
describe "when a field which have the same name of nested_in field's" do
|
692
|
+
it "does not hide fields which are not associated with nesting parent field's model" do
|
693
|
+
visit new_path(:model_name => "field_test")
|
694
|
+
should_not have_selector('select#field_test_nested_field_tests_attributes_new_nested_field_tests_field_test_id')
|
695
|
+
expect(find('div#nested_field_tests_fields_blueprint')[:'data-blueprint']).to match(
|
696
|
+
/<select[^>]* id="field_test_nested_field_tests_attributes_new_nested_field_tests_another_field_test_id"[^>]*>/)
|
697
|
+
end
|
698
|
+
end
|
699
|
+
end
|
700
|
+
|
701
|
+
describe "embedded model", :mongoid => true do
|
702
|
+
it "works" do
|
703
|
+
@record = FactoryGirl.create :field_test
|
704
|
+
2.times.each{|i| @record.embeds.create :name => "embed #{i}"}
|
705
|
+
visit edit_path(:model_name => "field_test", :id => @record.id)
|
706
|
+
fill_in "field_test_embeds_attributes_0_name", :with => 'embed 1 edited'
|
707
|
+
page.find('#field_test_embeds_attributes_1__destroy').set('true')
|
708
|
+
click_button "Save" # first(:button, "Save").click
|
709
|
+
@record.reload
|
710
|
+
expect(@record.embeds.length).to eq(1)
|
711
|
+
expect(@record.embeds[0].name).to eq('embed 1 edited')
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
715
|
+
|
716
|
+
describe "fields which are nullable and have AR validations", :active_record => true do
|
717
|
+
|
718
|
+
it "is required" do
|
719
|
+
# draft.notes is nullable and has no validation
|
720
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
|
721
|
+
expect(field.properties[:nullable?]).to be_true
|
722
|
+
expect(field.required?).to be_false
|
723
|
+
|
724
|
+
# draft.date is nullable in the schema but has an AR
|
725
|
+
# validates_presence_of validation that makes it required
|
726
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :date}
|
727
|
+
expect(field.properties[:nullable?]).to be_true
|
728
|
+
expect(field.required?).to be_true
|
729
|
+
|
730
|
+
# draft.round is nullable in the schema but has an AR
|
731
|
+
# validates_numericality_of validation that makes it required
|
732
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :round}
|
733
|
+
expect(field.properties[:nullable?]).to be_true
|
734
|
+
expect(field.required?).to be_true
|
735
|
+
|
736
|
+
# team.revenue is nullable in the schema but has an AR
|
737
|
+
# validates_numericality_of validation that allows nil
|
738
|
+
field = RailsAdmin::config("Team").edit.fields.find{|f| f.name == :revenue}
|
739
|
+
expect(field.properties[:nullable?]).to be_true
|
740
|
+
expect(field.required?).to be_false
|
741
|
+
end
|
742
|
+
end
|
743
|
+
|
744
|
+
describe "CKEditor Support" do
|
745
|
+
|
746
|
+
it "starts with CKEditor disabled" do
|
747
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
|
748
|
+
expect(field.ckeditor).to be_false
|
749
|
+
end
|
750
|
+
|
751
|
+
it "adds Javascript to enable CKEditor" do
|
752
|
+
RailsAdmin.config Draft do
|
753
|
+
edit do
|
754
|
+
field :notes do
|
755
|
+
ckeditor true
|
756
|
+
end
|
757
|
+
end
|
758
|
+
end
|
759
|
+
visit new_path(:model_name => "draft")
|
760
|
+
should have_selector('textarea#draft_notes[data-richtext="ckeditor"]')
|
761
|
+
end
|
762
|
+
end
|
763
|
+
|
764
|
+
describe "CodeMirror Support" do
|
765
|
+
|
766
|
+
it "starts with CodeMirror disabled" do
|
767
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
|
768
|
+
expect(field.codemirror).to be_false
|
769
|
+
end
|
770
|
+
|
771
|
+
it "adds Javascript to enable CodeMirror" do
|
772
|
+
RailsAdmin.config Draft do
|
773
|
+
edit do
|
774
|
+
field :notes do
|
775
|
+
codemirror true
|
776
|
+
end
|
777
|
+
end
|
778
|
+
end
|
779
|
+
visit new_path(:model_name => "draft")
|
780
|
+
should have_selector('textarea#draft_notes[data-richtext="codemirror"]')
|
781
|
+
end
|
782
|
+
end
|
783
|
+
|
784
|
+
describe "bootstrap_wysihtml5 Support" do
|
785
|
+
|
786
|
+
it "starts with bootstrap_wysihtml5 disabled" do
|
787
|
+
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
|
788
|
+
expect(field.bootstrap_wysihtml5).to be_false
|
789
|
+
end
|
790
|
+
|
791
|
+
it "adds Javascript to enable bootstrap_wysihtml5" do
|
792
|
+
RailsAdmin.config Draft do
|
793
|
+
edit do
|
794
|
+
field :notes do
|
795
|
+
bootstrap_wysihtml5 true
|
796
|
+
end
|
797
|
+
end
|
798
|
+
end
|
799
|
+
visit new_path(:model_name => "draft")
|
800
|
+
should have_selector('textarea#draft_notes[data-richtext="bootstrap-wysihtml5"]')
|
801
|
+
end
|
802
|
+
|
803
|
+
it "should include custom wysihtml5 configuration" do
|
804
|
+
RailsAdmin.config Draft do
|
805
|
+
edit do
|
806
|
+
field :notes do
|
807
|
+
bootstrap_wysihtml5 true
|
808
|
+
bootstrap_wysihtml5_config_options :image => false
|
809
|
+
bootstrap_wysihtml5_css_location 'stub_css.css'
|
810
|
+
bootstrap_wysihtml5_js_location 'stub_js.js'
|
811
|
+
end
|
812
|
+
end
|
813
|
+
end
|
814
|
+
|
815
|
+
visit new_path(:model_name => "draft")
|
816
|
+
should have_selector("textarea#draft_notes[data-richtext=\"bootstrap-wysihtml5\"][data-options]")
|
817
|
+
end
|
818
|
+
end
|
819
|
+
|
820
|
+
describe "Paperclip Support" do
|
821
|
+
|
822
|
+
it "shows a file upload field" do
|
823
|
+
RailsAdmin.config User do
|
824
|
+
edit do
|
825
|
+
field :avatar
|
826
|
+
end
|
827
|
+
end
|
828
|
+
visit new_path(:model_name => "user")
|
829
|
+
should have_selector("input#user_avatar")
|
830
|
+
end
|
831
|
+
end
|
832
|
+
|
833
|
+
describe "Enum field support" do
|
834
|
+
describe "when object responds to '\#{method}_enum'" do
|
835
|
+
before do
|
836
|
+
Team.class_eval do
|
837
|
+
def color_enum
|
838
|
+
["blue", "green", "red"]
|
839
|
+
end
|
840
|
+
end
|
841
|
+
RailsAdmin.config Team do
|
842
|
+
edit do
|
843
|
+
field :color
|
844
|
+
end
|
845
|
+
end
|
846
|
+
visit new_path(:model_name => "team")
|
847
|
+
end
|
848
|
+
|
849
|
+
after do
|
850
|
+
Team.send(:remove_method, :color_enum)
|
851
|
+
end
|
852
|
+
|
853
|
+
it "auto-detects enumeration" do
|
854
|
+
should have_selector(".enum_type select")
|
855
|
+
should_not have_selector(".enum_type select[multiple]")
|
856
|
+
should have_content("green")
|
857
|
+
end
|
858
|
+
end
|
859
|
+
|
860
|
+
describe "when class responds to '\#{method}_enum'" do
|
861
|
+
before do
|
862
|
+
Team.instance_eval do
|
863
|
+
def color_enum
|
864
|
+
["blue", "green", "red"]
|
865
|
+
end
|
866
|
+
end
|
867
|
+
RailsAdmin.config Team do
|
868
|
+
edit do
|
869
|
+
field :color
|
870
|
+
end
|
871
|
+
end
|
872
|
+
visit new_path(:model_name => "team")
|
873
|
+
end
|
874
|
+
|
875
|
+
after do
|
876
|
+
Team.instance_eval { undef :color_enum }
|
877
|
+
end
|
878
|
+
|
879
|
+
it "auto-detects enumeration" do
|
880
|
+
should have_selector(".enum_type select")
|
881
|
+
should have_content("green")
|
882
|
+
end
|
883
|
+
end
|
884
|
+
|
885
|
+
describe "the enum instance method" do
|
886
|
+
before do
|
887
|
+
Team.class_eval do
|
888
|
+
def color_list
|
889
|
+
["blue", "green", "red"]
|
890
|
+
end
|
891
|
+
end
|
892
|
+
RailsAdmin.config Team do
|
893
|
+
edit do
|
894
|
+
field :color, :enum do
|
895
|
+
enum_method :color_list
|
896
|
+
end
|
897
|
+
end
|
898
|
+
end
|
899
|
+
visit new_path(:model_name => "team")
|
900
|
+
end
|
901
|
+
|
902
|
+
after do
|
903
|
+
Team.send(:remove_method, :color_list)
|
904
|
+
end
|
905
|
+
|
906
|
+
it "allows configuration" do
|
907
|
+
should have_selector(".enum_type select")
|
908
|
+
should have_content("green")
|
909
|
+
end
|
910
|
+
end
|
911
|
+
|
912
|
+
describe "the enum class method" do
|
913
|
+
before do
|
914
|
+
Team.instance_eval do
|
915
|
+
def color_list
|
916
|
+
["blue", "green", "red"]
|
917
|
+
end
|
918
|
+
end
|
919
|
+
RailsAdmin.config Team do
|
920
|
+
edit do
|
921
|
+
field :color, :enum do
|
922
|
+
enum_method :color_list
|
923
|
+
end
|
924
|
+
end
|
925
|
+
end
|
926
|
+
visit new_path(:model_name => "team")
|
927
|
+
end
|
928
|
+
|
929
|
+
after do
|
930
|
+
Team.instance_eval { undef :color_list }
|
931
|
+
end
|
932
|
+
|
933
|
+
it "allows configuration" do
|
934
|
+
should have_selector(".enum_type select")
|
935
|
+
should have_content("green")
|
936
|
+
end
|
937
|
+
end
|
938
|
+
|
939
|
+
describe "when overriding enum configuration" do
|
940
|
+
before do
|
941
|
+
Team.class_eval do
|
942
|
+
def color_list
|
943
|
+
["blue", "green", "red"]
|
944
|
+
end
|
945
|
+
end
|
946
|
+
RailsAdmin.config Team do
|
947
|
+
edit do
|
948
|
+
field :color, :enum do
|
949
|
+
enum_method :color_list
|
950
|
+
enum do
|
951
|
+
["yellow", "black"]
|
952
|
+
end
|
953
|
+
end
|
954
|
+
end
|
955
|
+
end
|
956
|
+
visit new_path(:model_name => "team")
|
957
|
+
end
|
958
|
+
|
959
|
+
after do
|
960
|
+
Team.send(:remove_method, :color_list)
|
961
|
+
end
|
962
|
+
|
963
|
+
it "allows direct listing of enumeration options and override enum method" do
|
964
|
+
should have_selector(".enum_type select")
|
965
|
+
should have_no_content("green")
|
966
|
+
should have_content("yellow")
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
describe "when serialize is enabled in ActiveRecord model", :active_record => true do
|
971
|
+
before do
|
972
|
+
Team.instance_eval do
|
973
|
+
serialize :color
|
974
|
+
def color_enum
|
975
|
+
["blue", "green", "red"]
|
976
|
+
end
|
977
|
+
end
|
978
|
+
visit new_path(:model_name => "team")
|
979
|
+
end
|
980
|
+
|
981
|
+
after do
|
982
|
+
Team.serialized_attributes.clear
|
983
|
+
Team.instance_eval { undef :color_enum }
|
984
|
+
end
|
985
|
+
|
986
|
+
it "makes enumeration multi-selectable" do
|
987
|
+
should have_selector(".enum_type select[multiple]")
|
988
|
+
end
|
989
|
+
end
|
990
|
+
|
991
|
+
describe "when serialize is enabled in Mongoid model", :mongoid => true do
|
992
|
+
before do
|
993
|
+
Team.instance_eval do
|
994
|
+
field :color, :type => Array
|
995
|
+
def color_enum
|
996
|
+
["blue", "green", "red"]
|
997
|
+
end
|
998
|
+
end
|
999
|
+
visit new_path(:model_name => "team")
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
after do
|
1003
|
+
Team.instance_eval do
|
1004
|
+
field :color, :type => String
|
1005
|
+
undef :color_enum
|
1006
|
+
end
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
it "makes enumeration multi-selectable" do
|
1010
|
+
should have_selector(".enum_type select[multiple]")
|
1011
|
+
end
|
1012
|
+
end
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
describe "ColorPicker Support" do
|
1016
|
+
it "shows input with class color" do
|
1017
|
+
RailsAdmin.config Team do
|
1018
|
+
edit do
|
1019
|
+
field :color, :color
|
1020
|
+
end
|
1021
|
+
end
|
1022
|
+
visit new_path(:model_name => "team")
|
1023
|
+
should have_selector(".color_type input")
|
1024
|
+
end
|
1025
|
+
end
|
1026
|
+
end
|