[英]In Rails Rspec gives an invalid css error but the app works fine. How to fix this?
When I run rspec, it gives me an erro like this 当我运行rspec时,它给了我这样的错误
1) AuthenticationPages sign in page
Failure/Error: before { visit dash_signin_path }
ActionView::Template::Error:
Invalid CSS after "...weight: normal ": expected ";", was "!!important;"
(in /home/pubudu/Projects/sumaga-asapuwa/app/assets/stylesheets/application.css)
# (sass):1453
# ./app/views/layouts/_head.html.erb:7:in `_app_views_layouts__head_html_erb___1666364908545837178_48771360'
# ./app/views/layouts/sessions.html.erb:4:in `_app_views_layouts_sessions_html_erb___2365426594570869078_49324500'
# ./spec/requests/authentication_pages_spec.rb:7:in `block (3 levels) in <top (required)>'
The problem is, I haven't used font-weight: normal
in my css! 问题是,我没有在我的CSS中使用
font-weight: normal
! How can I pin point the exact problem? 我怎样才能指出确切的问题? I removed all the custom css I added but still the problem is there.
我删除了我添加的所有自定义CSS,但问题仍然存在。 Is it zurb foundation?
这是zurb基金会吗?
A jquery plugin I used had a css issue! 我使用的jquery插件有一个css问题! It used
!!important
. 它用
!!important
。
Well, I don't find in the W3C CSS specifications that !!important
is allowed (see http://www.w3.org/TR/css-cascade/#importance ). 好吧,我没有在W3C CSS规范中找到
!!important
是允许的(参见http://www.w3.org/TR/css-cascade/#importance )。
I'm not a sass expert, but to me it seems that !!important
is the error that rspec is pointing out. 我不是sass专家,但对我来说似乎
!!important
是rspec指出的错误。
By the way, the file in which you have an error is a normal css file (css extension instead of scss). 顺便说一句,你有错误的文件是一个普通的css文件(css扩展而不是scss)。
Try using !important
instead! 请尝试使用
!important
!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.