Sha256: 268e2de4e2103237c356848c5b3480bcafed99f9510c9a9deddd05128e6b620d

Contents?: true

Size: 1.09 KB

Versions: 34

Compression:

Stored size: 1.09 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe ReaderNotifier do
  dataset :readers
  
  before do
    Radiant::Config['email.layout'] = 'email'
  end
    
  it "should have a radiant layout attribute" do
    ReaderNotifier.read_inheritable_attribute(:default_layout).should_not be_nil
  end

  it "should render a supplied message" do
    message = ReaderNotifier.create_message(readers(:normal), messages(:normal))
    message.to.should == [readers(:normal).email]
    message.from.should == [messages(:normal).created_by.email]
    message.body.should =~ /#{messages(:normal).filtered_body}/
    message.content_type.should == 'text/html'
  end
  
  it "should render messages with layout" do
    message = ReaderNotifier.create_message(readers(:normal), messages(:normal))
    message.body.should =~ /<head>/
  end
  
  it "should render radius tags within a message" do
    message = ReaderNotifier.create_message(readers(:normal), messages(:taggy))
    message.body.should =~ /<title>#{messages(:taggy).subject}<\/title>/
    message.body.should =~ /To #{readers(:normal).name}/
  end
  
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.38 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.37 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.36 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.35 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.33 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.32 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.31 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.30 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.29 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.28 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.27 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.26 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.25 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.24 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.23 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.20 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.19 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.18 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.17 spec/models/reader_notifier_spec.rb
radiant-reader-extension-3.0.16 spec/models/reader_notifier_spec.rb