# encoding: utf-8 require 'spec_helper' require 'oneboxer' require 'oneboxer/rottentomatoes_onebox' describe Oneboxer::RottentomatoesOnebox do it 'translates the URL' do o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/mud_2012/') expect(o.translate_url).to eq('http://rottentomatoes.com/mobile/m/mud_2012/') end it 'generates the expected onebox for a fresh movie' do o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/mud_2012/') FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_fresh.response')) o.onebox.should match_html expected_fresh_result end it 'generates the expected onebox for a rotten movie' do o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/the_big_wedding_2013/') FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_rotten.response')) o.onebox.should match_html expected_rotten_result end it 'generates the expected onebox for a movie with an incomplete description' do o = Oneboxer::RottentomatoesOnebox.new('http://www.rottentomatoes.com/m/gunde_jaari_gallanthayyinde/') FakeWeb.register_uri(:get, o.translate_url, response: fixture_file('oneboxer/rottentomatoes_incomplete.response')) o.onebox.should match_html expected_incomplete_result end private def expected_fresh_result <

Mud

98% of critics liked it. 85% of users liked it.
Cast: Matthew McConaughey, Reese Witherspoon
Director: Jeff Nichols
Theater Release: Apr 26, 2013
Running Time: 2 hr. 10 min.
Rated: PG-13
Mud is an adventure about two boys, Ellis and his friend Neckbone, who find a man named Mud hiding out on an island in the Mississippi. Mud describes fantastic scenarios-he killed a man in Texas and vengeful bounty hunters are coming to get him. He says he is planning to meet and escape with the love of his life, Juniper, who is waiting for him in town. Skeptical but i...
EXPECTED end def expected_rotten_result <

The Big Wedding

6% of critics liked it. 80% of users liked it.
Cast: Robert De Niro, Diane Keaton
Director: Justin Zackham
Theater Release: Apr 26, 2013
Running Time: 1 hr. 29 min.
Rated: R
With an all-star cast led by Robert De Niro, Katherine Heigl, Diane Keaton, Amanda Seyfried, Topher Grace, with Susan Sarandon and Robin Williams, THE BIG WEDDING is an uproarious romantic comedy about a charmingly modern family trying to survive a weekend wedding celebration that has the potential to become a full blown family fiasco. To the amusement of their adult c...
EXPECTED end def expected_incomplete_result <

Gunde Jaari Gallanthayyinde

Cast: Nithin, Nithya Menon
Director: Vijay Kumar Konda
Theater Release: Apr 19, 2013
Running Time: 2 hr. 35 min.
Rated: Unrated
Software engineer Karthik thinks he is the smartest guy on the earth, but he turns out be the biggest fool at the end.
EXPECTED end end