Sha256: 83a19cd80ec76da8055d0e5982613a352ed62dbe836ddb02bcd8529ab84fa93f

Contents?: true

Size: 845 Bytes

Versions: 2

Compression:

Stored size: 845 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Dataset do
  let(:dataset){ create(:dataset) }
  subject{ dataset }
  
  describe ".touch_existing(:id)" do
    it "should touch the dataset" do
      dataset.updated_at
      sleep(1)
      Dataset.touch_existing(subject.id).should eq true
      Dataset.find(subject.id).updated_at.should_not eq dataset.updated_at
    end
  end
  
  describe ".query" do
    let(:datasets){ Quandl::Client::Dataset.query('oil').all }
    subject{ datasets }

    its(:first){ should be_a Quandl::Client::Dataset }
    
    describe "#metadata" do
      subject{ OpenStruct.new(datasets.metadata) }
      its(:total_count){ should > 1 }
      its(:per_page){ should eq 20 }
      its(:sources){ should be_present }
      its(:status){ should eq 200 }
      its(:current_page){ should eq 1 }
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quandl_client-2.2.1 spec/lib/quandl/client/dataset_spec.rb
quandl_client-2.2.0 spec/lib/quandl/client/dataset_spec.rb