Permalink
Browse files

Rename mailer_test file to dsl_test file and improve tests

  • Loading branch information...
inescoelho committed Aug 13, 2015
1 parent f439788 commit c28cf67542810001603e241065a1fb8696719857
Showing with 37 additions and 0 deletions.
  1. +37 −0 test/dsl_test.rb
View
@@ -0,0 +1,37 @@
require 'test_helper'
require 'lotus/mailer'
describe Lotus::Mailer do
before do
Lotus::Mailer.reset!
end
describe '#root' do
describe 'when a value is given' do
it 'sets it as a Pathname' do
RenderMailer.root 'test'
RenderMailer.configuration.root.must_equal(RenderMailer.root)
end
end
end
describe '#template' do
describe 'set the correct templates' do
it 'has the template in the hash' do
template_test = InvoiceMailer.templates[:html]
template_test.file.must_equal("#{ InvoiceMailer.root }/invoice.html.erb")
end
end
end
describe '#templates' do
describe 'finds all the templates with the same name' do
it 'has_the_template_in_the_hash' do
template_test = LazyMailer.templates[:html]
template_test.file.must_equal("#{ LazyMailer.root }/lazy_mailer.html.erb")
template_test = LazyMailer.templates[:haml]
template_test.file.must_equal("#{ LazyMailer.root }/lazy_mailer.haml.erb")
end
end
end
end

0 comments on commit c28cf67

Please sign in to comment.