2012-08-16 178 views
0

情景: 那我應該看到收視率限制級電影和R顯示Rails的黃瓜步驟定義

步驟定義 然後/ ^我應該看看電影與收視率顯示$ /做|評級| 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改進格式。

回答

1

問題是Movie.find_all_by_ratings想要一個參數,而你沒有傳遞任何參數。你可能是這麼做的:

Moving.find_all_by_ratings(ratings) 
+0

非常感謝。 – Selvam 2012-08-17 03:41:44

+0

不客氣!請記住標記爲答案! – MrDanA 2012-08-17 12:49:58