Cucumber 步骤定义

Cucumber 步骤定义,cucumber,definition,Cucumber,Definition,情景: 然后我应该看分级为PG和R的电影 步骤定义: 然后/^我应该看到分级(.*)显示为$/do |分级的电影| 第页。应包含内容(电影。按分级查找所有内容) 结束 黄瓜: DEPRECATION WARNING: Calling dynamic finder with less number of arguments than the number of attributes in method name is deprecated and will raise an ArguementEr

情景: 然后我应该看分级为PG和R的电影

步骤定义: 然后/^我应该看到分级(.*)显示为$/do |分级的电影| 第页。应包含内容(电影。按分级查找所有内容) 结束

黄瓜:

DEPRECATION WARNING: Calling dynamic finder with less number of arguments than the number of attributes in method name is deprecated and will raise an ArguementError in the next version of Rails. Please passing `nil' to the argument you want it to be nil.
 (called from block (2 levels) in <top (required)> at /home/saasbook/hw3_rottenpotatoes/features/step_definitions/movie_steps.rb:44)
    Then I should see movies with ratings PG and R displayed # features/step_definitions/movie_steps.rb:42
      expected there to be content "[]" in "Rotten Potatoes!\nRotten Potatoes!\n\nAll Movies\n\n\n\nInclude:\nG\n\nPG\n\nPG-13\n\nNC-17\n\nR\n\n\nMovie Title\nRating\nRelease Date\nMore Info\nThe Terminator\nR\n1984-10-26 00:00:00 UTC\nMore about The Terminator\nWhen Harry Met Sally\nR\n1989-07-21 00:00:00 UTC\nMore about When Harry Met Sally\nAmelie\nR\n2001-04-25 00:00:00 UTC\nMore about Amelie\nThe Incredibles\nPG\n2004-11-05 00:00:00 UTC\nMore about The Incredibles\nRaiders of the Lost Ark\nPG\n1981-06-12 00:00:00 UTC\nMore about Raiders of the Lost Ark\nAdd new movie\n\n\n" (RSpec::Expectations::ExpectationNotMetError)
      ./features/step_definitions/movie_steps.rb:44:in `block (2 levels) in <top (required)>'
      ./features/step_definitions/movie_steps.rb:43:in `each'
      ./features/step_definitions/movie_steps.rb:43:in `/^I should see movies with ratings (.*) displayed$/'
      features/filter_movie_list.feature:34:in `Then I should see movies with ratings PG and R displayed'
弃用警告:使用少于方法名称中属性数的参数调用dynamic finder是弃用的,并且在Rails的下一个版本中将引发ArguementError。请将'nil'传递给参数,您希望它为nil。
(从at/home/saasbook/hw3_rottnptatoes/features/step_definitions/movie_steps.rb:44中的块(2层)调用)
然后我会看到分级为PG和R的电影#功能/步骤定义/电影步骤。rb:42
应在中包含内容“[]”“烂土豆\烤土豆\n\n所有电影\n\n\n\n包括:\n\n\nPG\n\nPG-13\n\nNC-17\n\nR\n\n电影标题\n日期\n放映日期\n更多信息\n终结者\nR\n1984-10-26 00:00:00 UTC\n更多关于终结者\n当哈利遇到莎莉时\nR\n1989-07-21 00:00:00 UTC\n更多关于哈利遇到莎莉的时间\nR\n2001-04-25:00:00:00:00\n更多关于阿梅莉\n不可思议的人\nPG\n2004-11-05 00:00:00 UTC\n更多关于不可思议的人\n迷失方舟的助手\nPG\n1981-06-12 00:00:00 UTC\n更多关于迷失方舟的袭击者\n新电影\n\n“(RSpec::expections::ExpectationNotMetError)
/features/step_definitions/movie_steps.rb:44:in'block(2层)in'
/features/step\u definitions/movie\u steps.rb:43:in'each'
/features/step\u definitions/movie\u steps.rb:43:in`/^我应该看到分级(.*)显示为$/'的电影
功能/过滤电影列表。功能:34:在“那么我应该看分级为PG和R的电影”
请帮我纠正这里的错误


我感谢NSS改进了格式。

问题在于
电影。按分级查找所有内容
需要一个参数,但您没有通过任何参数。您可能是有意这样做的:

Moving.find_all_by_ratings(ratings)