Sha256: 2084c269e4fda8ad2eea99209a69bbee6e5c50010485cc4d33259789d7be1748
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' require File.dirname(__FILE__) + '/../../lib/yelp4r' describe Yelp4r::Categories do include Yelp4rSpecHelper include Yelp4rCatsSpecHelper before do @yelp_cats = Yelp4r::Categories.new @yelp_cats.parse_url = File.dirname(__FILE__) + "/../fixtures/categories.html" end describe 'initialize' do it 'should set the url for the page to parse' do @yelp_cats.parse_url.should_not be_blank end end describe 'list' do before do @cats = @yelp_cats.list end it "should return the list of categies" do @cats.should_not be_blank @cats.should == yelp4r_test_cats_list end end describe 'options_from_list' do it "should return an array of options" do @yelp_cats.options_from_list.should_not be_blank @yelp_cats.options_from_list.should == yelp4r_test_cats_opts end it "should return an array of options with a single selected value when given a string" do @opts = @yelp_cats.options_from_list("gyms") @opts.should_not be_blank @opts.should == yelp4r_test_cats_opts_single_selected end it "should return an array of options with multiple selected values when given a array" do @opts = @yelp_cats.options_from_list(["gyms", "autoglass", "appliances"]) @opts.should_not be_blank @opts.should == yelp4r_test_cats_opts_multiple_selected end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tcocca-yelp4r-1.0.2 | spec/yelp4r/categories_spec.rb |