Sha256: 04a302df7100c9fbafb665840552224eabd955d64d9100b8ef57bc0bef5eac66

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

module Alchemy
  describe Message do
    let(:message) { Message.new }

    describe '.config' do
      it "should return the mailer config" do
        Config.should_receive(:get).with(:mailer)
        Message.config
      end
    end

    describe '#persisted?' do
      it "should return false" do
        expect(message.persisted?).to eq(false)
      end
    end

    describe '#attributes' do
      it "should call .attributes" do
        Message.should_receive(:attributes)
        message.attributes
      end
    end

    describe '#email_is_filled' do
      context 'if email attribute is filled' do
        it "should return true" do
          message.stub!(:email).and_return('me@you.com')
          expect(message.send(:email_is_filled)).to eq(true)
        end
      end

      context 'if email attribute is not filled' do
        it "should return false" do
          message.stub!(:email).and_return('')
          expect(message.send(:email_is_filled)).to eq(false)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-2.8.3 spec/models/message_spec.rb
alchemy_cms-2.7.5 spec/models/message_spec.rb
alchemy_cms-2.7.4 spec/models/message_spec.rb
alchemy_cms-2.8.2 spec/models/message_spec.rb
alchemy_cms-2.8.1 spec/models/message_spec.rb
alchemy_cms-2.7.3 spec/models/message_spec.rb
alchemy_cms-2.7.2 spec/models/message_spec.rb
alchemy_cms-2.7.1 spec/models/message_spec.rb
alchemy_cms-2.7.0 spec/models/message_spec.rb