Bootstrap css地图破坏请求rspec

时间:2015-04-05 10:30:11

标签: ruby-on-rails twitter-bootstrap rspec

我有一个简单请求的默认rspec

  describe "GET /clients" do
    it "works! (now write some real specs)" do
      get clients_path
      expect(response).to have_http_status(200)
    end
  end

当应用程序布局尝试获取样式表时,这会失败:

ActionView::Template::Error: Invalid CSS after "...":3,"sources":[": expected "|", was ""bootstrap.css"..."
  (in ...:/.../app/assets/stylesheets/application.css)
(sass):1
./app/views/layouts/application.html.erb:13:in `_app_views_layouts_application_html_erb___320761601_41133324'
./spec/requests/clients_spec.rb:11:in `block (3 levels) in <top (required)>'
-e:1:in `load'
-e:1:in `<main>'

我猜它试图将bootstrap.css.map.css渲染为CSS?有没有办法解决这个问题?

更新:包含application.css

 /*
 *= require_tree .
 *= require_self
 *= require bootstrap.min
 *= require custom
 *= require table_sort
 *= require bootstrap-multiselect
 */


@font-face {
    font-family: 'Glyphicons Halflings';
    src: url('/assets/glyphicons-halflings-regular.eot');
    src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
    url('/assets/glyphicons-halflings-regular.woff') format('woff'),
    url('/assets/glyphicons-halflings-regular.ttf') format('truetype'),
    url('/assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

1 个答案:

答案 0 :(得分:0)

删除bootstrap.css.map文件解决了这个问题。