Skip to content
Browse files

A simple test to prove that @ is okay in address labels as long as th…

…e label is quoted.
  • Loading branch information...
1 parent f69cf77 commit 111090dfc15a8a99aeb6608f733a369384e0f8cd @aiwilliams committed Dec 21, 2009
Showing with 28 additions and 13 deletions.
  1. +1 −1 .gitignore
  2. +6 −7 README
  3. +2 −2 lib/mlist.rb
  4. +1 −1 mlist.gemspec
  5. +11 −0 spec/fixtures/email/at_in_address_label
  6. +6 −0 spec/models/email_spec.rb
  7. +1 −2 spec/spec_helper.rb
View
2 .gitignore
@@ -1,2 +1,2 @@
spec/sqlite3.db
-pkg
+*.gem
View
13 README
@@ -1,7 +1,5 @@
= MList
-http://aiwilliams.github.com/mlist
-
== DESCRIPTION:
An insane attempt to build a mail list server library that can be used in other
@@ -124,15 +122,16 @@ You'll need some gems.
* hpricot
* uuid (macaddr also)
* tmail
-* activesupport
-* activerecord
+* active_support
+* active_record
== INSTALL:
-sudo gem install mlist (you'll need to have github as a source).
+- gem sources add http://gemcutter.org
+- sudo gem install mlist
For now, copy the mlist_ tables from the spec/fixtures/schema.rb file and move
-them to a new migration in your application. Fun the migration.
+them to a new migration in your application. Run the migration.
Now you'll need to create the MList::Server and provide it with a list manager
and MList::EmailServer::Default instance. Something like this in your
@@ -185,7 +184,7 @@ list something like this:
(The MIT License)
-Copyright (c) 2008 Adam Williams (aiwilliams)
+Copyright (c) 2008-2009 Adam Williams (aiwilliams)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in the
View
4 lib/mlist.rb
@@ -3,8 +3,8 @@
require 'uuid'
require 'tmail'
require 'hpricot'
-require 'activesupport'
-require 'activerecord'
+require 'active_support'
+require 'active_record'
require 'mlist/util'
require 'mlist/email'
View
2 mlist.gemspec
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
s.files = ["CHANGELOG", "Rakefile", "README", "TODO", "VERSION.yml", "lib/mlist", "lib/mlist/email.rb", "lib/mlist/email_post.rb", "lib/mlist/email_server", "lib/mlist/email_server/base.rb", "lib/mlist/email_server/default.rb", "lib/mlist/email_server/fake.rb", "lib/mlist/email_server/pop.rb", "lib/mlist/email_server/smtp.rb", "lib/mlist/email_server.rb", "lib/mlist/email_subscriber.rb", "lib/mlist/list.rb", "lib/mlist/mail_list.rb", "lib/mlist/manager", "lib/mlist/manager/database.rb", "lib/mlist/manager/notifier.rb", "lib/mlist/manager.rb", "lib/mlist/message.rb", "lib/mlist/server.rb", "lib/mlist/thread.rb", "lib/mlist/util", "lib/mlist/util/email_helpers.rb", "lib/mlist/util/header_sanitizer.rb", "lib/mlist/util/quoting.rb", "lib/mlist/util/tmail_builder.rb", "lib/mlist/util/tmail_methods.rb", "lib/mlist/util.rb", "lib/mlist.rb", "lib/pop_ssl.rb", "rails/init.rb"]
s.homepage = %q{http://github.com/aiwilliams/mlist}
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.1}
+ s.rubygems_version = %q{1.3.5}
s.summary = %q{A Ruby mailing list library designed to be integrated into other applications.}
if s.respond_to? :specification_version then
View
11 spec/fixtures/email/at_in_address_label
@@ -0,0 +1,11 @@
+Message-Id: <F5F9DC55-CB54-4F2C-9B46-A05F241BCF22@recursivecreative.com>
+To: "Eating @ Home" <whatever@yesmail.net>
+Content-Type: text/plain; charset=US-ASCII; format=flowed
+Content-Transfer-Encoding: 7bit
+Mime-Version: 1.0 (Apple Message framework v929.2)
+Subject: Test
+Date: Mon, 15 Dec 2008 00:38:31 -0500
+X-Mailer: Apple Mail (2.929.2)
+From: Adam Williams <adam@nomail.net>
+
+Hello there
View
6 spec/models/email_spec.rb
@@ -16,6 +16,12 @@
@email.list_addresses.should == %w(all_down_case@nomail.net all_down_case@yesmail.net)
end
+ it 'should handle @ in label of addresses' do
+ @tmail = tmail_fixture('at_in_address_label')
+ @email = MList::Email.new(:tmail => @tmail)
+ @email.list_addresses.should == %w(whatever@yesmail.net)
+ end
+
it 'should include the cc field in list addresses, no duplicates' do
@tmail.to = 'list_one@example.com'
@tmail.cc = 'list_one@example.com, list_two@example.com'
View
3 spec/spec_helper.rb
@@ -9,10 +9,9 @@
SPEC_ROOT = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(SPEC_ROOT + '/../lib')
-p $LOAD_PATH
Dir[SPEC_ROOT + '/matchers/*.rb'].each { |path| require path }
-require 'activerecord'
+require 'active_record'
SQLITE_DATABASE = "#{SPEC_ROOT}/sqlite3.db"
ActiveRecord::Base.silence do
ActiveRecord::Base.configurations = {'test' => {

0 comments on commit 111090d

Please sign in to comment.
Something went wrong with that request. Please try again.