简体   繁体   English

Michael Hartel的Ruby on Rails教程7.7中的CSS贬值警告

[英]Depretieation Warning for CSS in Michael Hartel's Ruby on Rails tutorial 7.7

I keep getting this error about the CSS in section 7.7: 我在7.7节中不断收到有关CSS的错误:

DEPRECATION WARNING: The assertion was not run because of an invalid css 
unexpected '#' after '[#<Nokogiri::CSS::Node:0x000000076e23f8 @type=:ELEMENT_NAME, 
@value=["div"]>]' (called from block in <class:UsersSignupTest> at   
/home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:14)

DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '<' after '.' (called from block in <class:UsersSignupTest> at 
/home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:15)

The users_signup_test.rb test is below with the specific problem mentioned in the Deprecation Warning in the assert_selects (which are lines 14 and 15 in my code): 下面是users_signup_test.rb测试,其中assert_selects(在我的代码中的第14和15行)的Deprecation Warning中提到了特定问题:

 test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, user: { name: "",
                        email: "user@invalid",
                        password: "foo",
                        password_confirmation: "bar" }
  end
  assert_template 'users/new'
  assert_select 'div#<CSS id for error explanation>'
  assert_select 'div.<CSS class for field with error>'
end

I've checked this code against the book and it seems to be what he has, it just bothers me because the error shows up on every test I run. 我已经对照本书检查了这段代码,这似乎是他所拥有的,它困扰着我,因为在我运行的每个测试中都会显示错误。

You are supposed to replace the <CSS id for error explanation> with the id of the box you're showing the error explanation in -- same with the class. 您应该将<错误解释的CSS ID>替换为您要在其中显示错误解释的框的ID,与该类相同。 What you've copied is a suggested template, not runnable code 您复制的是建议的模板,而不是可运行的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 间距/ CSS问题? -Michael Hartl撰写的Ruby on Rails教程 - Spacing/CSS Issue? - The Ruby on Rails Tutorial by Michael Hartl Michael Hartl的Rails教程第8章中的问题-CSS期望 - Trouble in Chapter 8 of Michael Hartl's Rails Tutorial - CSS Expects Michael Hartl Rails教程-CSS无法正确呈现 - Michael Hartl Rails Tutorial - CSS not rendering properly 调试信息显示为页脚的一部分,仅显示一行? Michael Hartl的Ruby on Rails教程第7章 - Debug Information Shown as Part of Footer and Displaying Only One Line? Michael Hartl's Ruby on Rails Tutorial Chapter 7 在Michael Hartl的Rail教程的第10章中,CSS没有更新 - CSS not updating in Chapter 10 of Michael Hartl's Rail's tutorial 在Michael Hartl(出色的)Rails教程的第7章,练习2 - On Chapter 7, Excercise 2, of Michael Hartl's (excellent) Rails Tutorial Michael Hartl / Ruby on Rails,引导程序,示例应用程序,标头CSS无法正常工作/未按预期格式化 - Michael Hartl / Ruby on rails, bootstrap, sample app, header css not working/ formatting as expected Ruby on Rails中用户的个人CSS样式表 - User's Personal CSS Stylesheet in Ruby on Rails Rails 自定义 css 链接不起作用 - 按照 http://ruby.railstutorial.org 中的教程 - Rails custom css links are not working - following tutorial in http://ruby.railstutorial.org Michael Hartls RoR教程:scss并非针对输入 - Michael Hartls RoR tutorial: scss is not targeting input
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM