spec/dvdprofiler_profile_spec.rb in royw-dvdprofiler2xbmc-0.0.6 vs spec/dvdprofiler_profile_spec.rb in royw-dvdprofiler2xbmc-0.0.8

- old
+ new

@@ -31,11 +31,11 @@ it "should find by imdb_id" do @profile.should_not == nil end it "should find by title" do - profile = DvdprofilerProfile.first(:titles => ['National Treasure: Book of Secrets']) + profile = DvdprofilerProfile.first(:title => 'National Treasure 2: Book of Secrets') profile.should_not == nil end it "should be able to convert to xml and then from xml" do hash = nil @@ -44,8 +44,23 @@ hash = XmlSimple.xml_in(xml) rescue hash = nil end hash.should_not be_nil + end + + it "should find multiple movies with the same title" do + profiles = DvdprofilerProfile.all(:title => 'Sabrina') + profiles.length.should == 2 + end + + it "should find a single movie using the year when multiple movies have the same title" do + profiles = DvdprofilerProfile.all(:title => 'Sabrina', :year => '1995') + (profiles.length.should == 1) && (profiles.first.isbn.should == '097363304340') + end + + it "should find the other single movie using the year when multiple movies have the same title" do + profiles = DvdprofilerProfile.all(:title => 'Sabrina', :year => '1954') + (profiles.length.should == 1) && (profiles.first.isbn.should == '097360540246') end end \ No newline at end of file