0

Scenario: Then I should see movies with ratings PG and R displayed

Step definition: Then /^I should see movies with ratings (.*) displayed$/ do |ratings| page.should have_content(Movie.find_all_by_ratings) end

Cucumber:

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'

Please help me correct the mistake here.

I thank NSS for the improved formatting.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
Selvam
  • 1,093
  • 7
  • 22
  • 30

1 Answers1

1

The problem is that Movie.find_all_by_ratings wants an argument, and you're passing none. You probably meant to do this:

Moving.find_all_by_ratings(ratings)
MrDanA
  • 11,489
  • 2
  • 36
  • 47