releaf 0.1.2 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +19 -21
- data/lib/releaf.rb +1 -34
- data/lib/releaf/all.rb +3 -0
- data/lib/releaf/rspec.rb +4 -0
- data/lib/releaf/rspec/features_matchers.rb +76 -0
- data/lib/releaf/rspec/helpers.rb +227 -0
- data/lib/releaf/rspec/matchers.rb +16 -0
- data/lib/releaf/test.rb +5 -0
- data/spec/factories/author.rb +6 -0
- data/spec/factories/book.rb +5 -0
- data/spec/factories/chapter.rb +7 -0
- data/spec/factories/common.rb +5 -0
- data/spec/factories/home_page.rb +5 -0
- data/spec/factories/node.rb +43 -0
- data/spec/factories/node_route.rb +7 -0
- data/spec/factories/publisher.rb +5 -0
- data/spec/factories/role.rb +21 -0
- data/spec/factories/text_page.rb +5 -0
- data/spec/factories/user.rb +22 -0
- data/spec/rails_helper.rb +122 -0
- data/spec/spec_helper.rb +81 -24
- data/spec/support/controller_macros.rb +8 -0
- data/spec/support/excel_helpers.rb +63 -0
- data/spec/support/shared/service_includer.rb +9 -0
- data/spec/support/wait_steps.rb +23 -0
- metadata +141 -499
- data/README.md +0 -77
- data/Rakefile +0 -70
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/jquery-ui-1.9.2.custom/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/close.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/loading.gif +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/next.png +0 -0
- data/app/assets/images/releaf/3rd_party/lightbox/prev.png +0 -0
- data/app/assets/images/releaf/add.png +0 -0
- data/app/assets/images/releaf/background.jpg +0 -0
- data/app/assets/images/releaf/button/button_bgr.gif +0 -0
- data/app/assets/images/releaf/button/button_hover_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/close.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/close_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/content/global_fields_bgr.png +0 -0
- data/app/assets/images/releaf/controllers/content/open.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_2.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_active.gif +0 -0
- data/app/assets/images/releaf/controllers/content/open_hover.gif +0 -0
- data/app/assets/images/releaf/controllers/sessions/background.jpg +0 -0
- data/app/assets/images/releaf/controllers/sessions/logo.jpg +0 -0
- data/app/assets/images/releaf/expand_tool/close.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/close_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/loader.gif +0 -0
- data/app/assets/images/releaf/expand_tool/open.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_hover_shim.png +0 -0
- data/app/assets/images/releaf/expand_tool/open_shim.png +0 -0
- data/app/assets/images/releaf/favicon.ico +0 -0
- data/app/assets/images/releaf/globalFieldContainerBgr.png +0 -0
- data/app/assets/images/releaf/icons/129.png +0 -0
- data/app/assets/images/releaf/icons/130.png +0 -0
- data/app/assets/images/releaf/icons/accept.png +0 -0
- data/app/assets/images/releaf/icons/add.png +0 -0
- data/app/assets/images/releaf/icons/arrow_down.png +0 -0
- data/app/assets/images/releaf/icons/arrow_left.png +0 -0
- data/app/assets/images/releaf/icons/arrow_refresh.png +0 -0
- data/app/assets/images/releaf/icons/arrow_up.png +0 -0
- data/app/assets/images/releaf/icons/bin_empty.png +0 -0
- data/app/assets/images/releaf/icons/bullet_black.png +0 -0
- data/app/assets/images/releaf/icons/bullet_connect.png +0 -0
- data/app/assets/images/releaf/icons/bullet_start.png +0 -0
- data/app/assets/images/releaf/icons/bullet_tick.png +0 -0
- data/app/assets/images/releaf/icons/chrome.png +0 -0
- data/app/assets/images/releaf/icons/control_play.png +0 -0
- data/app/assets/images/releaf/icons/date.png +0 -0
- data/app/assets/images/releaf/icons/delete.png +0 -0
- data/app/assets/images/releaf/icons/disk.png +0 -0
- data/app/assets/images/releaf/icons/drag-handle.png +0 -0
- data/app/assets/images/releaf/icons/error.png +0 -0
- data/app/assets/images/releaf/icons/eye.png +0 -0
- data/app/assets/images/releaf/icons/firefox.png +0 -0
- data/app/assets/images/releaf/icons/google-not-available.gif +0 -0
- data/app/assets/images/releaf/icons/google.gif +0 -0
- data/app/assets/images/releaf/icons/keyboard.png +0 -0
- data/app/assets/images/releaf/icons/left_16.png +0 -0
- data/app/assets/images/releaf/icons/link.png +0 -0
- data/app/assets/images/releaf/icons/magnifier.png +0 -0
- data/app/assets/images/releaf/icons/notAllowed.png +0 -0
- data/app/assets/images/releaf/icons/page_white_add.png +0 -0
- data/app/assets/images/releaf/icons/page_white_edit.png +0 -0
- data/app/assets/images/releaf/icons/page_white_put.png +0 -0
- data/app/assets/images/releaf/icons/page_white_text.png +0 -0
- data/app/assets/images/releaf/icons/pencil.png +0 -0
- data/app/assets/images/releaf/icons/picture.png +0 -0
- data/app/assets/images/releaf/icons/right_16.png +0 -0
- data/app/assets/images/releaf/icons/tick.png +0 -0
- data/app/assets/images/releaf/icons/warning.png +0 -0
- data/app/assets/images/releaf/icons/world_go.png +0 -0
- data/app/assets/images/releaf/icons/world_link.png +0 -0
- data/app/assets/images/releaf/input/autocompleteExpandIcon.png +0 -0
- data/app/assets/images/releaf/input/input_bgr.gif +0 -0
- data/app/assets/images/releaf/language_root.png +0 -0
- data/app/assets/images/releaf/loader.gif +0 -0
- data/app/assets/images/releaf/logout.png +0 -0
- data/app/assets/images/releaf/main_menu/active_bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/bgr.png +0 -0
- data/app/assets/images/releaf/main_menu/hover_bgr.png +0 -0
- data/app/assets/images/releaf/module.png +0 -0
- data/app/assets/images/releaf/panel_layout/active_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_horizontal_bgr.png +0 -0
- data/app/assets/images/releaf/panel_layout/secondary_panel_vertical_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/selected_bgr.png +0 -0
- data/app/assets/images/releaf/releaf_table/th_bgr.gif +0 -0
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/README.md +0 -73
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/jquery.cookie.js +0 -47
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/server.js +0 -24
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.html +0 -19
- data/app/assets/javascripts/releaf/3rd_party/jquery-cookie/test.js +0 -80
- data/app/assets/javascripts/releaf/3rd_party/jquery-ui-timepicker-addon.js +0 -1882
- data/app/assets/javascripts/releaf/3rd_party/lightbox.js.erb +0 -379
- data/app/assets/javascripts/releaf/application.js +0 -14
- data/app/assets/javascripts/releaf/controllers/base.js +0 -130
- data/app/assets/javascripts/releaf/controllers/releaf/content.js +0 -90
- data/app/assets/javascripts/releaf/controllers/releaf/translations.js +0 -31
- data/app/assets/javascripts/releaf/include/continuous_scroll.js +0 -321
- data/app/assets/javascripts/releaf/include/field.type_autocomplete.js +0 -58
- data/app/assets/javascripts/releaf/include/field.type_date_or_datetime_or_time.js +0 -43
- data/app/assets/javascripts/releaf/include/field.type_richtext.js +0 -90
- data/app/assets/javascripts/releaf/include/localization.js +0 -12
- data/app/assets/javascripts/releaf/include/nested_fields.js +0 -64
- data/app/assets/javascripts/releaf/include/sortable.js +0 -29
- data/app/assets/javascripts/releaf/lib/request_url.js +0 -183
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-1.9.2.custom.css.erb +0 -464
- data/app/assets/stylesheets/releaf/3rd_party/jquery-ui-timepicker-addon.css +0 -10
- data/app/assets/stylesheets/releaf/3rd_party/lightbox.css.erb +0 -157
- data/app/assets/stylesheets/releaf/application.css.erb +0 -122
- data/app/assets/stylesheets/releaf/controllers/base.css.erb +0 -205
- data/app/assets/stylesheets/releaf/controllers/releaf/content.css.erb +0 -422
- data/app/assets/stylesheets/releaf/controllers/releaf/sessions.css.scss.erb +0 -116
- data/app/assets/stylesheets/releaf/controllers/releaf/translations.css.erb +0 -205
- data/app/assets/stylesheets/releaf/include/button.css.erb +0 -176
- data/app/assets/stylesheets/releaf/include/field.css.erb +0 -281
- data/app/assets/stylesheets/releaf/include/input.css.erb +0 -40
- data/app/assets/stylesheets/releaf/include/main_menu.css.erb +0 -66
- data/app/assets/stylesheets/releaf/include/pagination.css.erb +0 -29
- data/app/assets/stylesheets/releaf/include/panel_layout.css.erb +0 -251
- data/app/assets/stylesheets/releaf/include/releaf_table.css.erb +0 -112
- data/app/assets/stylesheets/releaf/include/sortable.css.erb +0 -12
- data/app/controllers/releaf/admins_controller.rb +0 -55
- data/app/controllers/releaf/application_controller.rb +0 -11
- data/app/controllers/releaf/base_application_controller.rb +0 -18
- data/app/controllers/releaf/base_controller.rb +0 -571
- data/app/controllers/releaf/content_controller.rb +0 -183
- data/app/controllers/releaf/roles_controller.rb +0 -38
- data/app/controllers/releaf/sessions_controller.rb +0 -27
- data/app/controllers/releaf/tinymce_assets_controller.rb +0 -26
- data/app/controllers/releaf/translations_controller.rb +0 -117
- data/app/helpers/releaf/admin_helper.rb +0 -59
- data/app/helpers/releaf/application_helper.rb +0 -4
- data/app/helpers/releaf/pagination_renderer.rb +0 -44
- data/app/helpers/releaf/releaf_devise_helper.rb +0 -8
- data/app/models/releaf/admin.rb +0 -60
- data/app/models/releaf/blank_node_base.rb +0 -29
- data/app/models/releaf/node.rb +0 -222
- data/app/models/releaf/node_base.rb +0 -31
- data/app/models/releaf/role.rb +0 -126
- data/app/models/releaf/tinymce_asset.rb +0 -6
- data/app/views/layouts/releaf/admin.html.haml +0 -57
- data/app/views/layouts/releaf/devise.html.haml +0 -32
- data/app/views/releaf/aliases/_edit.body.html.haml +0 -50
- data/app/views/releaf/aliases/_edit.header.html.haml +0 -19
- data/app/views/releaf/aliases/_index.row.html.haml +0 -5
- data/app/views/releaf/aliases/_secondary_panel.html.haml +0 -13
- data/app/views/releaf/base/_edit.body.html.haml +0 -11
- data/app/views/releaf/base/_edit.field.html.haml +0 -23
- data/app/views/releaf/base/_edit.field_type_autocomplete.html.haml +0 -15
- data/app/views/releaf/base/_edit.field_type_boolean.html.haml +0 -5
- data/app/views/releaf/base/_edit.field_type_date.html.haml +0 -8
- data/app/views/releaf/base/_edit.field_type_datetime.html.haml +0 -8
- data/app/views/releaf/base/_edit.field_type_delete_nested.html.haml +0 -3
- data/app/views/releaf/base/_edit.field_type_file.html.haml +0 -10
- data/app/views/releaf/base/_edit.field_type_image.html.haml +0 -12
- data/app/views/releaf/base/_edit.field_type_item.html.haml +0 -31
- data/app/views/releaf/base/_edit.field_type_link.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_link_i18n.html.haml +0 -26
- data/app/views/releaf/base/_edit.field_type_password.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_richtext.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_richtext_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_text.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_text_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_textarea.html.haml +0 -4
- data/app/views/releaf/base/_edit.field_type_textarea_i18n.html.haml +0 -27
- data/app/views/releaf/base/_edit.field_type_time.html.haml +0 -8
- data/app/views/releaf/base/_edit.fields.association.html.haml +0 -48
- data/app/views/releaf/base/_edit.fields.has_many_template.html.haml +0 -15
- data/app/views/releaf/base/_edit.fields.html.haml +0 -20
- data/app/views/releaf/base/_edit.footer.html.haml +0 -14
- data/app/views/releaf/base/_edit.form.html.haml +0 -4
- data/app/views/releaf/base/_edit.header.html.haml +0 -3
- data/app/views/releaf/base/_index.body.html.haml +0 -6
- data/app/views/releaf/base/_index.cell.html.haml +0 -20
- data/app/views/releaf/base/_index.footer.html.haml +0 -28
- data/app/views/releaf/base/_index.header.html.haml +0 -4
- data/app/views/releaf/base/_index.row.html.haml +0 -6
- data/app/views/releaf/base/_index.search.html.haml +0 -5
- data/app/views/releaf/base/_index.table.html.haml +0 -24
- data/app/views/releaf/base/_secondary_panel.html.haml +0 -10
- data/app/views/releaf/base/_show.body.html.haml +0 -3
- data/app/views/releaf/base/_show.field.html.haml +0 -20
- data/app/views/releaf/base/_show.field_type_date.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_date_time.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_email.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_file.html.haml +0 -7
- data/app/views/releaf/base/_show.field_type_image.html.haml +0 -10
- data/app/views/releaf/base/_show.field_type_item.html.haml +0 -11
- data/app/views/releaf/base/_show.field_type_link.html.haml +0 -14
- data/app/views/releaf/base/_show.field_type_password.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_richtext.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_text.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_textarea.html.haml +0 -6
- data/app/views/releaf/base/_show.field_type_time.html.haml +0 -9
- data/app/views/releaf/base/_show.field_type_url.html.haml +0 -7
- data/app/views/releaf/base/_show.fields.association.html.haml +0 -36
- data/app/views/releaf/base/_show.fields.has_many_template.html.haml +0 -12
- data/app/views/releaf/base/_show.fields.html.haml +0 -17
- data/app/views/releaf/base/_show.footer.html.haml +0 -18
- data/app/views/releaf/base/_show.header.html.haml +0 -3
- data/app/views/releaf/base/confirm_destroy.html.haml +0 -17
- data/app/views/releaf/base/edit.html.haml +0 -1
- data/app/views/releaf/base/index.html.haml +0 -3
- data/app/views/releaf/base/new.html.haml +0 -1
- data/app/views/releaf/base/show.html.haml +0 -3
- data/app/views/releaf/content/_edit.body.html.haml +0 -46
- data/app/views/releaf/content/_edit.content_fields.html.haml +0 -11
- data/app/views/releaf/content/_edit.fields.html.haml +0 -17
- data/app/views/releaf/content/_edit.slug.html.haml +0 -12
- data/app/views/releaf/content/_get_content_form.html.haml +0 -7
- data/app/views/releaf/content/_secondary_panel.html.haml +0 -3
- data/app/views/releaf/content/_tree_level.html.haml +0 -16
- data/app/views/releaf/content/ajax.new.html.haml +0 -3
- data/app/views/releaf/content/index.html.haml +0 -0
- data/app/views/releaf/roles/_edit.field.permissions.html.haml +0 -5
- data/app/views/releaf/roles/_show.field.default.html.haml +0 -6
- data/app/views/releaf/roles/_show.field.permissions.html.haml +0 -11
- data/app/views/releaf/sessions/new.html.haml +0 -17
- data/app/views/releaf/translations/_edit.body.html.haml +0 -50
- data/app/views/releaf/translations/_edit.header.html.haml +0 -19
- data/app/views/releaf/translations/_index.row.html.haml +0 -5
- data/app/views/releaf/translations/_secondary_panel.html.haml +0 -13
- data/bin/releaf +0 -25
- data/lib/generators/releaf/install_generator.rb +0 -87
- data/lib/generators/releaf/templates/config/common_fields.yml.example +0 -17
- data/lib/generators/releaf/templates/controllers/home_controller.rb +0 -4
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/jquery_ui/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/close.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/loading.gif +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/next.png +0 -0
- data/lib/generators/releaf/templates/images/3rd_party/lightbox/prev.png +0 -0
- data/lib/generators/releaf/templates/initializers/releaf.rb +0 -20
- data/lib/generators/releaf/templates/initializers/releaf_i18n.rb +0 -25
- data/lib/generators/releaf/templates/initializers/releaf_store_current_template.rb +0 -25
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery.jcarousel.js +0 -1058
- data/lib/generators/releaf/templates/javascripts/3rd_party/jquery_ui.js +0 -14850
- data/lib/generators/releaf/templates/javascripts/3rd_party/lightbox.js.erb +0 -379
- data/lib/generators/releaf/templates/javascripts/application.js +0 -15
- data/lib/generators/releaf/templates/javascripts/lib/init_jcarousel.js +0 -40
- data/lib/generators/releaf/templates/javascripts/lib/js_check.js +0 -8
- data/lib/generators/releaf/templates/javascripts/lib/request_url.js +0 -169
- data/lib/generators/releaf/templates/javascripts/lib/sortable.js +0 -29
- data/lib/generators/releaf/templates/migrations/create_releaf_admins.rb +0 -53
- data/lib/generators/releaf/templates/migrations/create_releaf_nodes.rb +0 -25
- data/lib/generators/releaf/templates/migrations/create_releaf_roles.rb +0 -12
- data/lib/generators/releaf/templates/migrations/create_releaf_tinymce_assets.rb +0 -11
- data/lib/generators/releaf/templates/migrations/create_releaf_translations.rb +0 -31
- data/lib/generators/releaf/templates/models/admin_ability.rb +0 -51
- data/lib/generators/releaf/templates/seeds.rb +0 -64
- data/lib/generators/releaf/templates/stylesheets/3rd_party/jquery_ui/smoothness.css.erb +0 -1174
- data/lib/generators/releaf/templates/stylesheets/3rd_party/lightbox.css.erb +0 -157
- data/lib/generators/releaf/templates/stylesheets/3rd_party/reset.css +0 -48
- data/lib/generators/releaf/templates/stylesheets/application.scss +0 -15
- data/lib/generators/releaf/templates/stylesheets/style.scss +0 -45
- data/lib/generators/releaf/templates/views/home/index.html.haml +0 -1
- data/lib/generators/releaf/templates/views/layouts/application.html.haml +0 -26
- data/lib/i18n/backend/releaf.rb +0 -97
- data/lib/i18n/backend/releaf/translation.rb +0 -61
- data/lib/i18n/backend/releaf/translation_data.rb +0 -39
- data/lib/i18n/backend/releaf/translation_group.rb +0 -34
- data/lib/i18n/releaf.rb +0 -1
- data/lib/releaf/boolean_at.rb +0 -77
- data/lib/releaf/engine.rb +0 -4
- data/lib/releaf/globalize3/fallbacks.rb +0 -19
- data/lib/releaf/resources.rb +0 -101
- data/lib/releaf/slug.rb +0 -118
- data/lib/releaf/version.rb +0 -3
- data/lib/tasks/releaf_tasks.rake +0 -4
- data/spec/factories/factories.rb +0 -24
- data/spec/features/admin_spec.rb +0 -41
- data/templates/releaf/installer.rb +0 -207
@@ -0,0 +1,43 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :node, class: ::Node do
|
3
|
+
sequence(:name) {|n| "node #{n}"}
|
4
|
+
sequence(:slug) {|n| "node-#{n}"}
|
5
|
+
content_type "HomePage"
|
6
|
+
end
|
7
|
+
|
8
|
+
factory :other_node, class: ::OtherSite::OtherNode do
|
9
|
+
sequence(:name) {|n| "node #{n}"}
|
10
|
+
sequence(:slug) {|n| "node-#{n}"}
|
11
|
+
content_type "HomePage"
|
12
|
+
end
|
13
|
+
|
14
|
+
factory :home_page_node, class: ::Node do
|
15
|
+
sequence(:name) {|n| "node #{n}"}
|
16
|
+
sequence(:slug) {|n| "node-#{n}"}
|
17
|
+
content_type "HomePage"
|
18
|
+
content_attributes ({ intro_text_html: "some <strong>STRRRONG</strong> text" })
|
19
|
+
end
|
20
|
+
|
21
|
+
factory :other_home_page_node, class: ::OtherSite::OtherNode do
|
22
|
+
sequence(:name) {|n| "node #{n}"}
|
23
|
+
sequence(:slug) {|n| "node-#{n}"}
|
24
|
+
content_type "HomePage"
|
25
|
+
content_attributes ({ intro_text_html: "some <strong>STRRRONG</strong> text" })
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
factory :text_page_node, class: ::Node do
|
30
|
+
sequence(:name) {|n| "node #{n}"}
|
31
|
+
sequence(:slug) {|n| "node-#{n}"}
|
32
|
+
content_type "TextPage"
|
33
|
+
content_attributes ({ text_html: "some <strong>STRIONG</strong> text" })
|
34
|
+
end
|
35
|
+
|
36
|
+
factory :other_text_page_node, class: ::OtherSite::OtherNode do
|
37
|
+
sequence(:name) {|n| "node #{n}"}
|
38
|
+
sequence(:slug) {|n| "node-#{n}"}
|
39
|
+
content_type "TextPage"
|
40
|
+
content_attributes ({ text_html: "some <strong>STRIONG</strong> text" })
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :roles, :class => Releaf::Permissions::Role do
|
3
|
+
sequence(:name) {|n| "role #{n}"}
|
4
|
+
|
5
|
+
factory :admin_role do
|
6
|
+
default_controller "releaf/permissions/users"
|
7
|
+
after(:create) do |role|
|
8
|
+
Releaf.application.config.available_controllers.each do|controller|
|
9
|
+
role.permissions.create!(permission: "controller.#{controller}")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
factory :content_role do
|
15
|
+
default_controller "admin/nodes"
|
16
|
+
after(:create) do |role|
|
17
|
+
role.permissions.create!(permission: "controller.admin/nodes")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :users, class: Releaf::Permissions::User do
|
3
|
+
trait :user_basic do
|
4
|
+
email
|
5
|
+
name
|
6
|
+
surname
|
7
|
+
locale 'en'
|
8
|
+
password 'password'
|
9
|
+
password_confirmation 'password'
|
10
|
+
end
|
11
|
+
|
12
|
+
factory :user do
|
13
|
+
user_basic
|
14
|
+
association :role, factory: :admin_role
|
15
|
+
end
|
16
|
+
|
17
|
+
factory :content_user do
|
18
|
+
user_basic
|
19
|
+
association :role, factory: :content_role
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'simplecov-rcov'
|
3
|
+
require 'coveralls'
|
4
|
+
require 'pry'
|
5
|
+
require 'pry-nav'
|
6
|
+
SimpleCov.command_name 'rspec'
|
7
|
+
|
8
|
+
Coveralls.wear!('rails')
|
9
|
+
|
10
|
+
if ENV["COVERAGE"]
|
11
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
12
|
+
SimpleCov::Formatter::HTMLFormatter,
|
13
|
+
SimpleCov::Formatter::RcovFormatter,
|
14
|
+
Coveralls::SimpleCov::Formatter
|
15
|
+
])
|
16
|
+
SimpleCov.start do
|
17
|
+
add_filter '/config/'
|
18
|
+
add_filter '/lib/tasks'
|
19
|
+
add_filter '/spec/'
|
20
|
+
add_filter '/app/assets/'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
ENV["RAILS_ENV"] ||= 'test'
|
25
|
+
require 'spec_helper'
|
26
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
27
|
+
require 'rspec/rails'
|
28
|
+
require 'factory_girl'
|
29
|
+
require "shoulda-matchers"
|
30
|
+
require 'db-query-matchers'
|
31
|
+
require 'capybara/poltergeist'
|
32
|
+
require 'with_model'
|
33
|
+
require 'timecop'
|
34
|
+
require 'with_model'
|
35
|
+
require 'database_cleaner'
|
36
|
+
require 'releaf/rspec'
|
37
|
+
require 'sass' # To stop these warnings: WARN: tilt autoloading 'sass' in a non thread-safe way; explicit require 'sass' suggested.
|
38
|
+
|
39
|
+
Rails.backtrace_cleaner.remove_silencers!
|
40
|
+
# Load support files
|
41
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
42
|
+
|
43
|
+
# for devise testing
|
44
|
+
include Warden::Test::Helpers
|
45
|
+
|
46
|
+
|
47
|
+
Capybara.register_driver :poltergeist do |app|
|
48
|
+
Capybara::Poltergeist::Driver.new(app, js_errors: true, inspector: true, phantomjs_logger: WarningSuppressor)
|
49
|
+
end
|
50
|
+
|
51
|
+
class WarningSuppressor
|
52
|
+
IGNOREABLE = /CoreText performance|userSpaceScaleFactor/
|
53
|
+
|
54
|
+
def write(message)
|
55
|
+
if message =~ IGNOREABLE
|
56
|
+
0
|
57
|
+
else
|
58
|
+
puts(message)
|
59
|
+
1
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
RSpec.configure do |config|
|
65
|
+
config.use_transactional_fixtures = false
|
66
|
+
config.infer_base_class_for_anonymous_controllers = false
|
67
|
+
config.order = "random"
|
68
|
+
config.infer_spec_type_from_file_location!
|
69
|
+
|
70
|
+
config.color = true
|
71
|
+
|
72
|
+
if ENV['COVERAGE']
|
73
|
+
config.add_formatter(:progress)
|
74
|
+
end
|
75
|
+
|
76
|
+
config.include Releaf::Test::Helpers
|
77
|
+
config.include WaitSteps
|
78
|
+
config.include ExcelHelpers
|
79
|
+
config.extend WithModel
|
80
|
+
|
81
|
+
config.include Rails.application.routes.url_helpers
|
82
|
+
|
83
|
+
# DEVISE
|
84
|
+
config.include Devise::Test::ControllerHelpers, type: :controller
|
85
|
+
config.extend ControllerMacros, type: :controller
|
86
|
+
config.include Devise::Test::ControllerHelpers, type: :helper
|
87
|
+
config.extend ControllerMacros, type: :helper
|
88
|
+
|
89
|
+
|
90
|
+
# FactoryGirl
|
91
|
+
config.include FactoryGirl::Syntax::Methods
|
92
|
+
|
93
|
+
Capybara.javascript_driver = :poltergeist
|
94
|
+
|
95
|
+
# disable empty translation creation
|
96
|
+
|
97
|
+
config.before(:each) do |example|
|
98
|
+
Rails.cache.clear
|
99
|
+
allow( Releaf.application.config.i18n_database ).to receive(:translation_auto_creation).and_return(false)
|
100
|
+
|
101
|
+
if example.metadata[:db_strategy]
|
102
|
+
DatabaseCleaner.strategy = example.metadata[:db_strategy]
|
103
|
+
elsif Capybara.current_driver == :rack_test
|
104
|
+
DatabaseCleaner.strategy = :transaction
|
105
|
+
else
|
106
|
+
DatabaseCleaner.strategy = :truncation
|
107
|
+
end
|
108
|
+
|
109
|
+
DatabaseCleaner.start
|
110
|
+
# set settings
|
111
|
+
I18n.locale = Releaf.application.config.available_locales.first
|
112
|
+
I18n.default_locale = Releaf.application.config.available_locales.first
|
113
|
+
end
|
114
|
+
|
115
|
+
config.after do
|
116
|
+
Timecop.return
|
117
|
+
DatabaseCleaner.clean
|
118
|
+
Releaf::Test.reset!
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each { |f| require f }
|
data/spec/spec_helper.rb
CHANGED
@@ -1,29 +1,86 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
require
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
17
|
RSpec.configure do |config|
|
17
|
-
config.
|
18
|
-
|
19
|
-
|
20
|
-
config.
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
21
31
|
|
22
|
-
#
|
23
|
-
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
24
40
|
|
25
|
-
|
26
|
-
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
59
|
+
# file, and it's useful to allow more verbose output when running an
|
60
|
+
# individual spec file.
|
61
|
+
if config.files_to_run.one?
|
62
|
+
# Use the documentation formatter for detailed output,
|
63
|
+
# unless a formatter has already been configured
|
64
|
+
# (e.g. via a command-line flag).
|
65
|
+
config.default_formatter = 'doc'
|
66
|
+
end
|
67
|
+
|
68
|
+
# Print the 10 slowest examples and example groups at the
|
69
|
+
# end of the spec run, to help surface which specs are running
|
70
|
+
# particularly slow.
|
71
|
+
config.profile_examples = 10
|
72
|
+
|
73
|
+
# Run specs in random order to surface order dependencies. If you find an
|
74
|
+
# order dependency and want to debug it, you can fix the order by providing
|
75
|
+
# the seed, which is printed after each run.
|
76
|
+
# --seed 1234
|
77
|
+
config.order = :random
|
78
|
+
|
79
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
80
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
81
|
+
# test failures related to randomization by passing the same `--seed` value
|
82
|
+
# as the one that triggered the failure.
|
83
|
+
Kernel.srand config.seed
|
84
|
+
=end
|
27
85
|
end
|
28
86
|
|
29
|
-
Dir["#{File.dirname(__FILE__)}/factories/*.rb"].each { |f| require f }
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module ExcelHelpers
|
2
|
+
class ExcelMatcher
|
3
|
+
require 'roo'
|
4
|
+
|
5
|
+
def initialize(fixture_path)
|
6
|
+
@fixture_path = fixture_path
|
7
|
+
@errors = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def matches?(actual_path)
|
11
|
+
match_excel(actual_path)
|
12
|
+
|
13
|
+
@errors.empty?
|
14
|
+
end
|
15
|
+
|
16
|
+
def failure_message
|
17
|
+
"Following cells differ from expected: #{error_messages}"
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def error_messages
|
23
|
+
messages = []
|
24
|
+
@errors.each do |error|
|
25
|
+
messages << "#{error[:cell]} (expect: #{error[:fixture_value]} was: #{error[:actual_value]})"
|
26
|
+
end
|
27
|
+
|
28
|
+
messages.join(', ')
|
29
|
+
end
|
30
|
+
|
31
|
+
def match_excel actual_path
|
32
|
+
fixture = Roo::Spreadsheet.open(@fixture_path)
|
33
|
+
fixture.default_sheet = fixture.sheets.first
|
34
|
+
|
35
|
+
actual = Roo::Spreadsheet.open(actual_path)
|
36
|
+
actual.default_sheet = actual.sheets.first
|
37
|
+
|
38
|
+
match_sheet(actual, fixture)
|
39
|
+
end
|
40
|
+
|
41
|
+
def match_sheet actual, fixture
|
42
|
+
rows = fixture.first_row..fixture.last_row
|
43
|
+
columns = fixture.first_column..fixture.last_column
|
44
|
+
for row in rows
|
45
|
+
for column in columns
|
46
|
+
fixture_value = fixture.cell(row, column)
|
47
|
+
actual_value = actual.cell(row, column)
|
48
|
+
if fixture_value != actual_value
|
49
|
+
@errors << {
|
50
|
+
cell: "#{Roo::Base.number_to_letter(column)}#{row}",
|
51
|
+
fixture_value: fixture_value,
|
52
|
+
actual_value: actual_value
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def match_excel(fixture_path)
|
61
|
+
ExcelMatcher.new(fixture_path)
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require "timeout"
|
2
|
+
|
3
|
+
module WaitSteps
|
4
|
+
extend RSpec::Matchers::DSL
|
5
|
+
|
6
|
+
matcher :become_true do
|
7
|
+
match do |block|
|
8
|
+
begin
|
9
|
+
Timeout.timeout(Capybara.default_max_wait_time) do
|
10
|
+
sleep(0.1) until value = block.call
|
11
|
+
sleep(0.2)
|
12
|
+
value
|
13
|
+
end
|
14
|
+
rescue TimeoutError
|
15
|
+
false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def supports_block_expectations?
|
20
|
+
true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|