Sha256: a2ac2f88978beffaf5d6895a9f7f0e151c0b89440874edc4410b4a1294367290

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 Bytes

Contents

require File.join(File.dirname(__FILE__), %w[ .. .. spec_helper])

describe 'hash extentions' do

  it 'should format the content correctly' do
    payload = {:subject => "A New Ticket", :queue => 'My Queue'}
    payload.to_content_format.include?("Subject: A New Ticket").should be_true
    payload.to_content_format.include?("Queue: My Queue").should be_true
  end
  
  it 'should handel custom fields' do
    payload = {:cf_stuff => 'field'}
    payload.to_content_format.should == "CF-Stuff: field"
  end

  it 'should use our content formatter for strings' do
    payload = {:subject => 'A new ticket', :queue => 'My queue', :text => "A text"}
    Roart::ContentFormatter.should_receive(:format_string).at_least(:once)
    payload.to_content_format
  end

end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
ludo-roart-0.1.11 spec/roart/core/hash_spec.rb
roart-0.1.10 spec/roart/core/hash_spec.rb
axtro-roart-0.1.9.2 spec/roart/core/hash_spec.rb
axtro-roart-0.1.9.1 spec/roart/core/hash_spec.rb