Sha256: f6b145c8479f29d18d855429c759a2d91a1bebb1d627f4ecf9c35129fcbe1039

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe Genability::Client do

  Genability::Configuration::VALID_FORMATS.each do |format|

    context ".new(:format => '#{format}')" do

      before(:all) do
        @options = {:format => format}.merge(configuration_defaults)
        @client = Genability::Client.new(@options)
      end

      context ".prices" do

        use_vcr_cassette "prices"

        it "should allow underscored method names" do
          price = @client.prices(520, "2011-07-01T09:38:22.7-0400").first
          price.tariffId.should == price.tariff_id
        end

        it "should return an array of prices" do
          prices = @client.prices(520, "2011-07-01T09:38:22.7-0400")
          prices.should be_an Array
          prices.first.tariff_id.should == 520
        end

        it "should accept toDateTime, territoryId, consumptionAmount and demandAmount parameters" do
          @client.prices(520, "2011-06-24T09:38:22.7-0400",
            :to => "2011-07-01T09:38:22.7-0400", :consumption_amount => 500).
            first.tariff_id.should == 520
        end

      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
genability-0.3.0 spec/client/price_spec.rb
genability-0.2.0 spec/client/price_spec.rb
genability-0.1.0 spec/client/price_spec.rb