diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 000000000..ffa9fc3ef --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,45 @@ +name: Ruby + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + Lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.2 + bundler-cache: true + - name: Danger + if: ${{ github.event_name == 'pull_request' }} + run: | + gem install danger + danger + - name: Rubocop + run: bundle exec rubocop --auto-correct + Test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby-version: [ '3.0', '2.7', '2.6' ] + gemfile: [ '6.1', '6.0', '5.2', 'edge' ] + exclude: + - { ruby-version: '3.0', gemfile: "5.2" } + - { ruby-version: '2.6', gemfile: "edge" } + env: + BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run tests + run: bundle exec rake test diff --git a/.gitignore b/.gitignore index e7bb8f752..7c02cff54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .bundle/ +.idea log/*.log pkg/ demo/db/*.sqlite3 @@ -13,7 +14,7 @@ test/gemfiles/*.lock Vagrantfile .vagrant -// For the demo app. +# For the demo app. # Ignore uploaded files in development. demo/storage/* @@ -30,3 +31,17 @@ demo/node_modules demo/yarn-error.log demo/yarn-debug.log* demo/.yarn-integrity + +# For stuff that gets created if using the Dockerfile image +.bundle/ +.cache/ +vendor/bundle + +# or .local/share/pry/pry_history if you need to be more exact +.local/ +.irb_history +.byebug_history +# For Debian images with Bash +.bash_history +# For Alpine images +.ash_history diff --git a/.rubocop.yml b/.rubocop.yml index 88cc286dc..213e69d98 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -# Taken from: https://github.com/mattbrictson/rails-template/blob/master/rubocop.yml.tt -# Modified for demo app in `demo/` directory. require: - rubocop-performance - rubocop-rails @@ -8,23 +6,32 @@ AllCops: DisplayCopNames: true DisplayStyleGuide: true TargetRubyVersion: 2.5 + NewCops: enable Exclude: - - "bin/*" + - bin/* - Capfile - demo/bin/* - - "demo/bower_components/**/*" + - demo/bower_components/**/* - demo/config/boot.rb - demo/config/environment.rb - demo/config/initializers/version.rb - demo/db/schema.rb - - "demo/node_modules/**/*" + - demo/node_modules/**/* - demo/Rakefile - - "demo/tmp/**/*" - - "demo/vendor/**/*" + - demo/tmp/**/* + - demo/vendor/**/* - Gemfile - gemfiles/vendor/bundle/**/* + - vendor/bundle/**/* - Guardfile - Rakefile + - vendor/**/* + +Layout/LineLength: + Max: 132 + Exclude: + - "demo/config/**/*" + - "demo/db/**/*" Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space @@ -45,12 +52,6 @@ Metrics/ClassLength: - "demo/test/**/*" - "test/**/*" -Metrics/LineLength: - Max: 132 - Exclude: - - "demo/config/**/*" - - "demo/db/**/*" - Metrics/MethodLength: Max: 12 Exclude: diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b03e9bf..faf90194f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,8 @@ ### Bugfixes -* Your contribution here! +* [#586](https://github.com/bootstrap-ruby/bootstrap_form/pull/586): Fix Rails 6.1 tests on master - [@thimo](https://github.com/thimo). +* [#587](https://github.com/bootstrap-ruby/bootstrap_form/pull/587): Replace `strip_heredoc` with `<<~` - [@thimo](https://github.com/thimo). ## [4.5.0][] (2020-04-29) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4610a54de..dea9253bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ There are a number of ways you can contribute to `bootstrap_form`: *Note:* If you want to work on preparing `bootstrap_form` for Bootstrap 5, please start from the `bootstrap-5` branch. If you're submitting a pull request with code or documentation, -say that you want to merge your branch to the `bootstrap-5` branch. +target the pull request to the `bootstrap-5` branch. ## Code Contributions @@ -82,6 +82,33 @@ The goal of `bootstrap_form` is to support all versions of Rails currently suppo The Ruby on Rails support policy is [here](https://guides.rubyonrails.org/maintenance_policy.html). +### Developing with Docker + +This repository includes a `Dockerfile` to build an image with the minimum `bootstrap_form`-supported Ruby environment. To build the image: + +```bash +docker build --tag bootstrap_form . +``` + +This builds an image called `bootstrap_form`. You can change that to any tag you wish. Just make sure you use the same tag name in the `docker run` command. + +If you want to use a different Ruby version, or a smaller Linux distribution (although the distro may be missing tools you need): + +```bash +docker build --build-arg "RUBY_VERSION=2.7" --build-arg "DISTRO=slim-buster" --tag bootstrap_form . +``` + +Then run whichever container you built with the shell to create the bundle: + +```bash +docker run --volume "$PWD:/app" --user $UID:`grep ^$USERNAME /etc/passwd | cut -d: -f4` -it bootstrap_form /bin/bash +bundle install +``` + +You can run tests in the container as normal, with `rake test`. + +(Some of that command line is need for Linux hosts, to run the container as the current user.) + ## Documentation Contributions Contributions to documentation are always welcome. Even fixing one typo improves the quality of `bootstrap_form`. To make a documentation contribution, follow steps 1-3 of Code Contributions, then make the documentation changes, then make the pull request (step 6 of Code Contributions). diff --git a/Dockerfile b/Dockerfile index 617ed8496..3e5976595 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,59 +1,26 @@ -# From: https://evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development -ARG RUBY_VERSION -# See explanation below -FROM ruby:$RUBY_VERSION-slim-buster +ARG DISTRO=buster +ARG RUBY_VERSION=2.6 -ARG NODE_MAJOR -ARG BUNDLER_VERSION -ARG YARN_VERSION +FROM ruby:$RUBY_VERSION-$DISTRO -# Common dependencies -RUN apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ - build-essential \ - gnupg2 \ - curl \ - less \ - git \ - sqlite3 \ - libsqlite3-dev \ - && apt-get clean \ - && rm -rf /var/cache/apt/archives/* \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ - && truncate -s 0 /var/log/*log - -# Add NodeJS to sources list -RUN curl -sL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash - - -# Add Yarn to the sources list -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list - -# Application dependencies -RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \ - DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ - nodejs \ - yarn=$YARN_VERSION-1 && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - truncate -s 0 /var/log/*log - -# Configure bundler -ENV LANG=C.UTF-8 \ - BUNDLE_JOBS=4 \ - BUNDLE_RETRY=3 - -# Uncomment this line if you store Bundler settings in the project's root -# ENV BUNDLE_APP_CONFIG=.bundle - -# Uncomment this line if you want to run binstubs without prefixing with `bin/` or `bundle exec` -# ENV PATH /app/bin:$PATH - -# Upgrade RubyGems and install required Bundler version -RUN gem update --system && \ - gem install bundler:$BUNDLER_VERSION - -# Create a directory for the app code RUN mkdir -p /app - -WORKDIR /app \ No newline at end of file +ENV HOME /app +WORKDIR /app + +ENV GEM_HOME $HOME/vendor/bundle +ENV BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH ./bin:$GEM_HOME/bin:$PATH +RUN (echo 'docker'; echo 'docker') | passwd root + +# Yarn installs nodejs. +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt update -y -q && \ + apt install -y -q yarn + +# Ruby now comes with bundler, but we're not using the default version yet, because we were using +# a newer version of bundler already. Ruby 3 comes with Bundler 2.2.3. Ruby 2.7 has Bundler 2.1.2, +# which is still behind what we were using. +RUN gem install bundler -v 2.1.4 + +EXPOSE 3000 diff --git a/lib/bootstrap_form/helpers/bootstrap.rb b/lib/bootstrap_form/helpers/bootstrap.rb index 5b153fdd0..375fc53ef 100644 --- a/lib/bootstrap_form/helpers/bootstrap.rb +++ b/lib/bootstrap_form/helpers/bootstrap.rb @@ -14,7 +14,7 @@ def submit(name=nil, options={}) def primary(name=nil, options={}, &block) setup_css_class "btn btn-primary", options - if options[:render_as_button] || block_given? + if options[:render_as_button] || block options.except! :render_as_button button(name, options, &block) else diff --git a/lib/bootstrap_form/inputs/check_box.rb b/lib/bootstrap_form/inputs/check_box.rb index 2d0612539..245ca7d69 100644 --- a/lib/bootstrap_form/inputs/check_box.rb +++ b/lib/bootstrap_form/inputs/check_box.rb @@ -38,7 +38,7 @@ def check_box_label(name, options, checked_value, &block) end def check_box_description(name, options, &block) - content = block_given? ? capture(&block) : options[:label] + content = block ? capture(&block) : options[:label] content || object&.class&.human_attribute_name(name) || name.to_s.humanize end diff --git a/test/bootstrap_checkbox_test.rb b/test/bootstrap_checkbox_test.rb index f7eacbfec..0b34d131f 100644 --- a/test/bootstrap_checkbox_test.rb +++ b/test/bootstrap_checkbox_test.rb @@ -6,7 +6,7 @@ class BootstrapCheckboxTest < ActionView::TestCase setup :setup_test_fixture test "check_box is wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -19,7 +19,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box empty label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -31,7 +31,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "disabled check_box has proper wrapper classes" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -44,7 +44,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box label allows html" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -57,7 +57,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box accepts a block to define the label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -70,7 +70,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box accepts a custom label class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -83,7 +83,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box 'id' attribute is used to specify label 'for' attribute" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -96,7 +96,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box responds to checked_value and unchecked_value arguments" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -109,7 +109,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "inline checkboxes" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -122,7 +122,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "inline checkboxes from form layout" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -141,7 +141,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "disabled inline check_box" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -155,21 +155,21 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "inline checkboxes with custom label class" do - expected = <<-HTML.strip_heredoc -
- - - -
+ expected = <<~HTML +
+ + + +
HTML assert_equivalent_xml expected, @builder.check_box(:terms, inline: true, label_class: "btn") end test "collection_check_boxes renders the form_group correctly" do collection = [Address.new(id: 1, street: "Foobar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -187,7 +187,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -212,7 +212,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes contains unicode characters in IDs correctly" do struct = Struct.new(:id, :name) collection = [struct.new(1, "Foo"), struct.new("二", "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -236,7 +236,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders inline checkboxes correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -261,7 +261,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders with checked option correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -288,7 +288,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders with multiple checked options correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -311,7 +311,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes sanitizes values when generating label `for`" do collection = [Address.new(id: 1, street: "Foo St")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -328,7 +328,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes with labels defined by Proc :text_method correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -352,7 +352,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes with values defined by Proc :value_method correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -376,7 +376,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes with labels defined by lambda :text_method correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -400,7 +400,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple checkboxes with values defined by lambda :value_method correctly" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -425,7 +425,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders with checked option correctly with Proc :value_method" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -452,7 +452,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders with multiple checked options correctly with lambda :value_method" do collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -478,7 +478,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box skip label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -488,7 +488,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check_box hide label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -502,23 +502,23 @@ class BootstrapCheckboxTest < ActionView::TestCase collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] @user.errors.add(:misc, "a box must be checked") - expected = <<-HTML.strip_heredoc - - #{'' unless ::Rails::VERSION::STRING >= '6'} - -
- -
- - -
-
- - -
a box must be checked
+ expected = <<~HTML + + #{'' unless ::Rails::VERSION::STRING >= '6'} + +
+ +
+ + +
+
+ + +
a box must be checked
+
-
- + HTML actual = bootstrap_form_for(@user) do |f| @@ -531,7 +531,7 @@ class BootstrapCheckboxTest < ActionView::TestCase test "collection_check_boxes renders multiple check boxes with error correctly" do @user.errors.add(:misc, "error for test") collection = [Address.new(id: 1, street: "Foo"), Address.new(id: 2, street: "Bar")] - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'} @@ -558,18 +558,18 @@ class BootstrapCheckboxTest < ActionView::TestCase test "check_box renders error when asked" do @user.errors.add(:terms, "You must accept the terms.") - expected = <<-HTML.strip_heredoc - - #{'' unless ::Rails::VERSION::STRING >= '6'} -
- - - -
You must accept the terms.
-
-
+ expected = <<~HTML +
+ #{'' unless ::Rails::VERSION::STRING >= '6'} +
+ + + +
You must accept the terms.
+
+
HTML actual = bootstrap_form_for(@user) do |f| f.check_box(:terms, label: "I agree to the terms", error_message: true) @@ -578,7 +578,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "check box with custom wrapper class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -591,7 +591,7 @@ class BootstrapCheckboxTest < ActionView::TestCase end test "inline check box with custom wrapper class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
diff --git a/test/bootstrap_fields_test.rb b/test/bootstrap_fields_test.rb index 6f92627f8..376ce6fd2 100644 --- a/test/bootstrap_fields_test.rb +++ b/test/bootstrap_fields_test.rb @@ -6,7 +6,7 @@ class BootstrapFieldsTest < ActionView::TestCase setup :setup_test_fixture test "color fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -16,7 +16,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "date fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -26,7 +26,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "date time fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -36,7 +36,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "date time local fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -46,7 +46,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "email fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -56,7 +56,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "file fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -66,7 +66,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "file field placeholder can be customized" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -77,7 +77,7 @@ class BootstrapFieldsTest < ActionView::TestCase if ::Rails::VERSION::STRING > "5.1" test "file field placeholder has appropriate `for` attribute when used in form_with" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -89,15 +89,15 @@ class BootstrapFieldsTest < ActionView::TestCase test "file fields are wrapped correctly with error" do @user.errors.add(:misc, "error for test") - expected = <<-HTML.strip_heredoc -
- #{'' unless ::Rails::VERSION::STRING >= '6'} -
- - -
error for test
-
-
+ expected = <<~HTML +
+ #{'' unless ::Rails::VERSION::STRING >= '6'} +
+ + +
error for test
+
+
HTML assert_equivalent_xml expected, bootstrap_form_for(@user) { |f| f.file_field(:misc) } end @@ -108,7 +108,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "month local fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -118,7 +118,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "number fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -128,7 +128,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "password fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -139,7 +139,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "phone/telephone fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -150,7 +150,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "range fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -160,7 +160,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "search fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -170,7 +170,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "text areas are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -181,11 +181,11 @@ class BootstrapFieldsTest < ActionView::TestCase if ::Rails::VERSION::STRING > "5.1" && ::Rails::VERSION::STRING < "5.2" test "text areas are wrapped correctly form_with Rails 5.1" do - expected = <<-HTML.strip_heredoc -
- - -
+ expected = <<~HTML +
+ + +
HTML assert_equivalent_xml expected, form_with_builder.text_area(:comments) end @@ -193,18 +193,18 @@ class BootstrapFieldsTest < ActionView::TestCase if ::Rails::VERSION::STRING > "5.2" test "text areas are wrapped correctly form_with Rails 5.2+" do - expected = <<-HTML.strip_heredoc -
- - -
+ expected = <<~HTML +
+ + +
HTML assert_equivalent_xml expected, form_with_builder.text_area(:comments) end end test "text fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -214,7 +214,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "text fields are wrapped correctly when horizontal and gutter classes are given" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -227,7 +227,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "field 'id' attribute is used to specify label 'for' attribute" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -237,7 +237,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "time fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -247,7 +247,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "url fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -257,7 +257,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "check_box fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -268,7 +268,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "switch-style check_box fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -279,7 +279,7 @@ class BootstrapFieldsTest < ActionView::TestCase end test "week fields are wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -297,7 +297,7 @@ class BootstrapFieldsTest < ActionView::TestCase end end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -318,7 +318,7 @@ class BootstrapFieldsTest < ActionView::TestCase end end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -339,7 +339,7 @@ class BootstrapFieldsTest < ActionView::TestCase end end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -363,7 +363,7 @@ class BootstrapFieldsTest < ActionView::TestCase end end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
diff --git a/test/bootstrap_form_group_test.rb b/test/bootstrap_form_group_test.rb index c575a6094..43a2b2d2d 100644 --- a/test/bootstrap_form_group_test.rb +++ b/test/bootstrap_form_group_test.rb @@ -6,7 +6,7 @@ class BootstrapFormGroupTest < ActionView::TestCase setup :setup_test_fixture test "changing the label text via the label option parameter" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -16,7 +16,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "changing the label text via the html_options label hash" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -26,7 +26,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "hiding a label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -36,7 +36,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding a custom label class via the label_class parameter" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -46,7 +46,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding a custom label class via the html_options label hash" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -56,7 +56,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding a custom label and changing the label text via the html_options label hash" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -66,7 +66,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "skipping a label" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -75,7 +75,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "preventing a label from having the required class with :skip_required" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -87,7 +87,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "preventing a label from having the required class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -97,7 +97,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "forcing a label to have the required class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -107,7 +107,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "label as placeholder" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -117,7 +117,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding prepend text" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -130,7 +130,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding append text" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -160,7 +160,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adding both prepend and append text" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -177,7 +177,7 @@ class BootstrapFormGroupTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -195,7 +195,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "help messages for default forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -206,7 +206,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "help messages for horizontal forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -219,7 +219,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "help messages to look up I18n automatically" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -240,7 +240,7 @@ class BootstrapFormGroupTest < ActionView::TestCase } }) - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -269,7 +269,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "help messages to ignore translation when user disables help" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -283,7 +283,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -299,7 +299,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -314,7 +314,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -330,7 +330,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -345,7 +345,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -360,7 +360,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -375,7 +375,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -399,7 +399,7 @@ class BootstrapFormGroupTest < ActionView::TestCase html end - expected = <<-HTML.strip_heredoc + expected = <<~HTML

Bar

can't be blank, is too short (minimum is 5 characters)
@@ -419,7 +419,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -443,7 +443,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adds class to wrapped form_group by a field" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -456,7 +456,7 @@ class BootstrapFormGroupTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -478,7 +478,7 @@ class BootstrapFormGroupTest < ActionView::TestCase f.text_field(:email, help: "This is required", wrapper_class: "none-margin") end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -496,7 +496,7 @@ class BootstrapFormGroupTest < ActionView::TestCase @horizontal_builder.submit end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -511,7 +511,7 @@ class BootstrapFormGroupTest < ActionView::TestCase @horizontal_builder.submit end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -529,7 +529,7 @@ class BootstrapFormGroupTest < ActionView::TestCase output += @horizontal_builder.text_field(:email) - expected = <<-HTML.strip_heredoc + expected = <<~HTML
Hallo
@@ -544,7 +544,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "adds data-attributes (or any other options) to wrapper" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -559,7 +559,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "passing options to a form control get passed through" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -573,7 +573,7 @@ class BootstrapFormGroupTest < ActionView::TestCase nil end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -582,7 +582,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test "custom form group layout option" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -602,7 +602,7 @@ class BootstrapFormGroupTest < ActionView::TestCase ''.html_safe end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
@@ -623,7 +623,7 @@ class BootstrapFormGroupTest < ActionView::TestCase end test ":input_group_class should apply to input-group" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
diff --git a/test/bootstrap_form_test.rb b/test/bootstrap_form_test.rb index 3dae99848..b79b14baa 100644 --- a/test/bootstrap_form_test.rb +++ b/test/bootstrap_form_test.rb @@ -6,7 +6,7 @@ class BootstrapFormTest < ActionView::TestCase setup :setup_test_fixture test "default-style forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'} @@ -15,7 +15,7 @@ class BootstrapFormTest < ActionView::TestCase end test "default-style form fields layout horizontal" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -67,7 +67,7 @@ class BootstrapFormTest < ActionView::TestCase end test "default-style form fields layout inline" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -119,7 +119,7 @@ class BootstrapFormTest < ActionView::TestCase # No need to test 5.2 separately for this case, since 5.2 does *not* # generate a default ID for the form element. test "default-style forms bootstrap_form_with Rails 5.1+" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'} @@ -129,7 +129,7 @@ class BootstrapFormTest < ActionView::TestCase end test "inline-style forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -174,7 +174,7 @@ class BootstrapFormTest < ActionView::TestCase end test "horizontal-style forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -225,7 +225,7 @@ class BootstrapFormTest < ActionView::TestCase end test "horizontal-style form fields layout default" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -271,7 +271,7 @@ class BootstrapFormTest < ActionView::TestCase end test "horizontal-style form fields layout inline" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -317,7 +317,7 @@ class BootstrapFormTest < ActionView::TestCase end test "existing styles aren't clobbered when specifying a form style" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -333,7 +333,7 @@ class BootstrapFormTest < ActionView::TestCase end test "given role attribute should not be covered by default role attribute" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'} @@ -343,7 +343,7 @@ class BootstrapFormTest < ActionView::TestCase test "allows to set blank default form attributes via configuration" do BootstrapForm.config.stubs(:default_form_attributes).returns({}) - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -353,7 +353,7 @@ class BootstrapFormTest < ActionView::TestCase test "allows to set custom default form attributes via configuration" do BootstrapForm.config.stubs(:default_form_attributes).returns(foo: "bar") - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -362,7 +362,7 @@ class BootstrapFormTest < ActionView::TestCase end test "bootstrap_form_tag acts like a form tag" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -376,7 +376,7 @@ class BootstrapFormTest < ActionView::TestCase end test "bootstrap_form_for does not clobber custom options" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -389,7 +389,7 @@ class BootstrapFormTest < ActionView::TestCase end test "bootstrap_form_tag does not clobber custom options" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -409,15 +409,15 @@ class BootstrapFormTest < ActionView::TestCase id = "_misc" name = "[misc]" end - expected = <<-HTML.strip_heredoc - - #{'' unless ::Rails::VERSION::STRING >= '6'} -
- - - -
- + expected = <<~HTML +
+ #{'' unless ::Rails::VERSION::STRING >= '6'} +
+ + + +
+
HTML assert_equivalent_xml expected, bootstrap_form_tag(url: "/users") { |f| f.check_box :misc } end @@ -426,7 +426,7 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML
#{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -442,7 +442,7 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
@@ -461,15 +461,15 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc - - #{'' unless ::Rails::VERSION::STRING >= '6'} -
- - -
can't be blank, is too short (minimum is 5 characters)
-
- + expected = <<~HTML +
+ #{'' unless ::Rails::VERSION::STRING >= '6'} +
+ + +
can't be blank, is too short (minimum is 5 characters)
+
+
HTML assert_equivalent_xml expected, bootstrap_form_for(@user, label_errors: true, inline_errors: true) { |f| f.text_field :email } ensure @@ -480,7 +480,7 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML

Please fix the following errors:

    @@ -497,7 +497,7 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML

    Please fix the following errors:

      @@ -518,7 +518,7 @@ class BootstrapFormTest < ActionView::TestCase f.alert_message("Please fix the following errors:") end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
      #{'' unless ::Rails::VERSION::STRING >= '6'}
      @@ -542,7 +542,7 @@ class BootstrapFormTest < ActionView::TestCase f.alert_message("Please fix the following errors:", error_summary: false) end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
      @@ -561,7 +561,7 @@ class BootstrapFormTest < ActionView::TestCase f.alert_message("Please fix the following errors:", error_summary: true) end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
      @@ -581,7 +581,7 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML
      • Email can't be blank
      • Email is too short (minimum is 5 characters)
      • @@ -602,14 +602,14 @@ class BootstrapFormTest < ActionView::TestCase @user.email = nil assert @user.invalid? - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        Email can't be blank, Email is too short (minimum is 5 characters)
        HTML assert_equivalent_xml expected, @builder.errors_on(:email) end test "custom label width for horizontal forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -625,7 +625,7 @@ class BootstrapFormTest < ActionView::TestCase end test "offset for form group without label respects label width for horizontal forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -641,7 +641,7 @@ class BootstrapFormTest < ActionView::TestCase end test "offset for form group without label respects multiple label widths for horizontal forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -657,7 +657,7 @@ class BootstrapFormTest < ActionView::TestCase end test "custom input width for horizontal forms" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -673,7 +673,7 @@ class BootstrapFormTest < ActionView::TestCase end test "additional input col class" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -697,7 +697,7 @@ class BootstrapFormTest < ActionView::TestCase f.text_field(:email, help: "This is required") end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -718,7 +718,7 @@ class BootstrapFormTest < ActionView::TestCase f.text_field(:email, help: "This is required") end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -743,7 +743,7 @@ class BootstrapFormTest < ActionView::TestCase f.text_field(:email, help: "This is required") end - expected = <<-HTML.strip_heredoc + expected = <<~HTML #{'' unless ::Rails::VERSION::STRING >= '6'}
        @@ -763,15 +763,15 @@ class BootstrapFormTest < ActionView::TestCase f.text_field(:email) end - expected = <<-HTML.strip_heredoc - - #{'' unless ::Rails::VERSION::STRING >= '6'} -
        - - - This is useful help -
        - + expected = <<~HTML +
        + #{'' unless ::Rails::VERSION::STRING >= '6'} +
        + + + This is useful help +
        +
        HTML assert_equivalent_xml expected, output ensure @@ -780,7 +780,7 @@ class BootstrapFormTest < ActionView::TestCase test "allows the form object to be nil" do builder = BootstrapForm::FormBuilder.new :other_model, nil, self, {} - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        diff --git a/test/bootstrap_other_components_test.rb b/test/bootstrap_other_components_test.rb index 1d96d4514..22d3e4d53 100644 --- a/test/bootstrap_other_components_test.rb +++ b/test/bootstrap_other_components_test.rb @@ -8,7 +8,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control" do output = @horizontal_builder.static_control :email - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -22,7 +22,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control can have custom_id" do output = @horizontal_builder.static_control :email, id: "custom_id" - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -36,7 +36,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control doesn't require an actual attribute" do output = @horizontal_builder.static_control nil, label: "My Label", value: "this is a test" - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -50,7 +50,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control doesn't require a name" do output = @horizontal_builder.static_control label: "Custom Label", value: "Custom Control" - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -64,7 +64,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control support a nil value" do output = @horizontal_builder.static_control label: "Custom Label", value: nil - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -78,7 +78,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase test "static control won't overwrite a control_class that is passed by the user" do output = @horizontal_builder.static_control :email, control_class: "test_class" - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        @@ -94,7 +94,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase "this is a test" end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        this is a test
        @@ -108,7 +108,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase "this is a test" end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        this is a test
        @@ -122,7 +122,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase "Custom Control" end - expected = <<-HTML.strip_heredoc + expected = <<~HTML
        Custom Control
        @@ -132,7 +132,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase end test "regular button uses proper css classes" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML HTML assert_equivalent_xml expected, @@ -140,7 +140,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase end test "regular button can have extra css classes" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML HTML assert_equivalent_xml expected, diff --git a/test/bootstrap_radio_button_test.rb b/test/bootstrap_radio_button_test.rb index 1cad2cd5d..03c7f9cf7 100644 --- a/test/bootstrap_radio_button_test.rb +++ b/test/bootstrap_radio_button_test.rb @@ -6,7 +6,7 @@ class BootstrapRadioButtonTest < ActionView::TestCase setup :setup_test_fixture test "radio_button is wrapped correctly" do - expected = <<-HTML.strip_heredoc + expected = <<~HTML