title: Rails test failing due to Bootstrap - Rails 4
body: <p>I'm following <a href="https://www.railstutorial.org/book/filling_in_the_layout#code-rails_default_head" rel="nofollow">this</a> tutorial, and I haven't had any major issues until now, but when I suddenly tried to run the test (Or Guard) it suddenly started failing.</p>
  
  <p>For every failure, it alerted me</p>
  
  <pre><code>ERROR["test_should_get_home", StaticPagesControllerTest, 1.3221390806138515]
   test_should_get_home#StaticPagesControllerTest (1.32s)
  ActionView::Template::Error:         ActionView::Template::Error: File to import not found or unreadable: bootstrap-sprockets.
          Load paths:
            /home/ubuntu/workspace/sample_app/app/assets/config
            /home/ubuntu/workspace/sample_app/app/assets/images
            /home/ubuntu/workspace/sample_app/app/assets/javascripts
            /home/ubuntu/workspace/sample_app/app/assets/stylesheets
            /home/ubuntu/workspace/sample_app/vendor/assets/javascripts
            /home/ubuntu/workspace/sample_app/vendor/assets/stylesheets
            /usr/local/rvm/gems/ruby-2.3.0/gems/jquery-rails-4.1.1/vendor/assets/javascripts
            /usr/local/rvm/gems/ruby-2.3.0/gems/coffee-rails-4.2.1/lib/assets/javascripts
            /usr/local/rvm/gems/ruby-2.3.0/gems/actioncable-5.0.0.1/lib/assets/compiled
            /usr/local/rvm/gems/ruby-2.3.0/gems/turbolinks-source-5.0.0/lib/assets/javascripts
              app/assets/stylesheets/custom.scss:1
              app/views/static_pages/home.html.erb:13:in `_app_views_static_pages_home_html_erb___4391039624438268474_46194740'
              test/controllers/static_pages_controller_test.rb:15:in `block in &lt;class:StaticPagesControllerTest&gt;'
  </code></pre>
  
  <p>Which I can decipher - It's trying to use bootstrap and can't.</p>
  
  <p>Maybe I'm not familiar enough about TDD but why is it trying to get bootstrap to render a title? Is it due to the partial?</p>
  
  <p>I found numerous other posts with this same issue, but majority either died off, or were from Rails 3 and just restarting the server resolved it.</p>
  
  <p>I was able to resolve it but modifying my Gemfile. I moved <code>gem 'bootstrap-sass', '3.3.6'</code> from the top, into a </p>
  
  <pre><code>group :assets, :test, :development do
      gem 'bootstrap-sass', '3.3.6'
  end
  </code></pre>
  
  <p>block. I thought that any gem outside of the block is permanently loaded, but is that not the case? Should I stick to this style in the future, also?</p>
  
  <p>(Placing entire gemfile for notation sake)</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails',        '5.0.0.1'
  gem 'puma',         '3.4.0'
  gem 'sass-rails',   '5.0.6'
  gem 'uglifier',     '3.0.0'
  gem 'coffee-rails', '4.2.1'
  gem 'jquery-rails', '4.1.1'
  gem 'turbolinks',   '5.0.1'
  gem 'jbuilder',     '2.4.1'
  
  group :assets, :test, :development do
      gem 'bootstrap-sass', '3.3.6'
  end
  
  
  group :development, :test do
    gem 'sqlite3', '1.3.11'
    gem 'byebug',  '9.0.0', platform: :mri
  end
  
  group :development do
    gem 'web-console',           '3.1.1'
    gem 'listen',                '3.0.8'
    gem 'spring',                '1.7.2'
    gem 'spring-watcher-listen', '2.0.0'
  end
  
  group :test do
    gem 'rails-controller-testing', '0.1.1'
    gem 'minitest-reporters',       '1.1.9'
    gem 'guard',                    '2.13.0'
    gem 'guard-minitest',           '2.4.4'
  end
  
  group :production do
    gem 'pg', '0.18.4'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>EDIT: Adding in both tests as requested.</p>
  
  <p><strong>Application Test</strong></p>
  
  <pre><code>ENV['RAILS_ENV'] ||= 'test'
  require File.expand_path('../../config/environment', __FILE__)
  require 'rails/test_help'
  require "minitest/reporters"
  Minitest::Reporters.use!
  
  class ActiveSupport::TestCase
    # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
    fixtures :all
    include ApplicationHelper
  
    # Add more helper methods to be used by all tests here...
  end
  </code></pre>
  
  <p><strong>Specific Test</strong></p>
  
  <p>require 'test_helper'</p>
  
  <pre><code>class SiteLayoutTest &lt; ActionDispatch::IntegrationTest
  
    test "layout links" do
      get root_path
      assert_template 'static_pages/home'
      assert_select "a[href=?]", root_path, count: 2
      assert_select "a[href=?]", help_path
      assert_select "a[href=?]", about_path
      assert_select "a[href=?]", contact_path
      get contact_path
      assert_select "title", full_title("Contact")
      get signup_path
      assert_select "title", full_title("Sign-Up")
    end
  end
  </code></pre>