0

场景:然后我应该看到显示评级为 PG 和 R 的电影

步骤定义:然后 /^I 应该会看到显示有评分 (.*) 的电影$/ do |ratings| page.should have_content(Movie.find_all_by_ratings) 结束

黄瓜:

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'

请帮我纠正这里的错误。

我感谢 NSS 改进了格式。

4

1 回答 1

1

问题是Movie.find_all_by_ratings想要一个参数,而你没有传递任何参数。您可能打算这样做:

Moving.find_all_by_ratings(ratings)
于 2012-08-16T13:52:39.230 回答