Sha256: 80573987ec9bdbb157a14dc661a895b4cf933c65bd9332741167320fd9cc8f4c

Contents?: true

Size: 773 Bytes

Versions: 6

Compression:

Stored size: 773 Bytes

Contents

require 'spec_helper'

describe Mailroute::DomainContact, :vcr => true do
  before { configure_mailroute }

  let(:domain) { Mailroute::Domain.get(4555) }

  describe 'CRUD' do
    it 'should create, read, update and delete domain contacts' do
      contact = Mailroute::DomainContact.create(:email => 'haskell@example.com', :domain => domain)

      contact.id.should be

      contact2 = Mailroute::DomainContact.get(contact.id)

      contact2.should == contact

      contact2.city = 'Minsk'
      contact2.save!

      contact2.domain.should == domain

      contact.reload.city.should == 'Minsk'

      contact.delete

      expect { contact2.reload }.to raise_error ActiveResource::ResourceNotFound

      domain.contacts.should_not include contact
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mailroute-0.0.6 spec/lib/mailroute/models/domain_contact_spec.rb
mailroute-0.0.5 spec/lib/mailroute/models/domain_contact_spec.rb
mailroute-0.0.4 spec/lib/mailroute/models/domain_contact_spec.rb
mailroute-0.0.3 spec/lib/mailroute/models/domain_contact_spec.rb
mailroute-0.0.2 spec/lib/mailroute/models/domain_contact_spec.rb
mailroute-0.0.1 spec/lib/mailroute/models/domain_contact_spec.rb