方案: 然后我应该看到评级为PG和R的电影显示
步骤定义: 然后/ ^我应该看到收视率(。*)的电影显示$ / 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改进了格式。
答案 0 :(得分:1)
问题在于Movie.find_all_by_ratings
想要一个参数,而你却没有通过任何参数。你可能打算这样做:
Moving.find_all_by_ratings(ratings)