Created
October 30, 2009 20:09
-
-
Save mhfs/222668 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require File.dirname(__FILE__) + '/../spec_helper' | |
| describe Mailing do | |
| fixtures :mailings | |
| it "should have some fixtures loaded" do | |
| Mailing.should have(3).records | |
| end | |
| it { should belong_to :account } | |
| it { should have_many :deliveries, :dependent => :destroy } | |
| it { should validate_presence_of :account_id } | |
| it { should validate_presence_of :subject } | |
| it { should validate_presence_of :content } | |
| it { should have_default_scope :order => :subject } | |
| it { should have_scope :recent, :limit => 5, :order => :created_at } | |
| context "with mixed textile and html content" do | |
| before(:each) do | |
| @m = Mailing.new | |
| @m.content = "<b>p. Enviatore</b>" | |
| end | |
| it "should clear tags from content on validation" do | |
| @m.valid? | |
| @m.content.should == "p. Enviatore" | |
| end | |
| it "should strip html and parse textile when parsed_content is called" do | |
| @m.parsed_content.should == "<p>Enviatore</p>" | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment