bootstrap_it 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.rubocop.yml +5 -0
- data/Gemfile +9 -0
- data/README.md +582 -0
- data/Rakefile +6 -0
- data/bootstrap_it.gemspec +33 -0
- data/config.ru +7 -0
- data/lib/bootstrap_it.rb +9 -0
- data/lib/bootstrap_it/assets.rb +67 -0
- data/lib/bootstrap_it/config.rb +50 -0
- data/lib/bootstrap_it/engine.rb +25 -0
- data/lib/bootstrap_it/locales/en.yml +4 -0
- data/lib/bootstrap_it/locales/ru.yml +4 -0
- data/lib/bootstrap_it/version.rb +6 -0
- data/lib/bootstrap_it/view_helpers.rb +55 -0
- data/lib/bootstrap_it/view_helpers/breadcrumb.rb +19 -0
- data/lib/bootstrap_it/view_helpers/button.rb +116 -0
- data/lib/bootstrap_it/view_helpers/button_group.rb +32 -0
- data/lib/bootstrap_it/view_helpers/button_toolbar.rb +21 -0
- data/lib/bootstrap_it/view_helpers/dropdown_menu.rb +30 -0
- data/lib/bootstrap_it/view_helpers/form.rb +127 -0
- data/lib/bootstrap_it/view_helpers/grid.rb +75 -0
- data/lib/bootstrap_it/view_helpers/icon.rb +24 -0
- data/lib/bootstrap_it/view_helpers/list.rb +47 -0
- data/lib/bootstrap_it/view_helpers/misc.rb +144 -0
- data/lib/bootstrap_it/view_helpers/mixin.rb +279 -0
- data/lib/bootstrap_it/view_helpers/nav.rb +96 -0
- data/lib/bootstrap_it/view_helpers/pagination.rb +34 -0
- data/lib/bootstrap_it/view_helpers/table.rb +72 -0
- data/lib/bootstrap_it/view_helpers/text.rb +46 -0
- data/spec/assets/assets_spec.rb +51 -0
- data/spec/internal/app/assets/javascript/application.js +7 -0
- data/spec/internal/app/assets/javascript/user.js +1 -0
- data/spec/internal/app/assets/javascript/userfont.eot +0 -0
- data/spec/internal/app/assets/stylesheets/application.css +6 -0
- data/spec/internal/app/assets/stylesheets/user.css +1 -0
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/schema.rb +3 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/lib/config_spec.rb +10 -0
- data/spec/lib/view_helpers_spec.rb +12 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/example_groups/assets_example_group.rb +84 -0
- data/spec/support/example_groups/view_helpers_example_group.rb +124 -0
- data/spec/view_helpers/breadcrumb_spec.rb +12 -0
- data/spec/view_helpers/button_group_spec.rb +40 -0
- data/spec/view_helpers/button_spec.rb +169 -0
- data/spec/view_helpers/button_toolbar_spec.rb +14 -0
- data/spec/view_helpers/dropdown_menu_spec.rb +41 -0
- data/spec/view_helpers/form_spec.rb +27 -0
- data/spec/view_helpers/grid_spec.rb +47 -0
- data/spec/view_helpers/icon_spec.rb +6 -0
- data/spec/view_helpers/list_spec.rb +50 -0
- data/spec/view_helpers/misc_spec.rb +117 -0
- data/spec/view_helpers/mixin_spec.rb +177 -0
- data/spec/view_helpers/nav_spec.rb +63 -0
- data/spec/view_helpers/pagination_spec.rb +36 -0
- data/spec/view_helpers/table_spec.rb +59 -0
- data/spec/view_helpers/text_spec.rb +13 -0
- data/spec/views/examples_spec.rb +250 -0
- data/upstream/bootstrap-3.0.3-dist.zip +0 -0
- data/upstream/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.eot +0 -0
- data/upstream/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.svg +229 -0
- data/upstream/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/upstream/bootstrap/3.0.3/fonts/glyphicons-halflings-regular.woff +0 -0
- data/upstream/bootstrap/3.0.3/javascript/bootstrap.js +2006 -0
- data/upstream/bootstrap/3.0.3/javascript/bootstrap.min.js +7 -0
- data/upstream/bootstrap/3.0.3/src/.editorconfig +11 -0
- data/upstream/bootstrap/3.0.3/src/.gitattributes +8 -0
- data/upstream/bootstrap/3.0.3/src/.gitignore +42 -0
- data/upstream/bootstrap/3.0.3/src/.travis.yml +10 -0
- data/upstream/bootstrap/3.0.3/src/CNAME +1 -0
- data/upstream/bootstrap/3.0.3/src/CONTRIBUTING.md +79 -0
- data/upstream/bootstrap/3.0.3/src/DOCS-LICENSE +319 -0
- data/upstream/bootstrap/3.0.3/src/Gruntfile.js +337 -0
- data/upstream/bootstrap/3.0.3/src/LICENSE +176 -0
- data/upstream/bootstrap/3.0.3/src/LICENSE-MIT +21 -0
- data/upstream/bootstrap/3.0.3/src/README.md +166 -0
- data/upstream/bootstrap/3.0.3/src/_config.yml +25 -0
- data/upstream/bootstrap/3.0.3/src/_includes/ads.html +1 -0
- data/upstream/bootstrap/3.0.3/src/_includes/footer.html +48 -0
- data/upstream/bootstrap/3.0.3/src/_includes/header.html +42 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-about.html +12 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-components.html +137 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-css.html +99 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-customize.html +40 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-getting-started.html +48 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-javascript.html +88 -0
- data/upstream/bootstrap/3.0.3/src/_includes/nav-main.html +37 -0
- data/upstream/bootstrap/3.0.3/src/_includes/old-bs-docs.html +8 -0
- data/upstream/bootstrap/3.0.3/src/_includes/social-buttons.html +16 -0
- data/upstream/bootstrap/3.0.3/src/_layouts/default.html +79 -0
- data/upstream/bootstrap/3.0.3/src/_layouts/home.html +47 -0
- data/upstream/bootstrap/3.0.3/src/about.html +94 -0
- data/upstream/bootstrap/3.0.3/src/bower.json +30 -0
- data/upstream/bootstrap/3.0.3/src/components.html +3714 -0
- data/upstream/bootstrap/3.0.3/src/composer.json +25 -0
- data/upstream/bootstrap/3.0.3/src/css.html +2673 -0
- data/upstream/bootstrap/3.0.3/src/customize.html +1715 -0
- data/upstream/bootstrap/3.0.3/src/dist/css/bootstrap-theme.css +397 -0
- data/upstream/bootstrap/3.0.3/src/dist/css/bootstrap-theme.min.css +7 -0
- data/upstream/bootstrap/3.0.3/src/dist/css/bootstrap.css +7118 -0
- data/upstream/bootstrap/3.0.3/src/dist/css/bootstrap.min.css +7 -0
- data/upstream/bootstrap/3.0.3/src/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/upstream/bootstrap/3.0.3/src/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/upstream/bootstrap/3.0.3/src/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/upstream/bootstrap/3.0.3/src/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/upstream/bootstrap/3.0.3/src/dist/js/bootstrap.js +2006 -0
- data/upstream/bootstrap/3.0.3/src/dist/js/bootstrap.min.js +7 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/css/docs.css +1196 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/css/pygments-manni.css +66 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/ico/favicon.png +0 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/application.js +103 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/customizer.js +332 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/filesaver.js +399 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/holder.js +500 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/ie8-responsive-file-warning.js +12 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/jszip.js +1474 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/less.js +9 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/raw-files.js +3 -0
- data/upstream/bootstrap/3.0.3/src/docs-assets/js/uglify.js +14 -0
- data/upstream/bootstrap/3.0.3/src/examples/carousel/carousel.css +148 -0
- data/upstream/bootstrap/3.0.3/src/examples/carousel/index.html +206 -0
- data/upstream/bootstrap/3.0.3/src/examples/grid/grid.css +28 -0
- data/upstream/bootstrap/3.0.3/src/examples/grid/index.html +148 -0
- data/upstream/bootstrap/3.0.3/src/examples/jumbotron-narrow/index.html +82 -0
- data/upstream/bootstrap/3.0.3/src/examples/jumbotron-narrow/jumbotron-narrow.css +79 -0
- data/upstream/bootstrap/3.0.3/src/examples/jumbotron/index.html +99 -0
- data/upstream/bootstrap/3.0.3/src/examples/jumbotron/jumbotron.css +5 -0
- data/upstream/bootstrap/3.0.3/src/examples/justified-nav/index.html +84 -0
- data/upstream/bootstrap/3.0.3/src/examples/justified-nav/justified-nav.css +88 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar-fixed-top/index.html +91 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar-fixed-top/navbar-fixed-top.css +4 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar-static-top/index.html +92 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar-static-top/navbar-static-top.css +7 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar/index.html +88 -0
- data/upstream/bootstrap/3.0.3/src/examples/navbar/navbar.css +8 -0
- data/upstream/bootstrap/3.0.3/src/examples/non-responsive/index.html +101 -0
- data/upstream/bootstrap/3.0.3/src/examples/non-responsive/non-responsive.css +120 -0
- data/upstream/bootstrap/3.0.3/src/examples/offcanvas/index.html +130 -0
- data/upstream/bootstrap/3.0.3/src/examples/offcanvas/offcanvas.css +51 -0
- data/upstream/bootstrap/3.0.3/src/examples/offcanvas/offcanvas.js +5 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/carousel.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/grid.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/jumbotron-narrow.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/jumbotron.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/justified-nav.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/navbar-fixed.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/navbar-static.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/navbar.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/non-responsive.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/offcanvas.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/sign-in.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/starter-template.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/sticky-footer-navbar.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/sticky-footer.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/screenshots/theme.jpg +0 -0
- data/upstream/bootstrap/3.0.3/src/examples/signin/index.html +50 -0
- data/upstream/bootstrap/3.0.3/src/examples/signin/signin.css +40 -0
- data/upstream/bootstrap/3.0.3/src/examples/starter-template/index.html +68 -0
- data/upstream/bootstrap/3.0.3/src/examples/starter-template/starter-template.css +7 -0
- data/upstream/bootstrap/3.0.3/src/examples/sticky-footer-navbar/index.html +91 -0
- data/upstream/bootstrap/3.0.3/src/examples/sticky-footer-navbar/sticky-footer-navbar.css +45 -0
- data/upstream/bootstrap/3.0.3/src/examples/sticky-footer/index.html +55 -0
- data/upstream/bootstrap/3.0.3/src/examples/sticky-footer/sticky-footer.css +38 -0
- data/upstream/bootstrap/3.0.3/src/examples/theme/index.html +384 -0
- data/upstream/bootstrap/3.0.3/src/examples/theme/theme.css +14 -0
- data/upstream/bootstrap/3.0.3/src/fonts/glyphicons-halflings-regular.eot +0 -0
- data/upstream/bootstrap/3.0.3/src/fonts/glyphicons-halflings-regular.svg +229 -0
- data/upstream/bootstrap/3.0.3/src/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/upstream/bootstrap/3.0.3/src/fonts/glyphicons-halflings-regular.woff +0 -0
- data/upstream/bootstrap/3.0.3/src/getting-started.html +1057 -0
- data/upstream/bootstrap/3.0.3/src/index.html +16 -0
- data/upstream/bootstrap/3.0.3/src/javascript.html +1995 -0
- data/upstream/bootstrap/3.0.3/src/js/.jshintrc +14 -0
- data/upstream/bootstrap/3.0.3/src/js/affix.js +126 -0
- data/upstream/bootstrap/3.0.3/src/js/alert.js +98 -0
- data/upstream/bootstrap/3.0.3/src/js/button.js +115 -0
- data/upstream/bootstrap/3.0.3/src/js/carousel.js +217 -0
- data/upstream/bootstrap/3.0.3/src/js/collapse.js +179 -0
- data/upstream/bootstrap/3.0.3/src/js/dropdown.js +154 -0
- data/upstream/bootstrap/3.0.3/src/js/modal.js +246 -0
- data/upstream/bootstrap/3.0.3/src/js/popover.js +117 -0
- data/upstream/bootstrap/3.0.3/src/js/scrollspy.js +158 -0
- data/upstream/bootstrap/3.0.3/src/js/tab.js +135 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/index.html +52 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/affix.js +25 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/alert.js +62 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/button.js +122 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/carousel.js +87 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/collapse.js +164 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/dropdown.js +219 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/modal.js +196 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/phantom.js +69 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/popover.js +133 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/scrollspy.js +37 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/tab.js +86 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/tooltip.js +437 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/unit/transition.js +13 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/vendor/jquery.js +6 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/vendor/qunit.css +232 -0
- data/upstream/bootstrap/3.0.3/src/js/tests/vendor/qunit.js +1510 -0
- data/upstream/bootstrap/3.0.3/src/js/tooltip.js +386 -0
- data/upstream/bootstrap/3.0.3/src/js/transition.js +56 -0
- data/upstream/bootstrap/3.0.3/src/less/alerts.less +67 -0
- data/upstream/bootstrap/3.0.3/src/less/badges.less +51 -0
- data/upstream/bootstrap/3.0.3/src/less/bootstrap.less +49 -0
- data/upstream/bootstrap/3.0.3/src/less/breadcrumbs.less +23 -0
- data/upstream/bootstrap/3.0.3/src/less/button-groups.less +227 -0
- data/upstream/bootstrap/3.0.3/src/less/buttons.less +155 -0
- data/upstream/bootstrap/3.0.3/src/less/carousel.less +232 -0
- data/upstream/bootstrap/3.0.3/src/less/close.less +33 -0
- data/upstream/bootstrap/3.0.3/src/less/code.less +53 -0
- data/upstream/bootstrap/3.0.3/src/less/component-animations.less +29 -0
- data/upstream/bootstrap/3.0.3/src/less/dropdowns.less +187 -0
- data/upstream/bootstrap/3.0.3/src/less/forms.less +375 -0
- data/upstream/bootstrap/3.0.3/src/less/glyphicons.less +237 -0
- data/upstream/bootstrap/3.0.3/src/less/grid.less +79 -0
- data/upstream/bootstrap/3.0.3/src/less/input-groups.less +136 -0
- data/upstream/bootstrap/3.0.3/src/less/jumbotron.less +46 -0
- data/upstream/bootstrap/3.0.3/src/less/labels.less +64 -0
- data/upstream/bootstrap/3.0.3/src/less/list-group.less +88 -0
- data/upstream/bootstrap/3.0.3/src/less/media.less +56 -0
- data/upstream/bootstrap/3.0.3/src/less/mixins.less +845 -0
- data/upstream/bootstrap/3.0.3/src/less/modals.less +129 -0
- data/upstream/bootstrap/3.0.3/src/less/navbar.less +612 -0
- data/upstream/bootstrap/3.0.3/src/less/navs.less +242 -0
- data/upstream/bootstrap/3.0.3/src/less/normalize.less +406 -0
- data/upstream/bootstrap/3.0.3/src/less/pager.less +55 -0
- data/upstream/bootstrap/3.0.3/src/less/pagination.less +85 -0
- data/upstream/bootstrap/3.0.3/src/less/panels.less +182 -0
- data/upstream/bootstrap/3.0.3/src/less/popovers.less +133 -0
- data/upstream/bootstrap/3.0.3/src/less/print.less +105 -0
- data/upstream/bootstrap/3.0.3/src/less/progress-bars.less +80 -0
- data/upstream/bootstrap/3.0.3/src/less/responsive-utilities.less +209 -0
- data/upstream/bootstrap/3.0.3/src/less/scaffolding.less +119 -0
- data/upstream/bootstrap/3.0.3/src/less/tables.less +231 -0
- data/upstream/bootstrap/3.0.3/src/less/theme.less +247 -0
- data/upstream/bootstrap/3.0.3/src/less/thumbnails.less +36 -0
- data/upstream/bootstrap/3.0.3/src/less/tooltip.less +95 -0
- data/upstream/bootstrap/3.0.3/src/less/type.less +281 -0
- data/upstream/bootstrap/3.0.3/src/less/utilities.less +56 -0
- data/upstream/bootstrap/3.0.3/src/less/variables.less +642 -0
- data/upstream/bootstrap/3.0.3/src/less/wells.less +29 -0
- data/upstream/bootstrap/3.0.3/src/package.json +51 -0
- data/upstream/bootstrap/3.0.3/stylesheets/bootstrap-theme.css +397 -0
- data/upstream/bootstrap/3.0.3/stylesheets/bootstrap-theme.min.css +7 -0
- data/upstream/bootstrap/3.0.3/stylesheets/bootstrap.css +7118 -0
- data/upstream/bootstrap/3.0.3/stylesheets/bootstrap.min.css +7 -0
- data/upstream/font-awesome-4.0.3.zip +0 -0
- data/upstream/font-awesome/4.0.3/fonts/FontAwesome.otf +0 -0
- data/upstream/font-awesome/4.0.3/fonts/fontawesome-webfont.eot +0 -0
- data/upstream/font-awesome/4.0.3/fonts/fontawesome-webfont.svg +414 -0
- data/upstream/font-awesome/4.0.3/fonts/fontawesome-webfont.ttf +0 -0
- data/upstream/font-awesome/4.0.3/fonts/fontawesome-webfont.woff +0 -0
- data/upstream/font-awesome/4.0.3/stylesheets/font-awesome.css +1338 -0
- data/upstream/font-awesome/4.0.3/stylesheets/font-awesome.min.css +4 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/bordered-pulled.less +16 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/core.less +12 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/fixed-width.less +6 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/font-awesome.less +17 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/icons.less +412 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/larger.less +13 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/list.less +19 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/mixins.less +20 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/path.less +14 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/rotated-flipped.less +9 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/spinning.less +30 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/stacked.less +20 -0
- data/upstream/font-awesome/4.0.3/stylesheets/less/variables.less +381 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_bordered-pulled.scss +16 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_core.scss +12 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_fixed-width.scss +6 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_icons.scss +412 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_larger.scss +13 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_list.scss +19 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_mixins.scss +20 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_path.scss +14 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_rotated-flipped.scss +9 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_spinning.scss +30 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_stacked.scss +20 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/_variables.scss +381 -0
- data/upstream/font-awesome/4.0.3/stylesheets/scss/font-awesome.scss +17 -0
- metadata +505 -0
@@ -0,0 +1,177 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# @TODO: dropdownwrapper testing
|
4
|
+
|
5
|
+
describe BootstrapIt::ViewHelpers::Contextual do
|
6
|
+
it {expect(wrapper).to have_enum :state}
|
7
|
+
it 'sets state class' do
|
8
|
+
%i(active success warning danger).each do |state|
|
9
|
+
@wrapper = nil
|
10
|
+
expect(wrapper state).to render_with "div.#{state}"
|
11
|
+
@wrapper = nil
|
12
|
+
expect(wrapper state: state).to render_with "div.#{state}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe BootstrapIt::ViewHelpers::SizableColumn do
|
18
|
+
# column_size_defined?
|
19
|
+
it { expect(wrapper.column_size_defined?).to be_false }
|
20
|
+
it 'detects if size defined' do
|
21
|
+
%i(xs2 sm2 md2 lg2).each do |c|
|
22
|
+
@wrapper = nil
|
23
|
+
expect(wrapper(c).column_size_defined?).to be_true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'sanitize extra small classes' do
|
28
|
+
%i(col_xs_2 xs_2 xs2 extra_small_2 extrasmall2).each do |c|
|
29
|
+
@wrapper = nil
|
30
|
+
expect(wrapper c).to render_with 'div.col-xs-2'
|
31
|
+
@wrapper = nil
|
32
|
+
wrapper.column_size = c
|
33
|
+
expect(wrapper).to render_with 'div.col-xs-2'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'sanitize small classes' do
|
38
|
+
%i(col_sm_2 sm_2 sm2 small_2 small2).each do |c|
|
39
|
+
@wrapper = nil
|
40
|
+
expect(wrapper c).to render_with 'div.col-sm-2'
|
41
|
+
@wrapper = nil
|
42
|
+
wrapper.column_size = c
|
43
|
+
expect(wrapper).to render_with 'div.col-sm-2'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'sanitize medium classes' do
|
48
|
+
%i(col_md_2 md_2 md2 medium_2 medium2).each do |c|
|
49
|
+
@wrapper = nil
|
50
|
+
expect(wrapper c).to render_with 'div.col-md-2'
|
51
|
+
@wrapper = nil
|
52
|
+
wrapper.column_size = c
|
53
|
+
expect(wrapper).to render_with 'div.col-md-2'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'sanitize large classes' do
|
58
|
+
%i(col_lg_2 lg_2 lg2 large_2 large2).each do |c|
|
59
|
+
@wrapper = nil
|
60
|
+
expect(wrapper c).to render_with 'div.col-lg-2'
|
61
|
+
@wrapper = nil
|
62
|
+
wrapper.column_size = c
|
63
|
+
expect(wrapper).to render_with 'div.col-lg-2'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it '#column_size= accepts sizes as array' do
|
68
|
+
wrapper.column_size = [:xs_2, :md_4]
|
69
|
+
expect(wrapper).to render_with 'div.col-xs-2.col-md-4'
|
70
|
+
end
|
71
|
+
|
72
|
+
it { expect(wrapper :sm3, :sm1).to render_with 'div[@class="col-sm-3"]' }
|
73
|
+
it { expect(wrapper :sm12, :lg1).to render_with 'div.col-sm-12.col-lg-1' }
|
74
|
+
end
|
75
|
+
|
76
|
+
describe BootstrapIt::ViewHelpers::PlacableColumn do
|
77
|
+
%w[offset push pull].each do |act|
|
78
|
+
# column_[offset|push|pull]_defined?
|
79
|
+
it { expect(wrapper.send "column_#{act}_defined?").to be_false }
|
80
|
+
it { expect(wrapper.send "column_place_defined?").to be_false }
|
81
|
+
it "detects if #{act} defined" do
|
82
|
+
%I(xs_#{act}_2 sm_#{act}_2 md_#{act}_2 lg_#{act}_2).each do |c|
|
83
|
+
@wrapper = nil
|
84
|
+
expect(wrapper(c).send "column_#{act}_defined?").to be_true
|
85
|
+
@wrapper = nil
|
86
|
+
expect(wrapper(c).send "column_place_defined?").to be_true
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
it "sanitize extra small #{act}" do
|
91
|
+
%I(col_xs_#{act}_2 xs_#{act}_2 extra_small_#{act}_2
|
92
|
+
extrasmall#{act}2).each do |c|
|
93
|
+
@wrapper = nil
|
94
|
+
expect(wrapper c).to render_with "div.col-xs-#{act}-2"
|
95
|
+
@wrapper = nil
|
96
|
+
wrapper.column_place = c
|
97
|
+
expect(wrapper c).to render_with "div.col-xs-#{act}-2"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
it "sanitize small #{act}" do
|
102
|
+
%I(col_sm_#{act}_2 sm_#{act}_2 sm#{act}2 small_#{act}_2
|
103
|
+
small#{act}2).each do |c|
|
104
|
+
@wrapper = nil
|
105
|
+
expect(wrapper c).to render_with "div.col-sm-#{act}-2"
|
106
|
+
@wrapper = nil
|
107
|
+
wrapper.column_place = c
|
108
|
+
expect(wrapper c).to render_with "div.col-sm-#{act}-2"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it "sanitize medium #{act}" do
|
113
|
+
%I(col_md_#{act}_2 md_#{act}_2 md#{act}2 medium_#{act}_2
|
114
|
+
medium#{act}2).each do |c|
|
115
|
+
@wrapper = nil
|
116
|
+
expect(wrapper c).to render_with "div.col-md-#{act}-2"
|
117
|
+
@wrapper = nil
|
118
|
+
wrapper.column_place = c
|
119
|
+
expect(wrapper c).to render_with "div.col-md-#{act}-2"
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it "sanitize large #{act}" do
|
124
|
+
%I(col_lg_#{act}_2 lg_#{act}_2 lg#{act}2 large_#{act}_2
|
125
|
+
large#{act}2).each do |c|
|
126
|
+
@wrapper = nil
|
127
|
+
expect(wrapper c).to render_with "div.col-lg-#{act}-2"
|
128
|
+
@wrapper = nil
|
129
|
+
wrapper.column_place = c
|
130
|
+
expect(wrapper c).to render_with "div.col-lg-#{act}-2"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
describe BootstrapIt::ViewHelpers::Activable do
|
137
|
+
it { expect(wrapper).to have_flag(:active).with(html_class: ['active']) }
|
138
|
+
end
|
139
|
+
|
140
|
+
describe BootstrapIt::ViewHelpers::Disableable do
|
141
|
+
it { expect(wrapper).to have_flag(:disabled).with(aliases: [:disable]) }
|
142
|
+
it { expect(wrapper).to_not render_with '.disabled' }
|
143
|
+
it { expect(wrapper :disabled).to render_with '.disabled' }
|
144
|
+
it { expect(wrapper tag: :button).to_not render_with '[@disabled]' }
|
145
|
+
it { expect(wrapper :disabled, tag: :button).to render_with '[@disabled]' }
|
146
|
+
it { expect(wrapper :disabled, tag: :button).to_not render_with '.disabled' }
|
147
|
+
end
|
148
|
+
|
149
|
+
describe BootstrapIt::ViewHelpers::Sizable do
|
150
|
+
it { expect(wrapper :lg).to render_with '.lg' }
|
151
|
+
it { expect(wrapper :large).to render_with '.lg' }
|
152
|
+
it { expect(wrapper :sm).to render_with '.sm' }
|
153
|
+
it { expect(wrapper :small).to render_with '.sm' }
|
154
|
+
it { expect(wrapper :xs).to render_with '.xs' }
|
155
|
+
it { expect(wrapper :extrasmall).to render_with '.xs' }
|
156
|
+
it { expect(wrapper :extra_small).to render_with '.xs' }
|
157
|
+
it { expect(wrapper size: :large).to render_with '.lg' }
|
158
|
+
it { expect(wrapper :small, size: :large).to render_with '.sm' }
|
159
|
+
|
160
|
+
it 'adds class prefix' do
|
161
|
+
wrapper_class.class_eval do
|
162
|
+
html_class_prefix 'btn-'
|
163
|
+
end
|
164
|
+
@wrapper = nil
|
165
|
+
expect(wrapper :lg).to render_with '.btn-lg'
|
166
|
+
@wrapper = nil
|
167
|
+
expect(wrapper :btn_lg).to render_with '.btn-lg'
|
168
|
+
@wrapper = nil
|
169
|
+
expect(wrapper :btn_large).to render_with '.btn-lg'
|
170
|
+
end
|
171
|
+
|
172
|
+
it { expect(wrapper size: 'value').to_not have_option :size }
|
173
|
+
end
|
174
|
+
|
175
|
+
describe BootstrapIt::ViewHelpers::Justifable do
|
176
|
+
it { expect(wrapper).to have_flag :justified }
|
177
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BootstrapIt::ViewHelpers::Nav do
|
4
|
+
it { expect(helper).to render_with 'ul.nav' }
|
5
|
+
|
6
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Justifable }
|
7
|
+
it { expect(helper).to be_kind_of WrapIt::Container }
|
8
|
+
|
9
|
+
it 'renders active links' do
|
10
|
+
expect(helper { |h| h.link_item :active }).to render_with 'ul > li.active'
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'renders dropdowns' do
|
14
|
+
expect(
|
15
|
+
helper { |h| h.dropdown('text') { |d| d.header 'header' } }
|
16
|
+
).to render_with(
|
17
|
+
'ul > li.dropdown' \
|
18
|
+
' > a.dropdown-toggle[@data-toggle="dropdown"]' \
|
19
|
+
'[@href="#"][text()="text "]'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe BootstrapIt::ViewHelpers::NavPills do
|
25
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Nav }
|
26
|
+
it { expect(helper).to render_with 'ul.nav.nav-pills' }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe BootstrapIt::ViewHelpers::NavTabs do
|
30
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Nav }
|
31
|
+
it { expect(helper).to render_with 'ul.nav.nav-tabs' }
|
32
|
+
end
|
33
|
+
|
34
|
+
describe BootstrapIt::ViewHelpers::NavBar do
|
35
|
+
it 'renders with all needed options' do
|
36
|
+
expect(helper).to render_with(
|
37
|
+
'nav.navbar.navbar-default[@role="navigation"]'
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'renders with button' do
|
42
|
+
expect(helper { |h| h.button }).to render_with 'nav > button.navbar-btn'
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'renders with text' do
|
46
|
+
expect(helper { |h| h.text 'some text' }).to render_with(
|
47
|
+
'nav > p.navbar-text', text: 'some text'
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'has position enum' do
|
52
|
+
expect(helper).to have_enum(:position)
|
53
|
+
.with(values: %i(fixed-top fixed-bottom static-top),
|
54
|
+
html_class_prefix: 'navbar-')
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'has type enum' do
|
58
|
+
expect(helper).to have_enum(:type)
|
59
|
+
.with(values: %i[default inverse],
|
60
|
+
default: :default,
|
61
|
+
html_class_prefix: 'navbar-')
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BootstrapIt::ViewHelpers::Pagination do
|
4
|
+
it { expect(helper).to render_with 'ul.pagination' }
|
5
|
+
it { expect(helper).to be_kind_of WrapIt::Container }
|
6
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Sizable }
|
7
|
+
|
8
|
+
it 'renders links' do
|
9
|
+
expect(helper { |h| h.link_item 'test', 'http://url' }).to render_with(
|
10
|
+
'ul > li > a[@href="http://url"][text()="test"]'
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe BootstrapIt::ViewHelpers::Pager do
|
16
|
+
it { expect(helper).to render_with 'ul.pager' }
|
17
|
+
it { expect(helper).to be_kind_of WrapIt::Container }
|
18
|
+
|
19
|
+
it 'renders links' do
|
20
|
+
expect(helper { |h| h.link_item 'test', 'http://url' }).to render_with(
|
21
|
+
'ul > li > a[@href="http://url"][text()="test"]'
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'renders previous' do
|
26
|
+
expect(helper { |h| h.previous 'test', 'http://url' }).to render_with(
|
27
|
+
'ul > li.previous > a[@href="http://url"][text()="test"]'
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'renders next' do
|
32
|
+
expect(helper { |h| h.next 'test', 'http://url' }).to render_with(
|
33
|
+
'ul > li.next > a[@href="http://url"][text()="test"]'
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BootstrapIt::ViewHelpers::Table do
|
4
|
+
it { expect(helper).to render_with 'table.table' }
|
5
|
+
it { expect(helper tag: 'div').to render_with 'table.table' }
|
6
|
+
|
7
|
+
%i(striped bordered hover condensed).each do |switch|
|
8
|
+
it "has #{switch} switch" do
|
9
|
+
expect(helper).to have_flag(switch)
|
10
|
+
.with(html_class: ["table-#{switch}"])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it { expect(helper).to have_flag(:responsive) }
|
15
|
+
it 'wraps responsive tables' do
|
16
|
+
expect(helper :responsive).to render_with(
|
17
|
+
'div.table-responsive > table.table'
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'renders child rows' do
|
22
|
+
expect(BootstrapIt::ViewHelpers::TableRow).to receive(:new).and_call_original
|
23
|
+
helper.row
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe BootstrapIt::ViewHelpers::TableRow do
|
28
|
+
it { expect(helper).to render_with 'tr' }
|
29
|
+
it { expect(helper tag: 'div').to render_with 'tr' }
|
30
|
+
it { expect(helper { |g| '<i>text</i>'.html_safe }).to render_with 'tr > i' }
|
31
|
+
|
32
|
+
it 'renders child cells' do
|
33
|
+
expect(BootstrapIt::ViewHelpers::TableCell).to receive(:new)
|
34
|
+
.and_call_original
|
35
|
+
helper.cell
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'renders child head cells' do
|
39
|
+
expect(BootstrapIt::ViewHelpers::TableCell).to receive(:new)
|
40
|
+
.and_call_original
|
41
|
+
helper.head
|
42
|
+
end
|
43
|
+
|
44
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Contextual }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe BootstrapIt::ViewHelpers::TableCell, type: :view do
|
48
|
+
it { expect(helper).to render_with 'td' }
|
49
|
+
it { expect(helper :th).to render_with 'th' }
|
50
|
+
it { expect(helper :head).to render_with 'th' }
|
51
|
+
it { expect(helper :header).to render_with 'th' }
|
52
|
+
it 'cleans up options' do
|
53
|
+
expect(helper :th, :head, :header, th: true, head: true, header: true)
|
54
|
+
.to_not have_option :th, :head, :header
|
55
|
+
end
|
56
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::SizableColumn }
|
57
|
+
it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Contextual }
|
58
|
+
it { expect(helper).to be_kind_of WrapIt::TextContainer }
|
59
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe BootstrapIt::ViewHelpers::Label do
|
4
|
+
it { expect(helper).to render_with 'span.label.label-default' }
|
5
|
+
it { expect(helper).to be_kind_of WrapIt::TextContainer }
|
6
|
+
it { expect(helper).to have_enum :appearence }
|
7
|
+
it { expect(helper :danger).to render_with 'span.label.label-danger' }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe BootstrapIt::ViewHelpers::Badge do
|
11
|
+
it { expect(helper).to render_with 'span.badge' }
|
12
|
+
it { expect(helper).to be_kind_of WrapIt::TextContainer }
|
13
|
+
end
|
@@ -0,0 +1,250 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'examples for README.md' do
|
4
|
+
it 'renders grid example' do
|
5
|
+
render inline: <<-HAML
|
6
|
+
<%= grid do |g|
|
7
|
+
g.row do |r|
|
8
|
+
r.cell :md4, 'col 1'
|
9
|
+
r.cell :md4, :md_offset_4, 'col 2'
|
10
|
+
end
|
11
|
+
g.row do |r|
|
12
|
+
r.cell :md6, :md_offset_3, 'col 3'
|
13
|
+
r.clear
|
14
|
+
end
|
15
|
+
end %>
|
16
|
+
HAML
|
17
|
+
expect(rendered).to have_selector 'div.container > div.row > div.col-md-4[text()="col 1"] + div.col-md-4.col-md-offset-4[text()="col 2"]'
|
18
|
+
expect(rendered).to have_selector 'div.container > div.row > div.col-md-6.col-md-offset-3[text()="col 3"] + div.clearfix.visible-md'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'renders table example' do
|
22
|
+
render inline: <<-HAML
|
23
|
+
<%= table :condensed, :bordered do |t|
|
24
|
+
t.row :success do |r|
|
25
|
+
r.head 'header 1'
|
26
|
+
r.head 'header 2'
|
27
|
+
end
|
28
|
+
t.row do |r|
|
29
|
+
r.cell 'data', colspan: 2
|
30
|
+
end
|
31
|
+
end %>
|
32
|
+
HAML
|
33
|
+
expect(rendered).to have_selector 'table.table.table-condensed.table-bordered > tr.success > th[text()="header 1"] + th[text()="header 2"]'
|
34
|
+
expect(rendered).to have_selector 'table > tr > td[@colspan="2"][text()="data"]'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'renders button example' do
|
38
|
+
render inline: <<-HAML
|
39
|
+
<%= button :danger, :large, 'alert', icon: 'home' %>
|
40
|
+
HAML
|
41
|
+
expect(rendered).to have_selector(
|
42
|
+
'button.btn.btn-danger[@type="button"][text()=" alert"] > i.fa.fa-home'
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'renders icon example' do
|
47
|
+
render inline: <<-HAML
|
48
|
+
<%= icon :asterisk %>
|
49
|
+
HAML
|
50
|
+
#puts "*** #{rendered}"
|
51
|
+
expect(rendered).to have_selector 'i.fa.fa-asterisk'
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'renders button-group example #1' do
|
55
|
+
render inline: <<-HAML
|
56
|
+
<%= button_group do |g|
|
57
|
+
g.button 'one'
|
58
|
+
g.button 'two', :success
|
59
|
+
g.dropdown 'dropdown' do |d|
|
60
|
+
d.link_item 'link 1', '#'
|
61
|
+
d.link_item 'link 2', '#'
|
62
|
+
end
|
63
|
+
end %>
|
64
|
+
HAML
|
65
|
+
expect(rendered).to have_selector 'div.btn-group > button.btn.btn-default[@type="button"][text()="one"] + button.btn.btn-success[@type="button"][text()="two"]'
|
66
|
+
expect(rendered).to have_selector 'div.btn-group > button.btn.btn-success[@type="button"][text()="two"] + div.btn-group > button.btn.btn-default.dropdown-toggle[@data-toggle="dropdown"][@type="button"][text()="dropdown"] > span.caret'
|
67
|
+
expect(rendered).to have_selector 'div.btn-group > button.btn.btn-success[@type="button"][text()="two"] + div.btn-group > button + ul.dropdown-menu[@role="menu"] > li[@role="presentation"] + li > a[@role="menuitem"][@tabindex="-1"][text()="link 2"]'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'renders button-group example #2' do
|
71
|
+
render inline: <<-HAML
|
72
|
+
<%= button_group do |g|
|
73
|
+
g.radio 'radio 1', :primary
|
74
|
+
g.radio 'radio 2', :primary
|
75
|
+
end %>
|
76
|
+
HAML
|
77
|
+
expect(rendered).to have_selector 'div.btn-group[@data-toggle="buttons"] > label.btn.btn-primary[text()="radio 1"] > input[@type="radio"]'
|
78
|
+
expect(rendered).to have_selector 'div.btn-group > label.btn.btn-primary[text()="radio 1"] + label.btn.btn-primary[text()="radio 2"] > input[@type="radio"]'
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'renders dropdown button example' do
|
82
|
+
render inline: <<-HAML
|
83
|
+
<%= dropdown_button :danger, :splitted, 'Button' do |b|
|
84
|
+
b.header 'Actions'
|
85
|
+
b.link_item 'Action', '#'
|
86
|
+
b.link_item 'Another action', '#'
|
87
|
+
b.divider
|
88
|
+
end %>
|
89
|
+
HAML
|
90
|
+
expect(rendered).to have_selector(
|
91
|
+
'div.btn-group' \
|
92
|
+
' > button.btn.btn-danger[@type="button"][text()="Button"]' \
|
93
|
+
' + button.btn.btn-danger.dropdown-toggle[@type="button"]' \
|
94
|
+
'[@data-toggle="dropdown"] > span.caret'
|
95
|
+
)
|
96
|
+
expect(rendered).to have_selector(
|
97
|
+
'div.btn-group > button[@data-toggle="dropdown"]' \
|
98
|
+
' + ul.dropdown-menu[@role="menu"]' \
|
99
|
+
' > li.dropdown-header[text()="Actions"][@role="presentation"]'
|
100
|
+
)
|
101
|
+
expect(rendered).to have_selector(
|
102
|
+
'div.btn-group > button + ul > li.dropdown-header' \
|
103
|
+
' + li[@role="presentation"]' \
|
104
|
+
' > a[@href="#"][text()="Action"][@role="menuitem"][@tabindex="-1"]'
|
105
|
+
)
|
106
|
+
expect(rendered).to have_selector(
|
107
|
+
'div.btn-group > button + ul > li.dropdown-header + li + li' \
|
108
|
+
' > a[@href="#"][text()="Another action"]'
|
109
|
+
)
|
110
|
+
expect(rendered).to have_selector(
|
111
|
+
'div.btn-group > button + ul' \
|
112
|
+
' > li.dropdown-header + li + li + li.divider'
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'renders pills example' do
|
117
|
+
render inline: <<-HAML
|
118
|
+
<%= pills do |p|
|
119
|
+
p.link_item :active, 'Home', '#'
|
120
|
+
p.link_item 'Profile', '#'
|
121
|
+
p.link_item 'Messages', '#'
|
122
|
+
end %>
|
123
|
+
HAML
|
124
|
+
expect(rendered).to have_selector 'ul.nav.nav-pills > li.active > a[@href="#"][text()="Home"]'
|
125
|
+
expect(rendered).to have_selector 'ul > li + li > a[@href="#"][text()="Profile"]'
|
126
|
+
expect(rendered).to have_selector 'ul > li + li + li > a[@href="#"][text()="Messages"]'
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'renders breadcrumb example' do
|
130
|
+
render inline: <<-HAML
|
131
|
+
<%= breadcrumb do |b|
|
132
|
+
b.link_item 'Home', '#'
|
133
|
+
b.link_item 'Library', '#'
|
134
|
+
b.item :active, 'Data'
|
135
|
+
end %>
|
136
|
+
HAML
|
137
|
+
expect(rendered).to have_selector 'ol.breadcrumb > li > a[@href="#"][text()="Home"]'
|
138
|
+
expect(rendered).to have_selector 'ol > li + li > a[@href="#"][text()="Library"]'
|
139
|
+
expect(rendered).to have_selector 'ol > li + li + li.active[text()="Data"]'
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'renders pagination example' do
|
143
|
+
render inline: <<-HAML
|
144
|
+
<%= pagination do |p|
|
145
|
+
p.link_item '«', '#', :disabled
|
146
|
+
p.link_item '1', '#', :active
|
147
|
+
p.link_item '2', '#'
|
148
|
+
p.link_item '3', '#'
|
149
|
+
p.link_item '»', '#'
|
150
|
+
end %>
|
151
|
+
HAML
|
152
|
+
expect(rendered).to have_selector(
|
153
|
+
'ul.pagination > li.disabled > a[@href="#"]',
|
154
|
+
text: '«'
|
155
|
+
)
|
156
|
+
expect(rendered).to have_selector(
|
157
|
+
'ul > li.disabled + li.active > a[@href="#"]',
|
158
|
+
text: '1'
|
159
|
+
)
|
160
|
+
expect(rendered).to have_selector(
|
161
|
+
'ul > li.disabled + li.active + li > a[@href="#"]',
|
162
|
+
text: '2'
|
163
|
+
)
|
164
|
+
expect(rendered).to have_selector(
|
165
|
+
'ul > li.disabled + li.active + li + li > a[@href="#"]',
|
166
|
+
text: '3'
|
167
|
+
)
|
168
|
+
expect(rendered).to have_selector(
|
169
|
+
'ul > li.disabled + li.active + li + li + li > a[@href="#"]',
|
170
|
+
text: '»'
|
171
|
+
)
|
172
|
+
end
|
173
|
+
|
174
|
+
it 'renders pager example' do
|
175
|
+
render inline: <<-HAML
|
176
|
+
<%= pager do |p|
|
177
|
+
p.previous '← Older', '#', :disabled
|
178
|
+
p.next 'Newer →', '#'
|
179
|
+
end %>
|
180
|
+
HAML
|
181
|
+
expect(rendered).to have_selector(
|
182
|
+
'ul.pager > li.previous.disabled > a[@href="#"]',
|
183
|
+
text: '← Older'
|
184
|
+
)
|
185
|
+
expect(rendered).to have_selector(
|
186
|
+
'ul.pager > li.previous.disabled + li.next > a[@href="#"]',
|
187
|
+
text: 'Newer →'
|
188
|
+
)
|
189
|
+
end
|
190
|
+
|
191
|
+
it 'renders label example' do
|
192
|
+
render inline: <<-HAML
|
193
|
+
<%= label :info, 'label text' %>
|
194
|
+
HAML
|
195
|
+
expect(rendered).to have_selector 'span.label.label-info[text()="label text"]'
|
196
|
+
end
|
197
|
+
|
198
|
+
it 'renders badge example' do
|
199
|
+
render inline: <<-HAML
|
200
|
+
<%= badge '10' %>
|
201
|
+
HAML
|
202
|
+
expect(rendered).to have_selector 'span.badge[text()="10"]'
|
203
|
+
end
|
204
|
+
|
205
|
+
it 'renders jumbotron example' do
|
206
|
+
render inline: <<-HAML
|
207
|
+
<%= jumbotron do %>
|
208
|
+
<h1>Hello, world!</h1>
|
209
|
+
<% end %>
|
210
|
+
HAML
|
211
|
+
expect(rendered).to have_selector 'div.jumbotron > h1'
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'renders page-header example' do
|
215
|
+
render inline: <<-HAML
|
216
|
+
<%= page_header do %>
|
217
|
+
<h1>Hello, world!</h1>
|
218
|
+
<% end %>
|
219
|
+
HAML
|
220
|
+
expect(rendered).to have_selector 'div.page-header > h1'
|
221
|
+
end
|
222
|
+
|
223
|
+
it 'renders alert example' do
|
224
|
+
render inline: <<-HAML
|
225
|
+
<%= alert_box :success, :dismissable do |a| %>
|
226
|
+
<%= a.link 'link text', 'url' %>
|
227
|
+
<% end %>
|
228
|
+
HAML
|
229
|
+
expect(rendered).to have_selector 'div.alert.alert-success.alert-dismissable > button.close[@type="button"][@data-dismiss="alert"][@aria-hidden="true"] + a.alert-link[@href="url"][text()="link text"]'
|
230
|
+
end
|
231
|
+
|
232
|
+
it 'renders progress-bar example' do
|
233
|
+
render inline: <<-HAML
|
234
|
+
<%= progress_bar :striped, :success, 35, '35% total complete' do |p|
|
235
|
+
p.bar :warning, 20, '20% files complete'
|
236
|
+
end %>
|
237
|
+
HAML
|
238
|
+
expect(rendered).to have_selector 'div.progress.progress-striped > div.progress-bar.progress-bar-success[@style="width: 35%"][@role="progressbar"][@aria-valuenow="35"][@aria-valuemin="0"][@aria-valuemax="100"] > span.sr-only[text()="35% total complete"]'
|
239
|
+
expect(rendered).to have_selector 'div.progress.progress-striped > div.progress-bar-success + div.progress-bar.progress-bar-warning[@style="width: 20%"][@role="progressbar"][@aria-valuenow="20"][@aria-valuemin="0"][@aria-valuemax="100"] > span.sr-only[text()="20% files complete"]'
|
240
|
+
end
|
241
|
+
|
242
|
+
it 'renders inline form example' do
|
243
|
+
render inline: <<-HAML
|
244
|
+
<%= form :horizontal do |f|
|
245
|
+
f.input 'user@mail.ru', :xs_offset_2, type: 'email', id: 'exampleInputEmail2', placeholder: 'Enter email', label: ['Email address', :xs_4]
|
246
|
+
end %>
|
247
|
+
HAML
|
248
|
+
#puts "*** #{rendered}"
|
249
|
+
end
|
250
|
+
end
|