Sha256: a7692d7599fd7c574d1de4fd61fbd8325c1fd9efe7cf68372d984028f83ef762

Contents?: true

Size: 1003 Bytes

Versions: 31

Compression:

Stored size: 1003 Bytes

Contents

require 'spec_helper'

describe Postmark::HashHelper do
  describe ".to_postmark" do
    let(:source) { {:from => "support@postmarkapp.com", :reply_to => "contact@wildbit.com"} }
    let(:target) { {"From" => "support@postmarkapp.com", "ReplyTo" => "contact@wildbit.com"} }

    it 'converts Hash keys to Postmark format' do
      subject.to_postmark(source).should == target
    end

    it 'acts idempotentely' do
      subject.to_postmark(target).should == target
    end
  end

  describe ".to_ruby" do
    let(:source) { {"From" => "support@postmarkapp.com", "ReplyTo" => "contact@wildbit.com"} }
    let(:target) { {:from => "support@postmarkapp.com", :reply_to => "contact@wildbit.com"} }

    it 'converts Hash keys to Ruby format' do
      subject.to_ruby(source).should == target
    end

    it 'has compatible mode' do
      subject.to_ruby(source, true).should == target.merge(source)
    end

    it 'acts idempotentely' do
      subject.to_ruby(target).should == target
    end
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
postmark-1.18.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.17.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.16.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.15.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.14.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.13.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.12.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.11.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.10.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.9.1 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.9.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.8.1 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.8.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.7.1 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.7.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.6.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.5.0 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.4.3 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.4.2 spec/unit/postmark/helpers/hash_helper_spec.rb
postmark-1.4.1 spec/unit/postmark/helpers/hash_helper_spec.rb