Sha256: 03ac704b045ab2117d90b6f814833eb169eded6ee1cf9e2492d3ed73a12296b2

Contents?: true

Size: 762 Bytes

Versions: 10

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'
require 'dnsimple/certificate'
require 'dnsimple/commands/certificate_purchase'

describe DNSimple::Commands::CertificatePurchase do
  let(:domain_name) { 'example.com' }
  let(:domain)      { stub('domain') }
  let(:contact)     { stub('contact') }

  context "with one argument" do
    before :each do
      DNSimple::Domain.stubs(:find).returns(domain)
      DNSimple::Contact.stubs(:find).returns(contact)
    end

    it "purchases the certificate" do
      DNSimple::Certificate.expects(:purchase).
        with(domain, 'certname', contact).
        returns(stub("certificate", :fqdn => domain_name))

      DNSimple::Commands::CertificatePurchase.new.
        execute([domain_name, 'certname', stub('contact id')])
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dnsimple-ruby-1.7.1 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.7.0 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.6.0 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.5.5 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.5.4 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.5.3 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.5.2 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.5.1 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.4.1 spec/commands/certificate_purchase_spec.rb
dnsimple-ruby-1.4.0 spec/commands/certificate_purchase_spec.rb