middleman-core 3.1.0.rc.2 → 3.1.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +2 -1
- data/features/capture_html.feature +18 -0
- data/features/content_for.feature +3 -3
- data/features/v4_extension_callbacks.feature +8 -0
- data/fixtures/capture-html-app/config.rb +7 -0
- data/fixtures/capture-html-app/source/capture_html_erb.html.erb +5 -0
- data/fixtures/capture-html-app/source/capture_html_haml.html.haml +4 -0
- data/fixtures/capture-html-app/source/capture_html_slim.html.slim +4 -0
- data/fixtures/capture-html-app/source/layouts/capture_html.erb +4 -0
- data/fixtures/content-for-app/source/content_for_erb.html.erb +1 -1
- data/fixtures/content-for-app/source/content_for_haml.html.haml +1 -1
- data/fixtures/content-for-app/source/content_for_slim.html.slim +2 -1
- data/fixtures/v4-extension-callbacks/config.rb +26 -0
- data/fixtures/v4-extension-callbacks/source/index.html.erb +2 -0
- data/lib/middleman-core/core_extensions/extensions.rb +6 -1
- data/lib/middleman-core/core_extensions/file_watcher.rb +1 -0
- data/lib/middleman-core/core_extensions/rendering.rb +1 -2
- data/lib/middleman-core/core_extensions/request.rb +2 -2
- data/lib/middleman-core/extensions.rb +21 -0
- data/lib/middleman-core/meta_pages/sitemap_resource.rb +4 -1
- data/lib/middleman-core/version.rb +1 -1
- data/lib/middleman-more/core_extensions/default_helpers.rb +17 -3
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.document +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.yardopts +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/LICENSE.txt +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/README.rdoc +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/Rakefile +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/bin/padrino +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core.rb +58 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application.rb +40 -16
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/flash.rb +229 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/rendering.rb +39 -11
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/erubis.rb +55 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/haml.rb +26 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/slim.rb +14 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/routing.rb +133 -37
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/showexceptions.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/caller.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/adapter.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/base.rb +41 -38
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/console.rb +0 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb +47 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/rake_tasks.rb +9 -14
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/command.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/images/404.png +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/images/500.png +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/loader.rb +23 -9
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/cs.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/da.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/de.yml +6 -6
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/en.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/es.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/fr.yml +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/hu.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/it.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ja.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/lv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/nl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/no.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/pl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/pt_br.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ro.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ru.yml +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/sv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/tr.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/uk.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/zh_cn.yml +11 -11
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/zh_tw.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/logger.rb +48 -32
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/module.rb +58 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/mounter.rb +15 -5
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/reloader.rb +139 -52
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/router.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/server.rb +5 -5
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/support_lite.rb +59 -6
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/tasks.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/version.rb +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/padrino-core.gemspec +10 -5
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/Gemfile +4 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/app/app.rb +3 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/app_gem.gemspec +17 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/lib/app_gem.rb +7 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/lib/app_gem/version.rb +3 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/.components +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/complex.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/simple.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/a.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/b.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/c.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/e.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/f.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/g.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/d.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/helper.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/mini_shoulda.rb +2 -2
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_application.rb +38 -21
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_core.rb +0 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_csrf_protection.rb +80 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_dependencies.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_filters.rb +70 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_flash.rb +168 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_locale.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_logger.rb +27 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_mounter.rb +24 -2
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_reloader_complex.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_reloader_simple.rb +4 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_rendering.rb +75 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_restful_routing.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_router.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_routing.rb +209 -35
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_support_lite.rb +56 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.document +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.yardopts +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/LICENSE.txt +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/README.rdoc +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/Rakefile +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers.rb +2 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/asset_tag_helpers.rb +58 -66
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers/breadcrumb_helpers.rb +171 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_builder/abstract_form_builder.rb +84 -26
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_helpers.rb +94 -19
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/format_helpers.rb +9 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/cs.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/da.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/de.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/en.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/es.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/fr.yml +12 -12
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/hu.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/it.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ja.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/lv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/nl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/no.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/pl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/pt_br.yml +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ro.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ru.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/sv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/tr.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/uk.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/zh_cn.yml +13 -14
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/zh_tw.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/number_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers.rb +45 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/erb_handler.rb +3 -3
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/slim_handler.rb +6 -7
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/render_helpers.rb +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/tag_helpers.rb +34 -6
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/translation_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/padrino-helpers.gemspec +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/app.rb +13 -6
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.erb +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.haml +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.slim +4 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.slim +4 -4
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/content_tag.slim +9 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.haml +1 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.slim +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/fields_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/fields_for.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/fields_for.slim +15 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_for.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_for.slim +59 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_tag.slim +70 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/link_to.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/link_to.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/link_to.slim +4 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/mail_to.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/mail_to.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/mail_to.slim +3 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/meta_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/meta_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/meta_tag.slim +3 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/partials/_erb.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/partials/_haml.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/partials/_slim.slim +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/simple_partial.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/simple_partial.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/simple_partial.slim +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/app.rb +7 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engine.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_erb.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_haml.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_slim.slim +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_erb.erb +3 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_haml.haml +2 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_slim.slim +2 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/erb/test.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/explicit_engine.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/haml/test.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/_user.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/haml_template.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/some_template.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/helper.rb +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_asset_tag_helpers.rb +24 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_form_builder.rb +41 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_form_helpers.rb +36 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_format_helpers.rb +14 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_locale.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_number_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_output_helpers.rb +5 -3
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_render_helpers.rb +18 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_tag_helpers.rb +11 -0
- data/middleman-core.gemspec +1 -1
- metadata +218 -184
- data/lib/vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/cli/rake.rb +0 -25
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/content_tag.slim +0 -9
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/fields_for.slim +0 -15
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/form_for.slim +0 -59
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/form_tag.slim +0 -70
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/link_to.slim +0 -4
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/mail_to.slim +0 -3
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/meta_tag.slim +0 -3
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/simple_partial.slim +0 -1
- data/spec/middleman-core/sitemap_spec.rb +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
- content_for :demo do
|
2
2
|
h1 This is content yielded from a content_for
|
3
3
|
|
4
|
-
.demo
|
4
|
+
.demo= yield_content :demo
|
5
5
|
|
6
6
|
- content_for :demo2 do |fname, lname|
|
7
7
|
h1 This is content yielded with name #{fname + " " + lname}
|
8
8
|
|
9
|
-
.demo2
|
9
|
+
.demo2= yield_content :demo2, "Johnny", "Smith"
|
10
10
|
|
11
|
-
.demo_has_content
|
12
|
-
.fake_has_content
|
11
|
+
.demo_has_content= content_for?(:demo)
|
12
|
+
.fake_has_content= content_for?(:fake)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- @user = MarkupUser.new
|
2
|
+
= form_for @user , '/demo1', :id => 'demo-fields-for' do |f|
|
3
|
+
= f.text_field :gender
|
4
|
+
= fields_for @user.permission do |permission|
|
5
|
+
= permission.check_box :can_edit
|
6
|
+
= permission.check_box :can_delete
|
7
|
+
= f.fields_for :telephone do |child_form|
|
8
|
+
= child_form.label :number
|
9
|
+
= child_form.text_field :number
|
10
|
+
= f.fields_for :addresses do |child_form|
|
11
|
+
= child_form.label :name
|
12
|
+
= child_form.text_field :name
|
13
|
+
- unless child_form.object.new_record?
|
14
|
+
= child_form.check_box '_destroy'
|
15
|
+
= child_form.label '_destroy', :caption => 'Remove'
|
File without changes
|
File without changes
|
data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_for.slim
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
= form_for MarkupUser.new, '/demo', :id => 'demo' do |f|
|
2
|
+
= f.error_messages(:header_message => "custom MarkupUser cannot be saved!")
|
3
|
+
= f.hidden_field :session_id
|
4
|
+
p
|
5
|
+
= f.label :username, :caption => "Login: ", :class => 'user-label'
|
6
|
+
= f.text_field :username, :class => 'user-text', :value => "John"
|
7
|
+
p
|
8
|
+
= f.label :password
|
9
|
+
= f.password_field :password, :class => 'user-password', :value => "secret"
|
10
|
+
p
|
11
|
+
= f.label :age
|
12
|
+
= f.number_field :age, :class => 'numeric'
|
13
|
+
p
|
14
|
+
= f.label :telephone
|
15
|
+
= f.telephone_field :telephone, :class => 'numeric'
|
16
|
+
p
|
17
|
+
= f.label :email, :caption => 'Email Address: '
|
18
|
+
= f.email_field :email, :class => 'string'
|
19
|
+
p
|
20
|
+
= f.label :webpage, :caption => 'Your Web Page: '
|
21
|
+
= f.url_field :webpage, :class => 'string'
|
22
|
+
p
|
23
|
+
= f.label :search
|
24
|
+
= f.search_field :search, :class => 'string'
|
25
|
+
p
|
26
|
+
= f.label :photo
|
27
|
+
= f.file_field :photo, :class => 'user-photo'
|
28
|
+
p
|
29
|
+
= f.label :about, :caption => "About Me: "
|
30
|
+
= f.text_area :about, :class => 'user-about'
|
31
|
+
p
|
32
|
+
= f.label :gender, :caption => "Your gender: "
|
33
|
+
= f.radio_button :gender, :value => 'male'
|
34
|
+
= f.radio_button :gender, :value => 'female'
|
35
|
+
p
|
36
|
+
= f.label :country, :caption => "Your country"
|
37
|
+
= f.select :country, :options => ['USA', 'Canada', 'Mexico'], :selected => 'USA', :class => 'selector'
|
38
|
+
p
|
39
|
+
= f.label :remember_me
|
40
|
+
= f.check_box :remember_me, :value => "1"
|
41
|
+
p
|
42
|
+
= f.submit "Create", :class => 'success', :id => 'demo-button'
|
43
|
+
p
|
44
|
+
= f.image_submit "buttons/post.png", :class => 'success', :id => 'image-button'
|
45
|
+
|
46
|
+
= form_for MarkupUser.new, '/another_demo', :id => 'demo2', :method => 'get' do |f|
|
47
|
+
= f.error_messages :header_message => "custom MarkupUser cannot be saved!"
|
48
|
+
= f.hidden_field :session_id
|
49
|
+
= f.text_field_block :username, { :class => 'input' }, { :caption => 'Nickname: ', :class => 'label' }
|
50
|
+
= f.password_field_block :code, { :class => 'input' }
|
51
|
+
= f.text_area_block :about, { :class => 'textarea' }
|
52
|
+
= f.file_field_block :photo, { :class => 'upload' }
|
53
|
+
= f.check_box_block :remember_me, { :class => 'checker' }
|
54
|
+
= f.select_block :state, :options => ['California', 'Texas'], :class => 'selector'
|
55
|
+
= f.submit_block "Create", { :class => 'button' }
|
56
|
+
= f.image_submit_block "buttons/ok.png", { :class => 'image' }
|
57
|
+
|
58
|
+
= form_for :markup_user, '/third_demo', :id => 'demo3', :method => 'get' do |f|
|
59
|
+
= f.text_field_block :username
|
File without changes
|
File without changes
|
data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_tag.slim
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
= form_tag '/simple', :class => 'simple-form' do
|
2
|
+
= error_messages_for nil
|
3
|
+
= field_set_tag do
|
4
|
+
= hidden_field_tag :session_id, :value => "__secret__"
|
5
|
+
= label_tag :username
|
6
|
+
= text_field_tag :username
|
7
|
+
= label_tag :password
|
8
|
+
= password_field_tag :password
|
9
|
+
= label_tag :email
|
10
|
+
= email_field_tag :email
|
11
|
+
= label_tag :age
|
12
|
+
= number_field_tag :age
|
13
|
+
= label_tag :telephone
|
14
|
+
= telephone_field_tag :telephone
|
15
|
+
= label_tag :webpage
|
16
|
+
= url_field_tag :webpage
|
17
|
+
= label_tag :search
|
18
|
+
= search_field_tag :search
|
19
|
+
= label_tag :color
|
20
|
+
= select_tag :color, :options => ['green', 'orange', 'purple']
|
21
|
+
= label_tag :gender
|
22
|
+
= radio_button_tag :gender, :value => 'male'
|
23
|
+
= radio_button_tag :gender, :value => 'female'
|
24
|
+
= check_box_tag :remember_me
|
25
|
+
= submit_tag
|
26
|
+
|
27
|
+
= form_tag '/advanced', :id => 'advanced', :class => 'advanced-form', :method => 'get' do
|
28
|
+
= error_messages_for MarkupUser.new, :header_message => "There are problems with saving user!"
|
29
|
+
= hidden_field_tag :session_id, :value => "__secret__"
|
30
|
+
= field_set_tag "Advanced", :class => 'advanced-field-set' do
|
31
|
+
p
|
32
|
+
= label_tag :username, :class => 'first', :caption => "Nickname"
|
33
|
+
= text_field_tag :username, :value => params[:username], :id => 'the_username'
|
34
|
+
p
|
35
|
+
= label_tag :password, :class => 'first'
|
36
|
+
= password_field_tag :password, :value => params[:password]
|
37
|
+
p
|
38
|
+
= label_tag :email, :caption => 'Email Address'
|
39
|
+
= email_field_tag :email, :class => 'string'
|
40
|
+
p
|
41
|
+
= label_tag :age, :class => 'age'
|
42
|
+
= number_field_tag :age, :class => 'numeric'
|
43
|
+
p
|
44
|
+
= label_tag :telephone, :class => 'telephone'
|
45
|
+
= telephone_field_tag :telephone, :class => 'numeric'
|
46
|
+
p
|
47
|
+
= label_tag :webpage, :caption => 'Your Home Page'
|
48
|
+
= url_field_tag :webpage, :class => 'string'
|
49
|
+
p
|
50
|
+
= label_tag :search
|
51
|
+
= search_field_tag :search, :class => 'string'
|
52
|
+
p
|
53
|
+
= label_tag :about, :class => 'about', :caption => "About Me"
|
54
|
+
= text_area_tag :about, :class => 'large'
|
55
|
+
p
|
56
|
+
= label_tag :gender, :class => 'gender'
|
57
|
+
= radio_button_tag :gender, :value => 'male', :checked => true
|
58
|
+
= radio_button_tag :gender, :value => 'female'
|
59
|
+
p
|
60
|
+
= label_tag :photo, :class => 'photo'
|
61
|
+
= file_field_tag :photo, :class => 'upload'
|
62
|
+
p
|
63
|
+
= label_tag :fav_color
|
64
|
+
= select_tag :fav_color, :options => [ ['green', '1'], ['orange', '2'], ['purple', '3'] ], :selected => '2'
|
65
|
+
p
|
66
|
+
= check_box_tag :remember_me, :value => "1", :checked => true
|
67
|
+
= field_set_tag(:class => 'buttons') do
|
68
|
+
= submit_tag "Login"
|
69
|
+
= button_tag "Cancel"
|
70
|
+
= image_submit_tag "buttons/submit.png"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
= current_engine
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
p.slim= partial 'partials/slim', :engine => "slim"
|
@@ -16,6 +16,9 @@ class RenderDemo < Padrino::Application
|
|
16
16
|
configure do
|
17
17
|
set :logging, false
|
18
18
|
set :padrino_logging, false
|
19
|
+
set :erb, :engine_class => Padrino::Erubis::SafeBufferTemplate
|
20
|
+
set :haml, :escape_html => true
|
21
|
+
set :slim, :generator => Temple::Generators::RailsOutputBuffer
|
19
22
|
end
|
20
23
|
|
21
24
|
# get current engines from partials
|
@@ -28,6 +31,10 @@ class RenderDemo < Padrino::Application
|
|
28
31
|
render :explicit_engine
|
29
32
|
end
|
30
33
|
|
34
|
+
get '/double_capture_:ext' do
|
35
|
+
render "double_capture_#{params[:ext]}"
|
36
|
+
end
|
37
|
+
|
31
38
|
# partial with object
|
32
39
|
get '/partial/object' do
|
33
40
|
partial 'template/user', :object => RenderUser.new('John'), :locals => { :extra => "bar" }
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/helper.rb
RENAMED
@@ -27,6 +27,7 @@ class MiniTest::Spec
|
|
27
27
|
# In this case, block is the html to evaluate
|
28
28
|
def assert_has_tag(name, attributes = {}, &block)
|
29
29
|
html = block && block.call
|
30
|
+
assert html.html_safe?, 'html_safe? failed'
|
30
31
|
matcher = HaveSelector.new(name, attributes)
|
31
32
|
raise "Please specify a block!" if html.blank?
|
32
33
|
assert matcher.matches?(html), matcher.failure_message
|
@@ -23,7 +23,7 @@ describe "AssetTagHelpers" do
|
|
23
23
|
should "display multiple flash tags with given attributes" do
|
24
24
|
flash[:error] = 'wrong'
|
25
25
|
flash[:success] = 'okey'
|
26
|
-
actual_html = flash_tag(:success, :error, :id => 'area')
|
26
|
+
actual_html = flash_tag(:success, :warning, :error, :id => 'area')
|
27
27
|
assert_has_tag('div.success#area', :content => flash[:success]) { actual_html }
|
28
28
|
assert_has_tag('div.error#area', :content => flash[:error]) { actual_html }
|
29
29
|
assert_has_no_tag('div.notice') { actual_html }
|
@@ -70,6 +70,17 @@ describe "AssetTagHelpers" do
|
|
70
70
|
assert_has_tag('a#binky.first', :content => "Sign up", :href => '/register') { actual_link }
|
71
71
|
end
|
72
72
|
|
73
|
+
should "escape the link text" do
|
74
|
+
actual_link = link_to('/register', :class => 'first', :id => 'binky') { "<>" }
|
75
|
+
assert_has_tag('a#binky.first', :href => '/register') { actual_link }
|
76
|
+
assert_match "<>", actual_link
|
77
|
+
end
|
78
|
+
|
79
|
+
should "not escape image_tag" do
|
80
|
+
actual_link = link_to(image_tag("/my/fancy/image.png"), :class => 'first', :id => 'binky')
|
81
|
+
assert_has_tag('img', :src => "/my/fancy/image.png") { actual_link }
|
82
|
+
end
|
83
|
+
|
73
84
|
should "display link block element in haml" do
|
74
85
|
visit '/haml/link_to'
|
75
86
|
assert_have_selector :a, :content => "Test 1 No Block", :href => '/test1', :class => 'test', :id => 'test1'
|
@@ -183,16 +194,15 @@ describe "AssetTagHelpers" do
|
|
183
194
|
should "display image tag relative link with incorrect spacing" do
|
184
195
|
time = stop_time_for_test
|
185
196
|
assert_has_tag('img.photo', :src => "/images/%20relative/%20pic.gif%20%20?#{time.to_i}") {
|
186
|
-
image_tag(' relative/ pic.gif ', :class => 'photo')
|
197
|
+
image_tag(' relative/ pic.gif ', :class => 'photo')
|
198
|
+
}
|
187
199
|
end
|
188
200
|
|
189
201
|
should "not use a timestamp if stamp setting is false" do
|
190
|
-
self.class.expects(:asset_stamp).returns(false)
|
191
202
|
assert_has_tag('img', :src => "/absolute/pic.gif") { image_tag('/absolute/pic.gif') }
|
192
203
|
end
|
193
204
|
|
194
205
|
should "have xhtml convention tag" do
|
195
|
-
self.class.expects(:asset_stamp).returns(false)
|
196
206
|
assert_equal image_tag('/absolute/pic.gif'), '<img src="/absolute/pic.gif" />'
|
197
207
|
end
|
198
208
|
end
|
@@ -200,8 +210,10 @@ describe "AssetTagHelpers" do
|
|
200
210
|
context 'for #stylesheet_link_tag method' do
|
201
211
|
should "display stylesheet link item" do
|
202
212
|
time = stop_time_for_test
|
213
|
+
actual_html = stylesheet_link_tag('style')
|
203
214
|
expected_options = { :media => "screen", :rel => "stylesheet", :type => "text/css" }
|
204
|
-
assert_has_tag('link', expected_options.merge(:href => "/stylesheets/style.css?#{time.to_i}")) {
|
215
|
+
assert_has_tag('link', expected_options.merge(:href => "/stylesheets/style.css?#{time.to_i}")) { actual_html }
|
216
|
+
assert actual_html.html_safe?
|
205
217
|
end
|
206
218
|
|
207
219
|
should "display stylesheet link item for long relative path" do
|
@@ -248,6 +260,7 @@ describe "AssetTagHelpers" do
|
|
248
260
|
time = stop_time_for_test
|
249
261
|
actual_html = javascript_include_tag('application')
|
250
262
|
assert_has_tag('script', :src => "/javascripts/application.js?#{time.to_i}", :type => "text/javascript") { actual_html }
|
263
|
+
assert actual_html.html_safe?
|
251
264
|
end
|
252
265
|
|
253
266
|
should "display javascript item for long relative path" do
|
@@ -281,6 +294,12 @@ describe "AssetTagHelpers" do
|
|
281
294
|
assert_has_tag('script', :src => "/blog/javascripts/application.js?#{time.to_i}", :type => "text/javascript") { actual_html }
|
282
295
|
end
|
283
296
|
|
297
|
+
should "not append extension to absolute paths" do
|
298
|
+
time = stop_time_for_test
|
299
|
+
actual_html = javascript_include_tag('https://maps.googleapis.com/maps/api/js?key=value&sensor=false')
|
300
|
+
assert_has_tag('script', :src => "https://maps.googleapis.com/maps/api/js?key=value&sensor=false") { actual_html }
|
301
|
+
end
|
302
|
+
|
284
303
|
should "display javascript items" do
|
285
304
|
time = stop_time_for_test
|
286
305
|
actual_html = javascript_include_tag('application', 'base.js', 'http://google.com/lib.js')
|
@@ -20,7 +20,7 @@ describe "FormBuilder" do
|
|
20
20
|
mock_model('Role', :name => 'Moderate', :id => 2), mock_model('Role', :name => 'Limited', :id => 3)]
|
21
21
|
@user = mock_model("User", :first_name => "Joe", :email => '', :session_id => 54)
|
22
22
|
@user.stubs(:errors => {:a => "must be present", :b => "must be valid", :email => "Must be valid", :first_name => []})
|
23
|
-
@user.stubs(:role_types => role_types, :role => "1")
|
23
|
+
@user.stubs(:role_types => role_types, :role => "1", :roles => [1,3])
|
24
24
|
@user_none = mock_model("User")
|
25
25
|
end
|
26
26
|
|
@@ -103,6 +103,7 @@ describe "FormBuilder" do
|
|
103
103
|
assert_have_selector :form, :action => '/demo', :id => 'demo'
|
104
104
|
assert_have_selector :form, :action => '/another_demo', :id => 'demo2', :method => 'get'
|
105
105
|
assert_have_selector :form, :action => '/third_demo', :id => 'demo3', :method => 'get'
|
106
|
+
assert_have_selector :input, :name => 'authenticity_token'
|
106
107
|
end
|
107
108
|
|
108
109
|
should "display correct form in erb" do
|
@@ -110,6 +111,7 @@ describe "FormBuilder" do
|
|
110
111
|
assert_have_selector :form, :action => '/demo', :id => 'demo'
|
111
112
|
assert_have_selector :form, :action => '/another_demo', :id => 'demo2', :method => 'get'
|
112
113
|
assert_have_selector :form, :action => '/third_demo', :id => 'demo3', :method => 'get'
|
114
|
+
assert_have_selector :input, :name => 'authenticity_token'
|
113
115
|
end
|
114
116
|
|
115
117
|
should "display correct form in slim" do
|
@@ -117,6 +119,7 @@ describe "FormBuilder" do
|
|
117
119
|
assert_have_selector :form, :action => '/demo', :id => 'demo'
|
118
120
|
assert_have_selector :form, :action => '/another_demo', :id => 'demo2', :method => 'get'
|
119
121
|
assert_have_selector :form, :action => '/third_demo', :id => 'demo3', :method => 'get'
|
122
|
+
assert_have_selector :input, :name => 'authenticity_token'
|
120
123
|
end
|
121
124
|
|
122
125
|
should "have a class of 'invalid' for fields with errors" do
|
@@ -253,6 +256,12 @@ describe "FormBuilder" do
|
|
253
256
|
assert_has_tag('label', :class => 'large', :for => 'user_first_name', :content => "F. Name: ") { actual_html }
|
254
257
|
end
|
255
258
|
|
259
|
+
should "set specific content inside the label if a block was provided" do
|
260
|
+
actual_html = standard_builder.label(:admin, :class => 'large') { input_tag :checkbox }
|
261
|
+
assert_has_tag('label', :class => 'large', :for => 'user_admin', :content => "Admin: ") { actual_html }
|
262
|
+
assert_has_tag('label input[type=checkbox]') { actual_html }
|
263
|
+
end
|
264
|
+
|
256
265
|
should "display correct label in haml" do
|
257
266
|
visit '/haml/form_for'
|
258
267
|
assert_have_selector '#demo label', :content => "Login: ", :class => 'user-label'
|
@@ -492,6 +501,37 @@ describe "FormBuilder" do
|
|
492
501
|
end
|
493
502
|
end
|
494
503
|
|
504
|
+
context 'for #check_box_group and #radio_button_group methods' do
|
505
|
+
should 'display checkbox group html' do
|
506
|
+
checkboxes = standard_builder.check_box_group(:role, :collection => @user.role_types, :fields => [:name, :id], :selected => [2,3])
|
507
|
+
assert_has_tag('input[type=checkbox]', :value => '1') { checkboxes }
|
508
|
+
assert_has_no_tag('input[type=checkbox][checked]', :value => '1') { checkboxes }
|
509
|
+
assert_has_tag('input[type=checkbox]', :checked => 'checked', :value => '2') { checkboxes }
|
510
|
+
assert_has_tag('label[for=user_role_3] input[name="user[role][]"][value="3"][checked]') { checkboxes }
|
511
|
+
end
|
512
|
+
|
513
|
+
should 'display checkbox group html and extract selected values from the object' do
|
514
|
+
checkboxes = standard_builder.check_box_group(:roles, :collection => @user.role_types, :fields => [:name, :id])
|
515
|
+
assert_has_tag('input[type=checkbox][name="user[roles][]"][value="1"][checked]') { checkboxes }
|
516
|
+
assert_has_tag('input[type=checkbox][name="user[roles][]"][value="3"][checked]') { checkboxes }
|
517
|
+
assert_has_no_tag('input[type=checkbox][name="user[roles][]"][value="2"][checked]') { checkboxes }
|
518
|
+
end
|
519
|
+
|
520
|
+
should 'display radio group html' do
|
521
|
+
radios = standard_builder.radio_button_group(:role, :options => %W(red yellow blue), :selected => 'yellow')
|
522
|
+
assert_has_tag('input[type=radio]', :value => 'red') { radios }
|
523
|
+
assert_has_no_tag('input[type=radio][checked]', :value => 'red') { radios }
|
524
|
+
assert_has_tag('input[type=radio]', :checked => 'checked', :value => 'yellow') { radios }
|
525
|
+
assert_has_tag('label[for=user_role_blue] input[name="user[role]"][value=blue]') { radios }
|
526
|
+
end
|
527
|
+
|
528
|
+
should 'display radio group html and extract selected value from the object' do
|
529
|
+
radios = standard_builder.radio_button_group(:role, :collection => @user.role_types)
|
530
|
+
assert_has_tag('input[type=radio][value="1"][checked]') { radios }
|
531
|
+
assert_has_no_tag('input[type=radio][value="2"][checked]') { radios }
|
532
|
+
end
|
533
|
+
end
|
534
|
+
|
495
535
|
context 'for #radio_button method' do
|
496
536
|
should "display correct radio button html" do
|
497
537
|
actual_html = standard_builder.radio_button(:gender, :value => 'male', :class => 'large')
|