refinerycms-core 2.1.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/refinery/add.png +0 -0
- data/app/assets/images/refinery/admin_bg.png +0 -0
- data/app/assets/images/refinery/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/branch-end.gif +0 -0
- data/app/assets/images/refinery/branch.gif +0 -0
- data/app/assets/images/refinery/cross.png +0 -0
- data/app/assets/images/refinery/dialogLoadingAnimation.gif +0 -0
- data/app/assets/images/refinery/header_background.png +0 -0
- data/app/assets/images/refinery/hover-gradient.jpg +0 -0
- data/app/assets/images/refinery/icons/accept.png +0 -0
- data/app/assets/images/refinery/icons/add.png +0 -0
- data/app/assets/images/refinery/icons/ajax-loader.gif +0 -0
- data/app/assets/images/refinery/icons/application_edit.png +0 -0
- data/app/assets/images/refinery/icons/application_go.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left.png +0 -0
- data/app/assets/images/refinery/icons/arrow_left_right.png +0 -0
- data/app/assets/images/refinery/icons/arrow_switch.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up.png +0 -0
- data/app/assets/images/refinery/icons/arrow_up_down.png +0 -0
- data/app/assets/images/refinery/icons/bin.png +0 -0
- data/app/assets/images/refinery/icons/bin_closed.png +0 -0
- data/app/assets/images/refinery/icons/cancel.png +0 -0
- data/app/assets/images/refinery/icons/cog_add.png +0 -0
- data/app/assets/images/refinery/icons/cog_edit.png +0 -0
- data/app/assets/images/refinery/icons/cross.png +0 -0
- data/app/assets/images/refinery/icons/delete.png +0 -0
- data/app/assets/images/refinery/icons/doc.png +0 -0
- data/app/assets/images/refinery/icons/down.gif +0 -0
- data/app/assets/images/refinery/icons/edit.png +0 -0
- data/app/assets/images/refinery/icons/email.png +0 -0
- data/app/assets/images/refinery/icons/email_edit.png +0 -0
- data/app/assets/images/refinery/icons/email_go.png +0 -0
- data/app/assets/images/refinery/icons/email_open.png +0 -0
- data/app/assets/images/refinery/icons/eye.png +0 -0
- data/app/assets/images/refinery/icons/folder.png +0 -0
- data/app/assets/images/refinery/icons/folder_open.png +0 -0
- data/app/assets/images/refinery/icons/folder_page_white.png +0 -0
- data/app/assets/images/refinery/icons/image_add.png +0 -0
- data/app/assets/images/refinery/icons/image_edit.png +0 -0
- data/app/assets/images/refinery/icons/img.png +0 -0
- data/app/assets/images/refinery/icons/information.png +0 -0
- data/app/assets/images/refinery/icons/layout_add.png +0 -0
- data/app/assets/images/refinery/icons/layout_edit.png +0 -0
- data/app/assets/images/refinery/icons/locale-blue.svg +15 -0
- data/app/assets/images/refinery/icons/locale.svg +11 -0
- data/app/assets/images/refinery/icons/music.png +0 -0
- data/app/assets/images/refinery/icons/page.png +0 -0
- data/app/assets/images/refinery/icons/page_add.png +0 -0
- data/app/assets/images/refinery/icons/page_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_edit.png +0 -0
- data/app/assets/images/refinery/icons/page_white_gear.png +0 -0
- data/app/assets/images/refinery/icons/page_white_put.png +0 -0
- data/app/assets/images/refinery/icons/pdf.png +0 -0
- data/app/assets/images/refinery/icons/ppt.png +0 -0
- data/app/assets/images/refinery/icons/star.png +0 -0
- data/app/assets/images/refinery/icons/tick.png +0 -0
- data/app/assets/images/refinery/icons/up.gif +0 -0
- data/app/assets/images/refinery/icons/user_add.png +0 -0
- data/app/assets/images/refinery/icons/user_comment.png +0 -0
- data/app/assets/images/refinery/icons/user_edit.png +0 -0
- data/app/assets/images/refinery/icons/xls.png +0 -0
- data/app/assets/images/refinery/icons/zip.png +0 -0
- data/app/assets/images/refinery/icons/zoom.png +0 -0
- data/app/assets/images/refinery/logo-large.png +0 -0
- data/app/assets/images/refinery/logo-medium.png +0 -0
- data/app/assets/images/refinery/logo-site-bar.png +0 -0
- data/app/assets/images/refinery/logo-small-medium.png +0 -0
- data/app/assets/images/refinery/logo-small.png +0 -0
- data/app/assets/images/refinery/logo-tiny.png +0 -0
- data/app/assets/images/refinery/logo.png +0 -0
- data/app/assets/images/refinery/nav-3-background.gif +0 -0
- data/app/assets/images/refinery/nav_inactive_background.png +0 -0
- data/app/assets/images/refinery/orange_button.png +0 -0
- data/app/assets/images/refinery/page_bg.png +0 -0
- data/app/assets/images/refinery/text_field_background.png +0 -0
- data/app/assets/images/refinery/tooltip-nib.gif +0 -0
- data/app/assets/images/refinery/tooltip-nib.png +0 -0
- data/app/assets/javascripts/admin.js +7 -6
- data/app/assets/javascripts/refinery/admin.js.erb +99 -60
- data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +2 -5
- data/app/assets/javascripts/refinery/application.js +8 -0
- data/app/assets/javascripts/refinery/core.js +4 -18
- data/app/assets/javascripts/refinery/interface.js.coffee.erb +5 -29
- data/app/assets/javascripts/refinery/modal_dialogs.js.erb +0 -105
- data/app/assets/javascripts/refinery/nestedsortables.js +183 -110
- data/app/assets/javascripts/refinery/refinery.js.erb +3 -9
- data/app/assets/javascripts/refinery/serializelist.js +1 -1
- data/app/assets/javascripts/refinery/site_bar.js +0 -5
- data/app/assets/javascripts/refinery/sortable_list.js +10 -11
- data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -1
- data/app/assets/stylesheets/application.scss +2 -0
- data/app/assets/stylesheets/refinery/_colours.scss +18 -0
- data/app/assets/stylesheets/refinery/_icons.scss +85 -0
- data/app/assets/stylesheets/refinery/{layout.css.scss → _layout.scss} +306 -338
- data/app/assets/stylesheets/refinery/_mixins.scss +84 -0
- data/app/assets/stylesheets/refinery/{submenu.css.scss → _submenu.scss} +2 -2
- data/app/assets/stylesheets/refinery/{tooltips.css.scss → _tooltips.scss} +0 -0
- data/app/assets/stylesheets/refinery/_ui.scss +252 -0
- data/app/assets/stylesheets/refinery/{formatting.css.scss → formatting.scss} +0 -0
- data/app/assets/stylesheets/refinery/refinery.scss +10 -0
- data/app/assets/stylesheets/refinery/site_bar.scss +126 -0
- data/app/assets/stylesheets/refinery/{theme.css.scss → theme.scss} +0 -0
- data/app/controllers/refinery/admin/core_controller.rb +2 -7
- data/app/controllers/refinery/admin/dialogs_controller.rb +4 -3
- data/app/controllers/refinery/admin_controller.rb +0 -1
- data/app/controllers/refinery/fast_controller.rb +0 -4
- data/app/helpers/refinery/admin/visual_editor_helper.rb +13 -0
- data/app/helpers/refinery/admin_helper.rb +4 -0
- data/app/helpers/refinery/custom_assets_helper.rb +2 -2
- data/app/helpers/refinery/image_helper.rb +9 -8
- data/app/helpers/refinery/meta_helper.rb +1 -1
- data/app/helpers/refinery/site_bar_helper.rb +16 -2
- data/app/helpers/refinery/tag_helper.rb +38 -5
- data/app/models/refinery/core/base_model.rb +3 -1
- data/app/views/layouts/refinery/admin.html.erb +12 -10
- data/app/views/layouts/refinery/admin_dialog.html.erb +1 -4
- data/app/views/refinery/_content_page.html.erb +1 -1
- data/app/views/refinery/_google_analytics.html.erb +8 -9
- data/app/views/refinery/_head.html.erb +1 -1
- data/app/views/refinery/_javascripts.html.erb +0 -15
- data/app/views/refinery/_message.html.erb +1 -1
- data/app/views/refinery/_site_bar.html.erb +9 -6
- data/app/views/refinery/admin/_error_messages.html.erb +4 -4
- data/app/views/refinery/admin/_form_actions.html.erb +1 -0
- data/app/views/refinery/admin/_form_advanced_options_menu.html.erb +3 -4
- data/app/views/refinery/admin/_head.html.erb +3 -0
- data/app/views/refinery/admin/_image_picker.html.erb +4 -5
- data/app/views/refinery/admin/_javascripts.html.erb +4 -9
- data/app/views/refinery/admin/_locale_picker.html.erb +9 -2
- data/app/views/refinery/admin/_make_sortable.html.erb +8 -6
- data/app/views/refinery/admin/_menu.html.erb +2 -15
- data/app/views/refinery/admin/_menu_item.html.erb +3 -0
- data/app/views/refinery/admin/_resource_picker.html.erb +12 -22
- data/app/views/refinery/admin/_search.html.erb +1 -1
- data/app/views/refinery/admin/_tabbed_fields.html.erb +2 -2
- data/app/views/refinery/admin/_wysiwyg.html.erb +1 -1
- data/{lib/generators/refinery/cms/templates/app/decorators/controllers/refinery/.gitkeep → app/views/refinery/admin/dialog_success.html.erb} +0 -0
- data/app/views/refinery/admin/dialogs/show.html.erb +1 -19
- data/config/initializers/assets.rb +6 -0
- data/config/locales/ca.yml +84 -0
- data/config/locales/cs.yml +12 -5
- data/config/locales/en.yml +6 -2
- data/config/locales/fr.yml +15 -11
- data/config/locales/hu.yml +3 -1
- data/config/locales/it.yml +5 -1
- data/config/locales/ja.yml +2 -2
- data/config/locales/pt.yml +5 -3
- data/config/locales/ru.yml +7 -0
- data/config/locales/sl.yml +0 -3
- data/config/locales/tr.yml +43 -41
- data/config/routes.rb +1 -4
- data/lib/generators/refinery/cms/cms_generator.rb +68 -26
- data/lib/generators/refinery/cms/templates/app/decorators/{models/refinery/.gitkeep → controllers/refinery/.keep} +0 -0
- data/lib/generators/refinery/{form/templates/.gitkeep → cms/templates/app/decorators/models/refinery/.keep} +0 -0
- data/lib/generators/refinery/cms/templates/config/database.yml.mysql +3 -3
- data/lib/generators/refinery/cms/templates/config/database.yml.postgresql +3 -3
- data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +18 -5
- data/lib/generators/refinery/dummy/dummy_generator.rb +3 -1
- data/lib/generators/refinery/dummy/templates/rails/application.js +3 -0
- data/lib/generators/refinery/dummy/templates/rails/application.rb.erb +0 -2
- data/lib/generators/refinery/dummy/templates/rails/blank.png +0 -0
- data/lib/generators/refinery/dummy/templates/rails/routes.rb +1 -1
- data/lib/generators/refinery/engine/engine_generator.rb +3 -2
- data/lib/generators/refinery/engine/templates/Gemfile +9 -4
- data/lib/generators/refinery/engine/templates/Rakefile +3 -4
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +11 -2
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +2 -2
- data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +5 -5
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_actions.html.erb +7 -12
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +8 -8
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +3 -3
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +6 -11
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +1 -1
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/plural_name/show.html.erb +4 -4
- data/lib/generators/refinery/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +2 -9
- data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +13 -19
- data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb +0 -4
- data/lib/generators/refinery/engine/templates/readme.md +3 -3
- data/lib/generators/refinery/engine/templates/refinerycms-extension_plural_name.gemspec +1 -0
- data/lib/generators/refinery/engine/templates/spec/features/refinery/namespace/admin/plural_name_spec.rb.erb +25 -28
- data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/singular_name_spec.rb.erb +1 -1
- data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +1 -1
- data/lib/refinery.rb +7 -9
- data/lib/refinery/admin/base_controller.rb +42 -32
- data/lib/refinery/application_controller.rb +25 -17
- data/lib/refinery/cli.rb +54 -19
- data/lib/refinery/core.rb +5 -0
- data/lib/refinery/core/authorisation_adapter.rb +11 -0
- data/lib/refinery/core/authorisation_manager.rb +14 -0
- data/lib/refinery/core/configuration.rb +25 -4
- data/lib/refinery/core/default_route.rb +16 -0
- data/lib/refinery/core/engine.rb +44 -25
- data/lib/refinery/core/nil_user.rb +42 -0
- data/lib/refinery/crud.rb +40 -29
- data/lib/refinery/extension_generation.rb +11 -22
- data/lib/refinery/generators/generated_attribute.rb +54 -0
- data/lib/refinery/generators/named_base.rb +16 -0
- data/lib/refinery/menu.rb +3 -2
- data/lib/refinery/menu_item.rb +1 -1
- data/lib/refinery/plugin.rb +27 -43
- data/lib/refinery/plugins.rb +22 -26
- data/lib/refinery/users_manager.rb +8 -0
- data/lib/refinery/version.rb +7 -3
- data/lib/tasks/refinery.rake +7 -0
- data/license.md +1 -1
- data/refinerycms-core.gemspec +11 -8
- data/spec/controllers/refinery/admin/dummy_controller_spec.rb +23 -11
- data/spec/controllers/refinery/sitemap_controller_spec.rb +2 -2
- data/spec/features/refinery/admin/custom_assets_spec.rb +12 -10
- data/spec/features/refinery/admin/dialogs_spec.rb +5 -5
- data/spec/features/refinery/admin/xhr_paging_spec.rb +24 -38
- data/spec/features/refinery/application_layout_spec.rb +3 -3
- data/spec/features/refinery/core_spec.rb +1 -1
- data/spec/features/refinery/site_bar_spec.rb +44 -23
- data/spec/helpers/refinery/admin_helper_spec.rb +15 -0
- data/spec/helpers/refinery/custom_assets_helper_spec.rb +15 -23
- data/spec/helpers/refinery/html_truncation_helper_spec.rb +10 -5
- data/spec/helpers/refinery/meta_helper_spec.rb +3 -3
- data/spec/helpers/refinery/pagination_helper_spec.rb +7 -7
- data/spec/helpers/refinery/tag_helper_spec.rb +4 -4
- data/spec/helpers/refinery/translation_helper_spec.rb +3 -3
- data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +30 -25
- data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +7 -8
- data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +15 -15
- data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -9
- data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
- data/spec/lib/refinery/application_controller_spec.rb +16 -16
- data/spec/lib/refinery/authorisation_manager_spec.rb +10 -0
- data/spec/lib/refinery/cli_spec.rb +83 -21
- data/spec/lib/refinery/core/configuration_spec.rb +5 -5
- data/spec/lib/refinery/core/nil_user_spec.rb +39 -0
- data/spec/lib/refinery/core_spec.rb +39 -30
- data/spec/lib/refinery/crud_spec.rb +70 -59
- data/spec/lib/refinery/menu_spec.rb +4 -4
- data/spec/lib/refinery/plugin_spec.rb +56 -45
- data/spec/lib/refinery/plugins_spec.rb +39 -87
- data/spec/lib/refinery/users_manager_spec.rb +9 -0
- data/spec/support/refinery.rb +3 -8
- data/vendor/assets/fonts/font-awesome/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.svg +565 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/stylesheets/_font-awesome-compass.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome-sprockets.scss +5 -0
- data/vendor/assets/stylesheets/_font-awesome.scss +17 -0
- data/vendor/assets/stylesheets/font-awesome/_animated.scss +34 -0
- data/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
- data/vendor/assets/stylesheets/font-awesome/_core.scss +12 -0
- data/vendor/assets/stylesheets/font-awesome/_extras.scss +44 -0
- data/vendor/assets/stylesheets/font-awesome/_fixed-width.scss +6 -0
- data/vendor/assets/stylesheets/font-awesome/_icons.scss +596 -0
- data/vendor/assets/stylesheets/font-awesome/_larger.scss +13 -0
- data/vendor/assets/stylesheets/font-awesome/_list.scss +19 -0
- data/vendor/assets/stylesheets/font-awesome/_mixins.scss +26 -0
- data/vendor/assets/stylesheets/font-awesome/_path.scss +14 -0
- data/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_stacked.scss +20 -0
- data/vendor/assets/stylesheets/font-awesome/_variables.scss +606 -0
- metadata +144 -441
- data/app/assets/images/refinery/carousel-left.png +0 -0
- data/app/assets/images/refinery/carousel-right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/eye.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/article.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/aside.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/command.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/details.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figcaption.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/figure.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/footer.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/header.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/hgroup.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/mark.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/meter.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/nav.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/progress.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/readme.md +0 -1
- data/app/assets/images/wymeditor/skins/refinery/html5/rp.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/rt.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/ruby.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/section.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/summary.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/html5/time.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/link_break.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_code.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/page_paste.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/photo_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/style.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/table_add.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_center.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_left.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_align_right.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_bold.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_italic.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_subscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_superscript.png +0 -0
- data/app/assets/images/wymeditor/skins/refinery/text_underline.png +0 -0
- data/app/assets/images/wymeditor/skins/wymeditor_icon.png +0 -0
- data/app/assets/javascripts/refinery/boot_wym.js.erb +0 -285
- data/app/assets/javascripts/refinery/sortable_menu.js.coffee.erb +0 -20
- data/app/assets/javascripts/refinery/wymeditor.js +0 -37
- data/app/assets/javascripts/wymeditor/GPL-license.txt +0 -278
- data/app/assets/javascripts/wymeditor/MIT-license.txt +0 -20
- data/app/assets/javascripts/wymeditor/README +0 -35
- data/app/assets/javascripts/wymeditor/browsers/ie.js.erb +0 -224
- data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +0 -292
- data/app/assets/javascripts/wymeditor/browsers/opera.js.erb +0 -123
- data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +0 -283
- data/app/assets/javascripts/wymeditor/classes.js.erb +0 -1575
- data/app/assets/javascripts/wymeditor/functions.js.erb +0 -222
- data/app/assets/javascripts/wymeditor/lang/bg.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/ca.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/cs.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/da.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/de.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/en.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/es.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/fa.js +0 -46
- data/app/assets/javascripts/wymeditor/lang/fi.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/fr.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/he.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/hu.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/it.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/ja.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/lv.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/nb.js +0 -48
- data/app/assets/javascripts/wymeditor/lang/nl.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/nn.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/pl.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/pt-BR.js +0 -58
- data/app/assets/javascripts/wymeditor/lang/pt.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/rs.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/ru.js +0 -57
- data/app/assets/javascripts/wymeditor/lang/sk.js +0 -56
- data/app/assets/javascripts/wymeditor/lang/sl.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/sv.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/tr.js +0 -45
- data/app/assets/javascripts/wymeditor/lang/vi.js +0 -47
- data/app/assets/javascripts/wymeditor/lang/zh-CN.js +0 -47
- data/app/assets/javascripts/wymeditor/prototypes.js.erb +0 -1103
- data/app/assets/javascripts/wymeditor/setup.js.erb +0 -622
- data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +0 -45
- data/app/assets/javascripts/wymeditor/validators.js.erb +0 -777
- data/app/assets/stylesheets/refinery/refinery.css +0 -15
- data/app/assets/stylesheets/refinery/site_bar.css.scss +0 -92
- data/app/assets/stylesheets/refinery/ui.css.scss +0 -103
- data/app/assets/stylesheets/wymeditor/skins/refinery/skin.css.scss +0 -530
- data/app/assets/stylesheets/wymeditor/skins/refinery/wymiframe.css.scss +0 -156
- data/app/helpers/refinery/admin/core_helper.rb +0 -6
- data/app/helpers/refinery/admin/dialogs_helper.rb +0 -6
- data/app/helpers/refinery/fast_helper.rb +0 -4
- data/app/helpers/refinery/sitemap_helper.rb +0 -4
- data/app/views/refinery/wymiframe.html.erb +0 -14
- data/lib/generators/refinery/form/USAGE +0 -20
- data/lib/generators/refinery/form/form_generator.rb +0 -25
- data/lib/generators/refinery/form/templates/.gitignore +0 -2
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +0 -54
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +0 -45
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/plural_name_controller.rb.erb +0 -53
- data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/mailer.rb.erb +0 -22
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/setting.rb.erb +0 -34
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/singular_name.rb.erb +0 -49
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +0 -23
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +0 -25
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_submenu.html.erb +0 -29
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +0 -4
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/show.html.erb +0 -52
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/spam.html.erb +0 -27
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +0 -51
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +0 -21
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/edit.html.erb +0 -5
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/confirmation.html.erb +0 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/mailer/notification.html.erb +0 -17
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +0 -43
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/thank_you.html.erb +0 -1
- data/lib/generators/refinery/form/templates/config/locales/cs.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/da.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/de.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/en.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/es.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/fr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/it.yml +0 -66
- data/lib/generators/refinery/form/templates/config/locales/lv.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/nb.yml +0 -75
- data/lib/generators/refinery/form/templates/config/locales/nl.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/pt-BR.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/ru.yml +0 -77
- data/lib/generators/refinery/form/templates/config/locales/sk.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/sl.yml +0 -67
- data/lib/generators/refinery/form/templates/config/locales/tr.yml +0 -78
- data/lib/generators/refinery/form/templates/config/locales/zh-CN.yml +0 -78
- data/lib/generators/refinery/form/templates/config/routes.rb.erb +0 -26
- data/lib/generators/refinery/form/templates/db/migrate/1_create_plural_name.rb.erb +0 -39
- data/lib/generators/refinery/form/templates/db/seeds.rb.erb +0 -31
- data/lib/generators/refinery/form/templates/lib/generators/refinery/plural_name_generator.rb.erb +0 -20
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name.rb.erb +0 -18
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb +0 -27
- data/lib/generators/refinery/form/templates/lib/refinerycms-plural_name.rb.erb +0 -1
- data/lib/generators/refinery/form/templates/refinerycms-plural_name.gemspec +0 -16
- data/lib/generators/refinery/form/templates/script/rails +0 -10
- data/lib/refinery/activity.rb +0 -113
- data/lib/refinery/ext/action_view/helpers/form_builder.rb +0 -9
- data/lib/refinery/ext/action_view/helpers/form_helper.rb +0 -20
- data/lib/refinery/ext/action_view/helpers/form_tag_helper.rb +0 -10
- data/spec/controllers/refinery/admin/refinery_core_controller_spec.rb +0 -19
- data/spec/controllers/refinery/fast_controller_spec.rb +0 -12
- data/spec/lib/generators/refinery/form/form_generator_spec.rb +0 -99
- data/spec/lib/refinery/activity_spec.rb +0 -46
- data/spec/support/background_selenium_firefox_driver.rb +0 -14
- data/vendor/assets/javascripts/jquery/jquery.jcarousel.js +0 -900
@@ -1,23 +1,28 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe HtmlTruncationHelper do
|
4
|
+
describe HtmlTruncationHelper, :type => :helper do
|
5
5
|
|
6
6
|
describe "#truncate" do
|
7
7
|
it "returns nil if text is not present" do
|
8
|
-
helper.truncate("").
|
8
|
+
expect(helper.truncate("")).to be_nil
|
9
9
|
end
|
10
10
|
|
11
11
|
context "when preserve_html_tags option is present" do
|
12
12
|
it "preserve html tags when truncating text" do
|
13
|
-
|
14
|
-
|
13
|
+
expect(
|
14
|
+
helper.truncate(
|
15
|
+
"<p>Turducken frankfurter ham hock bacon</p>",
|
16
|
+
preserve_html_tags: true
|
17
|
+
)
|
18
|
+
).to eq("<p>Turducken frankfurter ham...</p>")
|
15
19
|
end
|
16
20
|
end
|
17
21
|
|
18
22
|
context "when preserve_html_tags option is not present" do
|
19
23
|
it "falls back to original truncate method" do
|
20
|
-
|
24
|
+
expect(TruncateHtml::HtmlTruncator).not_to receive(:new)
|
25
|
+
helper.truncate("<p>Turducken frankfurter ham hock bacon</p>").html_safe
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe MetaHelper do
|
4
|
+
describe MetaHelper, :type => :helper do
|
5
5
|
|
6
6
|
describe '#canonical_id' do
|
7
7
|
context "when page doesn't exist" do
|
8
8
|
let(:page) { nil }
|
9
9
|
|
10
10
|
it 'returns nothing' do
|
11
|
-
helper.canonical_id(page).
|
11
|
+
expect(helper.canonical_id(page)).to be_nil
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -16,7 +16,7 @@ module Refinery
|
|
16
16
|
let(:page) { Page.new :slug => 'testing' }
|
17
17
|
|
18
18
|
it "returns the page's canonical slug with '-page' appended" do
|
19
|
-
helper.canonical_id(page).
|
19
|
+
expect(helper.canonical_id(page)).to eq(page.canonical_slug << '-page')
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -1,32 +1,32 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe PaginationHelper do
|
4
|
+
describe PaginationHelper, :type => :helper do
|
5
5
|
|
6
6
|
describe "#pagination_css_class" do
|
7
7
|
context "when request.xhr? and params[:from_page] is set" do
|
8
8
|
before do
|
9
|
-
controller.request.
|
9
|
+
allow(controller.request).to receive(:xhr?).and_return(true)
|
10
10
|
end
|
11
11
|
|
12
12
|
context "when params[:from_page] > params[:page] or 1" do
|
13
13
|
it "does something" do
|
14
|
-
helper.
|
15
|
-
helper.pagination_css_class.
|
14
|
+
allow(helper).to receive(:params).and_return({:from_page => 2, :page => 1})
|
15
|
+
expect(helper.pagination_css_class).to eq("frame_left")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
context "when params[:from_page] < params[:page] or 1" do
|
20
20
|
it "returns frame_right" do
|
21
|
-
helper.
|
22
|
-
helper.pagination_css_class.
|
21
|
+
allow(helper).to receive(:params).and_return({:from_page => 1, :page => 1})
|
22
|
+
expect(helper.pagination_css_class).to eq("frame_right")
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
context "when request.xhr? and params[:from_page] isn't set" do
|
28
28
|
it "returns frame_center" do
|
29
|
-
helper.pagination_css_class.
|
29
|
+
expect(helper.pagination_css_class).to eq("frame_center")
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe TagHelper do
|
4
|
+
describe TagHelper, :type => :helper do
|
5
5
|
|
6
6
|
describe "#refinery_help_tag" do
|
7
7
|
it "makes title html_safe if it's not already" do
|
8
|
-
helper.refinery_help_tag("<br /> ugisozols").
|
8
|
+
expect(helper.refinery_help_tag("<br /> ugisozols")).to match(/<br \/> ugisozols/)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe "#refinery_icon_tag" do
|
13
13
|
it "appends .png to filename if specified string has no dots in it" do
|
14
|
-
helper.refinery_icon_tag("ugisozols").
|
14
|
+
expect(helper.refinery_icon_tag("ugisozols")).to match(/ugisozols\.png/)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "wraps image_tag with some options preset" do
|
18
|
-
helper.refinery_icon_tag("ugis.ozols.jpg").
|
18
|
+
expect(helper.refinery_icon_tag("ugis.ozols.jpg")).to xml_eq(%Q{<img alt="Ugis.ozols" height="16" src="/images/refinery/icons/ugis.ozols.jpg" width="16" />})
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module Refinery
|
4
|
-
describe TranslationHelper do
|
4
|
+
describe TranslationHelper, :type => :helper do
|
5
5
|
|
6
6
|
describe "#t" do
|
7
7
|
it "overrides Rails' translation method" do
|
8
|
-
helper.t("ugisozols").
|
9
|
-
helper.t("ugisozols.test").
|
8
|
+
expect(helper.t("ugisozols")).to eq("i18n: Ugisozols")
|
9
|
+
expect(helper.t("ugisozols.test")).to eq("i18n: Test")
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'generator_spec/
|
2
|
+
require 'generator_spec/generator_example_group'
|
3
3
|
require 'generators/refinery/cms/cms_generator'
|
4
4
|
|
5
5
|
module Refinery
|
6
6
|
describe CmsGenerator do
|
7
|
-
include GeneratorSpec::TestCase
|
8
7
|
destination File.expand_path("../../../../../../tmp", __FILE__)
|
9
8
|
|
10
9
|
before do
|
@@ -12,24 +11,19 @@ module Refinery
|
|
12
11
|
|
13
12
|
dir = "#{destination_root}/config/environments"
|
14
13
|
FileUtils.mkdir_p(dir)
|
15
|
-
File.
|
16
|
-
file.write <<-SPEC
|
14
|
+
File.write "#{dir}/development.rb", <<-SPEC
|
17
15
|
Dummy::Application.configure do
|
18
16
|
config.action_mailer.test = true
|
19
17
|
end
|
20
|
-
|
21
|
-
end
|
18
|
+
SPEC
|
22
19
|
|
23
|
-
File.
|
24
|
-
file.write <<-SPEC
|
20
|
+
File.write "#{dir}/test.rb", <<-SPEC
|
25
21
|
Dummy::Application.configure do
|
26
22
|
# config.action_mailer.test = true
|
27
23
|
end
|
28
|
-
|
29
|
-
end
|
24
|
+
SPEC
|
30
25
|
|
31
|
-
File.
|
32
|
-
file.write <<-SPEC
|
26
|
+
File.write "#{dir}/production.rb", <<-SPEC
|
33
27
|
Dummy::Application.configure do
|
34
28
|
config.action_mailer.test = true
|
35
29
|
config.action_mailer.check = {
|
@@ -37,24 +31,24 @@ Dummy::Application.configure do
|
|
37
31
|
:check => true
|
38
32
|
}
|
39
33
|
end
|
40
|
-
|
41
|
-
end
|
34
|
+
SPEC
|
42
35
|
|
36
|
+
copy_routes
|
43
37
|
run_generator %w[--skip-db --skip-migrations]
|
44
38
|
end
|
45
39
|
|
46
40
|
specify do
|
47
|
-
destination_root.
|
41
|
+
expect(destination_root).to have_structure {
|
48
42
|
directory "app" do
|
49
43
|
directory "decorators" do
|
50
44
|
directory "controllers" do
|
51
45
|
directory "refinery" do
|
52
|
-
file ".
|
46
|
+
file ".keep"
|
53
47
|
end
|
54
48
|
end
|
55
49
|
directory "models" do
|
56
50
|
directory "refinery" do
|
57
|
-
file ".
|
51
|
+
file ".keep"
|
58
52
|
end
|
59
53
|
end
|
60
54
|
end
|
@@ -74,20 +68,17 @@ end
|
|
74
68
|
|
75
69
|
describe "#ensure_environments_are_sane" do
|
76
70
|
it "wraps single line config.action_mailer setting" do
|
77
|
-
File.
|
78
|
-
file.read.should eq <<-SPEC
|
71
|
+
expect(File.read("#{destination_root}/config/environments/development.rb")).to eq <<-SPEC
|
79
72
|
Dummy::Application.configure do
|
80
73
|
if config.respond_to?(:action_mailer)
|
81
74
|
config.action_mailer.test = true
|
82
75
|
end
|
83
76
|
end
|
84
|
-
|
85
|
-
end
|
77
|
+
SPEC
|
86
78
|
end
|
87
79
|
|
88
80
|
it "wraps multi line config.action_mailer settings" do
|
89
|
-
File.
|
90
|
-
file.read.should eq <<-SPEC
|
81
|
+
expect(File.read("#{destination_root}/config/environments/production.rb")).to eq <<-SPEC
|
91
82
|
Dummy::Application.configure do
|
92
83
|
if config.respond_to?(:action_mailer)
|
93
84
|
config.action_mailer.test = true
|
@@ -97,9 +88,23 @@ Dummy::Application.configure do
|
|
97
88
|
}
|
98
89
|
end
|
99
90
|
end
|
100
|
-
|
101
|
-
|
91
|
+
SPEC
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "#mount!" do
|
96
|
+
it 'adds Refinery to routes.rb' do
|
97
|
+
expect(File.read("#{destination_root}/config/routes.rb")).to match /Refinery/
|
102
98
|
end
|
103
99
|
end
|
100
|
+
|
101
|
+
def copy_routes
|
102
|
+
routes = File.join(Gem.loaded_specs['railties'].full_gem_path, 'lib', 'rails', 'generators', 'rails', 'app', 'templates', 'config', 'routes.rb')
|
103
|
+
destination = File.join(destination_root, "config")
|
104
|
+
|
105
|
+
FileUtils.mkdir_p(destination)
|
106
|
+
FileUtils.cp routes, destination
|
107
|
+
end
|
108
|
+
|
104
109
|
end
|
105
110
|
end
|
@@ -19,7 +19,7 @@ module Refinery
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "uses the extension name for the namespace" do
|
22
|
-
destination_root.
|
22
|
+
expect(destination_root).to have_structure {
|
23
23
|
directory "vendor" do
|
24
24
|
directory "extensions" do
|
25
25
|
directory "rspec_product_tests" do
|
@@ -46,7 +46,7 @@ module Refinery
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "creates a new migration with the new resource" do
|
49
|
-
destination_root.
|
49
|
+
expect(destination_root).to have_structure {
|
50
50
|
directory "vendor" do
|
51
51
|
directory "extensions" do
|
52
52
|
directory "rspec_product_tests" do
|
@@ -62,17 +62,16 @@ module Refinery
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "appends existing seeds file" do
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/db/seeds.rb") do |file|
|
66
|
+
expect(file.grep(%r{/rspec_product_tests|/rspec_item_tests}).count).to eq(2)
|
67
|
+
end
|
68
|
+
end
|
69
69
|
|
70
70
|
it "appends routes to the routes file" do
|
71
71
|
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/config/routes.rb") do |file|
|
72
|
-
file.grep(%r{rspec_item_tests}).count.
|
72
|
+
expect(file.grep(%r{rspec_item_tests}).count).to eq(2)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
76
|
-
|
77
76
|
end
|
78
77
|
end
|
@@ -9,39 +9,39 @@ module Refinery
|
|
9
9
|
it "exits when reserved word is used for extension name" do
|
10
10
|
clash_keywords = YAML.load_file(File.expand_path("../../../../../../lib/generators/refinery/clash_keywords.yml", __FILE__))
|
11
11
|
clash_keywords.each do |word|
|
12
|
-
|
13
|
-
STDERR.
|
12
|
+
expect {
|
13
|
+
expect(STDERR).to receive(:puts).with("\nPlease choose a different name. The generated code would fail for class '#{word}' as it conflicts with a reserved keyword.\n\n")
|
14
14
|
run_generator [word, "title:string"]
|
15
|
-
}.
|
15
|
+
}.to raise_error(SystemExit)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
it "exits when plural word is used for extension name" do
|
20
|
-
|
21
|
-
STDERR.
|
20
|
+
expect {
|
21
|
+
expect(STDERR).to receive(:puts).with("\nPlease specify the singular name 'apple' instead of 'apples'.\n\n")
|
22
22
|
run_generator %w{ apples title:string }
|
23
|
-
}.
|
23
|
+
}.to raise_error(SystemExit)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "exits when uncountable word is used for extension name" do
|
27
|
-
|
28
|
-
STDERR.
|
27
|
+
expect {
|
28
|
+
expect(STDERR).to receive(:puts).with("\nThe extension name you specified will not work as the singular name is equal to the plural name.\n\n")
|
29
29
|
run_generator %w{ money title:string }
|
30
|
-
}.
|
30
|
+
}.to raise_error(SystemExit)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "exits when no attribute provided" do
|
34
|
-
|
35
|
-
STDERR.
|
34
|
+
expect {
|
35
|
+
expect(STDERR).to receive(:puts).with("\nYou must specify a name and at least one field.\nFor help, run: rails generate refinery:engine\n\n")
|
36
36
|
run_generator %w{ car }
|
37
|
-
}.
|
37
|
+
}.to raise_error(SystemExit)
|
38
38
|
end
|
39
39
|
|
40
40
|
it "exits when '--extension' option is used but there is no extension by provided name" do
|
41
|
-
|
42
|
-
STDERR.
|
41
|
+
expect {
|
42
|
+
expect(STDERR).to receive(:puts).with("\nYou can't use '--extension nonexistent' because an extension with the name 'nonexistent' doesn't exist.\n\n")
|
43
43
|
run_generator %w{ car title:string --extension nonexistent }
|
44
|
-
}.
|
44
|
+
}.to raise_error(SystemExit)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -12,8 +12,16 @@ module Refinery
|
|
12
12
|
run_generator %w{ rspec_product_test title:string description:text image:image brochure:resource }
|
13
13
|
end
|
14
14
|
|
15
|
+
it "uses reference columns for image and resource attributes" do
|
16
|
+
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/app/controllers/refinery/rspec_product_tests/admin/rspec_product_tests_controller.rb") do |file|
|
17
|
+
content = file.read
|
18
|
+
expect(content.include?('image_id')).to be_truthy
|
19
|
+
expect(content.include?('brochure_id')).to be_truthy
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
15
23
|
specify do
|
16
|
-
destination_root.
|
24
|
+
expect(destination_root).to have_structure {
|
17
25
|
directory "vendor" do
|
18
26
|
directory "extensions" do
|
19
27
|
directory "rspec_product_tests" do
|
@@ -141,13 +149,5 @@ module Refinery
|
|
141
149
|
end
|
142
150
|
}
|
143
151
|
end
|
144
|
-
|
145
|
-
describe "attr_accessible" do
|
146
|
-
it "adds attributes to the list" do
|
147
|
-
File.open("#{destination_root}/vendor/extensions/rspec_product_tests/app/models/refinery/rspec_product_tests/rspec_product_test.rb") do |file|
|
148
|
-
file.grep(%r{attr_accessible :title, :description, :image_id, :brochure_id, :position}).count.should eq(1)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
152
|
end
|
153
153
|
end
|
@@ -13,7 +13,7 @@ module Refinery
|
|
13
13
|
Rails.application.reload_routes!
|
14
14
|
end
|
15
15
|
|
16
|
-
controller do
|
16
|
+
controller(ActionController::Base) do
|
17
17
|
include ::Refinery::ApplicationController
|
18
18
|
|
19
19
|
def index
|
@@ -23,46 +23,46 @@ module Refinery
|
|
23
23
|
|
24
24
|
describe ".home_page?" do
|
25
25
|
it "matches root url" do
|
26
|
-
controller.
|
27
|
-
request.
|
28
|
-
controller.home_page
|
26
|
+
allow(controller).to receive(:root_path).and_return("/")
|
27
|
+
allow(request).to receive(:path).and_return("/")
|
28
|
+
expect(controller.home_page?).to be_truthy
|
29
29
|
end
|
30
30
|
|
31
31
|
it "matches localised root url" do
|
32
|
-
controller.refinery.
|
33
|
-
request.
|
34
|
-
controller.home_page
|
32
|
+
allow(controller.refinery).to receive(:root_path).and_return("/en/")
|
33
|
+
allow(request).to receive(:path).and_return("/en")
|
34
|
+
expect(controller.home_page?).to be_truthy
|
35
35
|
end
|
36
36
|
|
37
37
|
it "matches localised root url with trailing slash" do
|
38
|
-
controller.refinery.
|
39
|
-
request.
|
40
|
-
controller.home_page
|
38
|
+
allow(controller.refinery).to receive(:root_path).and_return("/en/")
|
39
|
+
allow(request).to receive(:path).and_return("/en/")
|
40
|
+
expect(controller.home_page?).to be_truthy
|
41
41
|
end
|
42
42
|
|
43
43
|
it "escapes regexp" do
|
44
|
-
request.
|
44
|
+
allow(request).to receive(:path).and_return("\/huh)")
|
45
45
|
expect { controller.home_page? }.to_not raise_error
|
46
46
|
end
|
47
47
|
|
48
48
|
it "returns false for non root url" do
|
49
|
-
request.
|
50
|
-
controller.
|
49
|
+
allow(request).to receive(:path).and_return("/foo/")
|
50
|
+
expect(controller).not_to be_home_page
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe "#presenter_for" do
|
55
55
|
it "returns BasePresenter for nil" do
|
56
|
-
controller.send(:presenter_for, nil).
|
56
|
+
expect(controller.send(:presenter_for, nil)).to eq(BasePresenter)
|
57
57
|
end
|
58
58
|
|
59
59
|
it "returns BasePresenter when the instance's class does not have a presenter" do
|
60
|
-
controller.send(:presenter_for, Object.new).
|
60
|
+
expect(controller.send(:presenter_for, Object.new)).to eq(BasePresenter)
|
61
61
|
end
|
62
62
|
|
63
63
|
it "returns the class's presenter when the instance's class has a presenter" do
|
64
64
|
model = Refinery::Page.new
|
65
|
-
controller.send(:presenter_for, model).
|
65
|
+
expect(controller.send(:presenter_for, model)).to eq(Refinery::PagePresenter)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|