Sha256: 34524e940b1fc00ae123bd9a9466a25c097e91f77773eaea86af7618fa4eb145

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

require "spec_helper"

describe Paymill::Request::Info do
  describe "#url" do
    it "constructs the url" do
      info = Paymill::Request::Info.new(:get, "random", OpenStruct.new(id: 1))

      info.url.should =~ /random/
    end
  end

  describe "#path_with_params" do
    it "does nothing when no params" do
      info = Paymill::Request::Info.new(:get, "random", nil)
      path = "/path/to/someplace"

      info.path_with_params(path, {}).should eq path
    end

    it "constructs the path with params" do
      info = Paymill::Request::Info.new(:get, "random", nil)
      path = "/path/to/someplace"

      info.path_with_params(path, {random: "stuff"}).should eq "#{path}?random=stuff"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
paymill-0.5.1 spec/paymill/request/info_spec.rb
paymill-0.5.0 spec/paymill/request/info_spec.rb
paymill-0.4.0 spec/paymill/request/info_spec.rb