Sha256: dfe71158b573f474b9c915383c4d4e91ed04f1a8c79f6024e86f734092ff24bc

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

require 'spec_helper'

describe Fletcher, :vcr do
  describe :fetch, :vcr do
    it "should fetch amazon product" do
      item = described_class.fetch(FactoryGirl.build(:amazon).url)
      item.should_not be_nil
      item.name.should_not be_nil       
      item.description.should_not be_nil 
    end   
  end 
end 

def amazon_check(url)
  model = described_class.new
  model.parse Fletcher::Data.read(url)    
  model.name.empty?.should_not == true
  model.description.should_not be_nil
  model.price.should_not be_nil        
  model.image.should_not be_nil       
end

describe Fletcher::Model::Amazon do
  describe "parse", :vcr do
    context "with valid data" do
      it "should return correct model info for a product" do 
        amazon_check(FactoryGirl.build(:amazon).url)
      end 
    end
  end
end  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fletcher-0.6.4 spec/lib/fletcher/models/amazon_spec.rb