Sha256: deb2cecb30425d726845ce233192bdb8fb6736a65094933eb0844e73ca12bbe1

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

require 'spec_helper'
require 'dnsimple/domain'
require 'dnsimple/record'
require 'dnsimple/commands/record_create'

describe DNSimple::Commands::RecordCreate do
  let(:domain_name) { 'example.com' }
  let(:record_name) { 'www' }
  let(:record_type) { 'CNAME' }
  let(:ttl) { "3600" }

  context "with one argument" do
    it "purchases the certificate" do
      domain_stub = stub("domain", :name => domain_name)
      record_stub = stub("record", :id => 1, :record_type => record_type)
      DNSimple::Domain.expects(:find).with(domain_name).returns(domain_stub)
      DNSimple::Record.expects(:create).with(domain_stub, record_name, record_type, domain_name, :ttl => ttl, :prio => nil).returns(record_stub)

      DNSimple::Commands::RecordCreate.new.execute([domain_name, record_name, record_type, domain_name, ttl])
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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