Sha256: 57402a1460040f412bd9f4de98a3ea7060b836ca6b4f95d51ebb32f04b0cd13a

Contents?: true

Size: 1.5 KB

Versions: 6

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'

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

  describe 'WBList' do
    context 'with domain' do
      it 'should create read and update and delete wblists' do
        domain = Mailroute::Domain.get(7)
        wblist = Mailroute::WBList.create(:email => 'noreply@example.com', :domain => domain.resource_uri, :wb => 'b')

        Mailroute::WBList.list.filter(:wb => 'b', :domain => 7).should include wblist


        wblist = Mailroute::WBList.get(wblist.id)
        wblist.domain.should == domain
        wblist.email_account.should be_nil
        wblist.email.should == 'noreply@example.com'
        wblist.wb.should == 'b'

        wblist.delete

        Mailroute::WBList.list.filter(:domain => 7).should_not include wblist
      end
    end

    context 'with email account' do
      it 'should create read and update and delete wblists' do
        email_account = Mailroute::EmailAccount.get(22)
        wblist = Mailroute::WBList.create(:email => 'reply@example.com', :email_account => email_account, :wb => 'b')

        Mailroute::WBList.list.filter(:wb => 'b', :email_account => 22).should include wblist

        wblist = Mailroute::WBList.get(wblist.id)
        wblist.email_account.should == email_account
        wblist.domain.should be_nil
        wblist.email.should == 'reply@example.com'
        wblist.wb.should == 'b'

        wblist.delete

        Mailroute::WBList.list.filter(:email_account => 22).should_not include wblist
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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