mail_manager 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.DS_Store +0 -0
- data/.gitignore +20 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +27 -0
- data/Guardfile +24 -0
- data/LICENSE.txt +22 -0
- data/MIT-LICENSE +20 -0
- data/Manifest.txt +141 -0
- data/Procfile +4 -0
- data/README +243 -0
- data/README.md +29 -0
- data/README.rdoc +3 -0
- data/Rakefile +33 -0
- data/app/.DS_Store +0 -0
- data/app/assets/javascripts/mail_manager/application.js +15 -0
- data/app/assets/stylesheets/mail_manager/application.css +13 -0
- data/app/controllers/mail_manager/application_controller.rb +4 -0
- data/app/controllers/mail_manager/base_controller.rb +22 -0
- data/app/controllers/mail_manager/bounces_controller.rb +32 -0
- data/app/controllers/mail_manager/contacts_controller.rb +75 -0
- data/app/controllers/mail_manager/mailing_lists_controller.rb +49 -0
- data/app/controllers/mail_manager/mailings_controller.rb +102 -0
- data/app/controllers/mail_manager/messages_controller.rb +30 -0
- data/app/controllers/mail_manager/subscriptions_controller.rb +104 -0
- data/app/helpers/mail_manager/application_helper.rb +4 -0
- data/app/helpers/mail_manager/subscriptions_helper.rb +8 -0
- data/app/models/.DS_Store +0 -0
- data/app/models/mail_manager.rb +12 -0
- data/app/models/mail_manager/bounce.rb +133 -0
- data/app/models/mail_manager/contact.rb +91 -0
- data/app/models/mail_manager/contactable_registry.rb +190 -0
- data/app/models/mail_manager/mailable_registry.rb +127 -0
- data/app/models/mail_manager/mailer.rb +267 -0
- data/app/models/mail_manager/mailing.rb +266 -0
- data/app/models/mail_manager/mailing_list.rb +36 -0
- data/app/models/mail_manager/message.rb +127 -0
- data/app/models/mail_manager/subscription.rb +126 -0
- data/app/models/mail_manager/test_message.rb +175 -0
- data/app/models/status_history.rb +60 -0
- data/app/views/layouts/mail_manager/application.html.erb +14 -0
- data/app/views/mail_manager/bounces/_email_parts.html.erb +30 -0
- data/app/views/mail_manager/bounces/index.html.erb +32 -0
- data/app/views/mail_manager/bounces/show.html.erb +38 -0
- data/app/views/mail_manager/contacts/_form.html.erb +27 -0
- data/app/views/mail_manager/contacts/double_opt_in.html.erb +1 -0
- data/app/views/mail_manager/contacts/edit.html.erb +12 -0
- data/app/views/mail_manager/contacts/index.html.erb +86 -0
- data/app/views/mail_manager/contacts/new.html.erb +9 -0
- data/app/views/mail_manager/contacts/show.html.erb +22 -0
- data/app/views/mail_manager/contacts/subscribe.html.erb +2 -0
- data/app/views/mail_manager/contacts/thank_you.html.erb +12 -0
- data/app/views/mail_manager/help/_available_email_substitutions.html.erb +5 -0
- data/app/views/mail_manager/mailer/double_opt_in.erb +6 -0
- data/app/views/mail_manager/mailer/unsubscribed.erb +5 -0
- data/app/views/mail_manager/mailer/unsubscribed.html.erb +5 -0
- data/app/views/mail_manager/mailing_lists/_form.html.erb +20 -0
- data/app/views/mail_manager/mailing_lists/edit.html.erb +13 -0
- data/app/views/mail_manager/mailing_lists/index.html.erb +39 -0
- data/app/views/mail_manager/mailing_lists/new.html.erb +9 -0
- data/app/views/mail_manager/mailing_lists/show.html.erb +13 -0
- data/app/views/mail_manager/mailings/_form.html.erb +81 -0
- data/app/views/mail_manager/mailings/edit.html.erb +12 -0
- data/app/views/mail_manager/mailings/index.html.erb +52 -0
- data/app/views/mail_manager/mailings/new.html.erb +9 -0
- data/app/views/mail_manager/mailings/show.html.erb +28 -0
- data/app/views/mail_manager/mailings/test.html.erb +12 -0
- data/app/views/mail_manager/messages/index.html.erb +37 -0
- data/app/views/mail_manager/subscriptions/_form.html.erb +37 -0
- data/app/views/mail_manager/subscriptions/_subscriptions.html.erb +13 -0
- data/app/views/mail_manager/subscriptions/edit.html.erb +11 -0
- data/app/views/mail_manager/subscriptions/index.html.erb +32 -0
- data/app/views/mail_manager/subscriptions/new.html.erb +9 -0
- data/app/views/mail_manager/subscriptions/show.html.erb +8 -0
- data/app/views/mail_manager/subscriptions/unsubscribe.html.erb +2 -0
- data/app/views/mail_manager/subscriptions/unsubscribe_by_email_address.html.erb +13 -0
- data/config/daemons.yml +5 -0
- data/config/routes.rb +43 -0
- data/db/migrate/001_mail_mgr_initial.rb +84 -0
- data/db/migrate/002_mail_mgr_create_contact.rb +60 -0
- data/db/migrate/003_mail_mgr_test_message.rb +23 -0
- data/db/migrate/004_add_deleted_at_to_mailing_lists.rb +15 -0
- data/db/migrate/005_contacts_deleted_at.rb +15 -0
- data/db/migrate/006_mail_mgr_mailing_list_add_defaults_to_active.rb +15 -0
- data/db/migrate/007_mail_mgr_message_add_from_email_address.rb +15 -0
- data/db/mlm_migrate/001_mlm_initial.rb +67 -0
- data/db/mlm_migrate/002_mailable_as_polymorphic.rb +27 -0
- data/db/mlm_migrate/003_contact_as_polymorphic.rb +64 -0
- data/db/mlm_migrate/004_bounce_mlm_mailing_id.rb +26 -0
- data/db/mlm_migrate/005_mlm_to_mail_mgr_scoped.rb +29 -0
- data/engine_plan.rb +13 -0
- data/features/bounce_management.feature +0 -0
- data/features/contact_management.feature +24 -0
- data/features/mailable.feature +23 -0
- data/features/mailing_management.feature +78 -0
- data/features/message.feature +11 -0
- data/features/step_definitions/email_steps.rb +50 -0
- data/features/step_definitions/mlm_steps.rb +11 -0
- data/features/step_definitions/pickle_steps.rb +41 -0
- data/features/step_definitions/webrat_steps.rb +115 -0
- data/features/subscription_management.feature +17 -0
- data/features/support/env.rb +31 -0
- data/features/support/paths.rb +44 -0
- data/lib/daemons/mail_manager.rb +38 -0
- data/lib/daemons/mail_manager_ctl +15 -0
- data/lib/deleteable.rb +50 -0
- data/lib/lock.rb +36 -0
- data/lib/mail_manager.rb +5 -0
- data/lib/mail_manager/config.rb +50 -0
- data/lib/mail_manager/engine.rb +43 -0
- data/lib/mail_manager/version.rb +3 -0
- data/lib/tasks/mail_manager.rake +143 -0
- data/lib/tasks/mail_manager_tasks.rake +4 -0
- data/lib/tasks/rspec.rake +165 -0
- data/lib/workers/mail_manager/bounce_job.rb +52 -0
- data/lib/workers/mail_manager/mailing_job.rb +30 -0
- data/lib/workers/mail_manager/message_job.rb +38 -0
- data/lib/workers/mail_manager/test_message_job.rb +37 -0
- data/mail_manager.gemspec +29 -0
- data/script/rails +8 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +47 -0
- data/spec/test_app/README.rdoc +261 -0
- data/spec/test_app/Rakefile +7 -0
- data/spec/test_app/app/assets/javascripts/application.js +15 -0
- data/spec/test_app/app/assets/javascripts/users.js +2 -0
- data/spec/test_app/app/assets/stylesheets/application.css +13 -0
- data/spec/test_app/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/test_app/app/assets/stylesheets/users.css +4 -0
- data/spec/test_app/app/controllers/application_controller.rb +3 -0
- data/spec/test_app/app/controllers/users_controller.rb +83 -0
- data/spec/test_app/app/helpers/application_helper.rb +2 -0
- data/spec/test_app/app/helpers/users_helper.rb +2 -0
- data/spec/test_app/app/models/user.rb +13 -0
- data/spec/test_app/app/views/layouts/application.html.erb +14 -0
- data/spec/test_app/app/views/users/_form.html.erb +33 -0
- data/spec/test_app/app/views/users/edit.html.erb +6 -0
- data/spec/test_app/app/views/users/index.html.erb +29 -0
- data/spec/test_app/app/views/users/new.html.erb +5 -0
- data/spec/test_app/app/views/users/show.html.erb +25 -0
- data/spec/test_app/config.ru +4 -0
- data/spec/test_app/config/application.rb +65 -0
- data/spec/test_app/config/boot.rb +10 -0
- data/spec/test_app/config/database.yml +25 -0
- data/spec/test_app/config/environment.rb +14 -0
- data/spec/test_app/config/environments/development.rb +37 -0
- data/spec/test_app/config/environments/production.rb +67 -0
- data/spec/test_app/config/environments/test.rb +37 -0
- data/spec/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/test_app/config/initializers/inflections.rb +15 -0
- data/spec/test_app/config/initializers/mime_types.rb +5 -0
- data/spec/test_app/config/initializers/secret_token.rb +7 -0
- data/spec/test_app/config/initializers/session_store.rb +8 -0
- data/spec/test_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/test_app/config/locales/en.yml +5 -0
- data/spec/test_app/config/lockable.yml +3 -0
- data/spec/test_app/config/mail_manager.yml +21 -0
- data/spec/test_app/config/routes.rb +7 -0
- data/spec/test_app/db/migrate/20131217101010_create_users.rb +13 -0
- data/spec/test_app/db/migrate/20131221064151_mail_mgr_initial.rb +84 -0
- data/spec/test_app/db/migrate/20131221064152_mail_mgr_create_contact.rb +60 -0
- data/spec/test_app/db/migrate/20131221064153_mail_mgr_test_message.rb +23 -0
- data/spec/test_app/db/migrate/20131221064154_add_deleted_at_to_mailing_lists.rb +15 -0
- data/spec/test_app/db/migrate/20131221064155_contacts_deleted_at.rb +15 -0
- data/spec/test_app/db/migrate/20131221064156_mail_mgr_mailing_list_add_defaults_to_active.rb +15 -0
- data/spec/test_app/db/migrate/20131221064157_mail_mgr_message_add_from_email_address.rb +15 -0
- data/spec/test_app/db/migrate/20131221072600_create_delayed_jobs.rb +22 -0
- data/spec/test_app/db/schema.rb +131 -0
- data/spec/test_app/db/structure.sql +31 -0
- data/spec/test_app/public/404.html +26 -0
- data/spec/test_app/public/422.html +26 -0
- data/spec/test_app/public/500.html +25 -0
- data/spec/test_app/public/favicon.ico +0 -0
- data/spec/test_app/script/delayed_job +5 -0
- data/spec/test_app/script/lockable +36 -0
- data/spec/test_app/script/rails +6 -0
- data/spec/test_app/spec/controllers/users_controller_spec.rb +160 -0
- data/spec/test_app/spec/factories/mailing_lists.rb +7 -0
- data/spec/test_app/spec/factories/mailings.rb +6 -0
- data/spec/test_app/spec/factories/original_factories.rb.txt +107 -0
- data/spec/test_app/spec/factories/users.rb +10 -0
- data/spec/test_app/spec/models/mail_manager/bounce_spec.rb +17 -0
- data/spec/test_app/spec/models/mail_manager/mailing_list_spec.rb +15 -0
- data/spec/test_app/spec/models/user_spec.rb +37 -0
- data/spec/test_app/spec/requests/users_spec.rb +11 -0
- data/spec/test_app/spec/routing/users_routing_spec.rb +35 -0
- data/spec/test_app/spec/support/database_cleaner.rb +23 -0
- data/spec/test_app/spec/support/files/bad_utf8_chars.eml +32 -0
- data/spec/test_app/spec/views/users/edit.html.erb_spec.rb +24 -0
- data/spec/test_app/spec/views/users/index.html.erb_spec.rb +29 -0
- data/spec/test_app/spec/views/users/new.html.erb_spec.rb +24 -0
- data/spec/test_app/spec/views/users/show.html.erb_spec.rb +21 -0
- data/zeus.json +22 -0
- metadata +424 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
require 'factory_girl'
|
|
2
|
+
require "faker"
|
|
3
|
+
module MailManager
|
|
4
|
+
Factory.sequence :name do |n|
|
|
5
|
+
"AName#{n}"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
Factory.define :mailing_list, :class => MailManager::MailingList do |f|
|
|
9
|
+
Factory.next(:name)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
Factory.sequence :mailing_list do |n|
|
|
13
|
+
@@mailing_list = nil unless defined? @@mailing_list
|
|
14
|
+
@@mailing_list = @@mailing_list.nil? ? Factory.create(:mailing_list,:name => 'Mailing List') : @@mailing_list
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Factory.sequence :email do |n|
|
|
18
|
+
"test#{n}@example.com"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
module LetMeSetMailingListId
|
|
22
|
+
def testable_mailing_list_id=(value)
|
|
23
|
+
self[:mailing_list_id] = value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
Subscription.send(:include, LetMeSetMailingListId)
|
|
27
|
+
|
|
28
|
+
Factory.define :subscription, :class => MailManager::Subscription do |f|
|
|
29
|
+
f.email_address Factory.next(:email)
|
|
30
|
+
f.testable_mailing_list_id MailingList.find_or_create_by_name("Test Mailing List").id
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class TestUser < ActiveRecord::Base
|
|
34
|
+
self.table_name = "#{MailManager.table_prefix}test_users"
|
|
35
|
+
include MailManager::ContactableRegistry::Contactable
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
ActiveRecord::Schema.create_table :"#{MailManager.table_prefix}test_users", :force => true do |t|
|
|
39
|
+
t.string :first
|
|
40
|
+
t.string :last
|
|
41
|
+
t.string :email
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
ContactableRegistry.register_contactable(TestUser, {
|
|
45
|
+
:first_name => :first,
|
|
46
|
+
:last_name => :last,
|
|
47
|
+
:email_address => :email
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
Factory.define :test_user, :class => MailManager::TestUser do |f|
|
|
51
|
+
f.first Factory.next(:name)
|
|
52
|
+
f.last Factory.next(:name)
|
|
53
|
+
f.email Factory.next(:email)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
Factory.define :test_user_subscription, :parent => :subscription do |f|
|
|
57
|
+
f.contact {|a| a.association(:contact, :email => a.email_address) }
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
require 'mail_manager/mailable_registry'
|
|
61
|
+
class TestMailable < ActiveRecord::Base
|
|
62
|
+
self.table_name = "#{MailManager.table_prefix}test_mailables"
|
|
63
|
+
include MailManager::MailableRegistry::Mailable if defined? MailManager::MailableRegistry.respond_to?(:object_id)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
ActiveRecord::Schema.create_table :"#{MailManager.table_prefix}test_mailables", :force => true do |t|
|
|
67
|
+
t.string :name
|
|
68
|
+
t.string :email_html
|
|
69
|
+
t.string :email_text
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
MailableRegistry.register(TestMailable,{
|
|
73
|
+
:find_mailables => :all,
|
|
74
|
+
:name => :name,
|
|
75
|
+
:parts => {
|
|
76
|
+
'text/html' => :email_html,
|
|
77
|
+
'text/plain' => :email_text
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
Factory.define :test_mailable, :class => MailManager::TestMailable do |f|
|
|
82
|
+
f.name Factory.next(:name)
|
|
83
|
+
f.email_text {Faker::Lorem.words(20)}
|
|
84
|
+
f.email_html {|a| "<html><body><p>#{a.email_text}</body></html>"}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
Factory.define :message, :class => MailManager::Message do |f|
|
|
88
|
+
f.association :mailing
|
|
89
|
+
f.association :contact
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
Factory.define :test_message, :class => MailManager::TestMessage do |f|
|
|
93
|
+
f.association :mailing
|
|
94
|
+
f.test_email_address Factory.next(:email)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
Factory.define :mailing, :class => MailManager::Mailing do |f|
|
|
98
|
+
f.subject Factory.next(:name)
|
|
99
|
+
f.mailable {Factory.create(:test_mailable)}
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
Factory.define :bounce, :class => MailManager::Bounce do |f|
|
|
103
|
+
end
|
|
104
|
+
Factory.define :contact, :class => MailManager::Contact do |f|
|
|
105
|
+
f.email_address {Faker::Internet.email}
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
|
2
|
+
|
|
3
|
+
FactoryGirl.define do
|
|
4
|
+
factory :user do
|
|
5
|
+
first_name {Faker::Name.first_name}
|
|
6
|
+
last_name {Faker::Name.last_name}
|
|
7
|
+
email {Faker::Internet.email}
|
|
8
|
+
phone {Faker::PhoneNumber.phone_number}
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
|
|
4
|
+
describe MailManager::Bounce do
|
|
5
|
+
context "when checking pop account" do
|
|
6
|
+
it "should not blow up when mail contains a bad extended char" do
|
|
7
|
+
send_bounce('bad_utf8_chars.eml')
|
|
8
|
+
MailManager::BounceJob.new.perform
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
def send_bounce(filename)
|
|
12
|
+
mail = Mail.new(File.readlines(File.expand_path(File.join(__FILE__,'..','..','..','support','files',filename))).join)
|
|
13
|
+
mail.delivery_method ActionMailer::Base.delivery_method
|
|
14
|
+
mail.delivery_method.settings.merge!(ActionMailer::Base.smtp_settings)
|
|
15
|
+
mail.deliver
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe MailManager::MailingList do
|
|
4
|
+
context "a valid mailing list" do
|
|
5
|
+
before(:each) do
|
|
6
|
+
@mailing_list = FactoryGirl.build(:mailing_list)
|
|
7
|
+
end
|
|
8
|
+
it "must have a name" do
|
|
9
|
+
@mailing_list.name.present?.should be_true
|
|
10
|
+
@mailing_list.valid?.should be_true
|
|
11
|
+
@mailing_list.name = nil
|
|
12
|
+
@mailing_list.valid?.should be_false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe User do
|
|
4
|
+
context "when valid" do
|
|
5
|
+
before(:each) do
|
|
6
|
+
@user = FactoryGirl.build(:user)
|
|
7
|
+
end
|
|
8
|
+
it "should have a uniq email" do
|
|
9
|
+
@user.save
|
|
10
|
+
@user2 = FactoryGirl.build(:user, {email: @user.email})
|
|
11
|
+
@user2.valid?.should be_false
|
|
12
|
+
end
|
|
13
|
+
it "should have an email" do
|
|
14
|
+
@user.valid?.should be_true
|
|
15
|
+
@user.email = nil
|
|
16
|
+
@user.valid?.should be_false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
context "integrated with mail manager" do
|
|
20
|
+
before(:each) do
|
|
21
|
+
@user = FactoryGirl.create(:user)
|
|
22
|
+
end
|
|
23
|
+
it "should respond to subscriptions" do
|
|
24
|
+
@user.respond_to?(:subscriptions).should be_true
|
|
25
|
+
end
|
|
26
|
+
it "should have a contact" do
|
|
27
|
+
@user.contact.present?.should be_true
|
|
28
|
+
end
|
|
29
|
+
it "should have the same email as the contact" do
|
|
30
|
+
@user.email.should == @user.contact.email_address
|
|
31
|
+
end
|
|
32
|
+
it "should be able to subscribe to a mailing list" do
|
|
33
|
+
@mailing_list = FactoryGirl.create(:mailing_list)
|
|
34
|
+
@user.subscribe(@mailing_list)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "Users" do
|
|
4
|
+
describe "GET /users" do
|
|
5
|
+
it "works! (now write some real specs)" do
|
|
6
|
+
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
|
|
7
|
+
get users_path
|
|
8
|
+
response.status.should be(200)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
describe UsersController do
|
|
4
|
+
describe "routing" do
|
|
5
|
+
|
|
6
|
+
it "routes to #index" do
|
|
7
|
+
get("/users").should route_to("users#index")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "routes to #new" do
|
|
11
|
+
get("/users/new").should route_to("users#new")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "routes to #show" do
|
|
15
|
+
get("/users/1").should route_to("users#show", :id => "1")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "routes to #edit" do
|
|
19
|
+
get("/users/1/edit").should route_to("users#edit", :id => "1")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "routes to #create" do
|
|
23
|
+
post("/users").should route_to("users#create")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "routes to #update" do
|
|
27
|
+
put("/users/1").should route_to("users#update", :id => "1")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "routes to #destroy" do
|
|
31
|
+
delete("/users/1").should route_to("users#destroy", :id => "1")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
RSpec.configure do |config|
|
|
2
|
+
|
|
3
|
+
config.before(:suite) do
|
|
4
|
+
DatabaseCleaner.clean_with(:truncation)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
config.before(:each) do
|
|
8
|
+
DatabaseCleaner.strategy = :transaction
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
config.before(:each, :js => true) do
|
|
12
|
+
DatabaseCleaner.strategy = :truncation
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
config.before(:each) do
|
|
16
|
+
DatabaseCleaner.start
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
config.after(:each) do
|
|
20
|
+
DatabaseCleaner.clean
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Return-Path: <jacquejh66@yahoo.com>
|
|
2
|
+
Received: from nm1-vm1.bullet.mail.bf1.yahoo.com (nm1-vm1.bullet.mail.bf1.yahoo.com [98.139.213.163])
|
|
3
|
+
by farnsworth.lnstar.com (8.13.8/8.13.8) with SMTP id rBKIYpvI016165
|
|
4
|
+
for <news@campdoublecreek.com>; Fri, 20 Dec 2013 12:34:51 -0600
|
|
5
|
+
Received: from [66.196.81.171] by nm1.bullet.mail.bf1.yahoo.com with NNFMP; 20 Dec 2013 18:34:45 -0000
|
|
6
|
+
Received: from [98.139.212.243] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 20 Dec 2013 18:34:45 -0000
|
|
7
|
+
Received: from [127.0.0.1] by omp1052.mail.bf1.yahoo.com with NNFMP; 20 Dec 2013 18:34:45 -0000
|
|
8
|
+
X-Yahoo-Newman-Property: ymail-3
|
|
9
|
+
X-Yahoo-Newman-Id: 793592.41489.bm@omp1052.mail.bf1.yahoo.com
|
|
10
|
+
Received: (qmail 44115 invoked by uid 0); 20 Dec 2013 18:34:45 -0000
|
|
11
|
+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1387564485; bh=6UG8AsSMFmibtdkz4IEcBE0VLoseG+2As0McwpvPGwI=; h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=d/I5svKWXJwPk81nhs0gchmcmNPTHfLjU2Je7uckgbVWtfFx9oK50ACgz2Ppz6nojAwFoi2uNtlprwumudWNsB+tfqfuQUtchxnfW5d4cI48D8fyqiwfGsZ6SaAtEOu1SpaqHIH8MAfBUqBNnxpjzfFYqsNOFOrmSrHBD94WDO8=
|
|
12
|
+
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
|
|
13
|
+
s=s1024; d=yahoo.com;
|
|
14
|
+
h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type;
|
|
15
|
+
b=boDNO+GQCsNLWGr9tAuBXIEtbjIGi26SkQbSmu/8aZmOfGqA1SPiypABnatA6JzRHiNwXtWVZX0nZdVSlJTE556ZZVVyFjz7jAaKNikQ9/ho0IWFqOmkjhUCs1KbDdDvJILFeJQ3Y60BN8jFEWEBfUWFQ8qQbJ0sk/RMgFwDK1w=;
|
|
16
|
+
Message-ID: <571480.32075.qm@web162408.mail.bf1.yahoo.com>
|
|
17
|
+
Date: Fri, 20 Dec 2013 10:34:45 -0800 (PST)
|
|
18
|
+
From: Jacqueline Haas <jacquejh66@yahoo.com>
|
|
19
|
+
Subject: Auto Response
|
|
20
|
+
To: news@campdoublecreek.com
|
|
21
|
+
MIME-Version: 1.0
|
|
22
|
+
Content-Type: text/plain; charset=us-ascii
|
|
23
|
+
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,
|
|
24
|
+
DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,
|
|
25
|
+
RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD autolearn=no
|
|
26
|
+
version=3.3.2
|
|
27
|
+
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
|
|
28
|
+
farnsworth.lnstar.com
|
|
29
|
+
|
|
30
|
+
I will be out of the office until December 29, 2013. �If you need assistance, please contact 512-579-4000.
|
|
31
|
+
|
|
32
|
+
Jacque Haas
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "users/edit" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@user = assign(:user, stub_model(User,
|
|
6
|
+
:first_name => "MyString",
|
|
7
|
+
:last_name => "MyString",
|
|
8
|
+
:email => "MyString",
|
|
9
|
+
:phone => 1
|
|
10
|
+
))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "renders the edit user form" do
|
|
14
|
+
render
|
|
15
|
+
|
|
16
|
+
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
17
|
+
assert_select "form[action=?][method=?]", user_path(@user), "post" do
|
|
18
|
+
assert_select "input#user_first_name[name=?]", "user[first_name]"
|
|
19
|
+
assert_select "input#user_last_name[name=?]", "user[last_name]"
|
|
20
|
+
assert_select "input#user_email[name=?]", "user[email]"
|
|
21
|
+
assert_select "input#user_phone[name=?]", "user[phone]"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "users/index" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:users, [
|
|
6
|
+
stub_model(User,
|
|
7
|
+
:first_name => "First Name",
|
|
8
|
+
:last_name => "Last Name",
|
|
9
|
+
:email => "Email",
|
|
10
|
+
:phone => 1
|
|
11
|
+
),
|
|
12
|
+
stub_model(User,
|
|
13
|
+
:first_name => "First Name",
|
|
14
|
+
:last_name => "Last Name",
|
|
15
|
+
:email => "Email",
|
|
16
|
+
:phone => 1
|
|
17
|
+
)
|
|
18
|
+
])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "renders a list of users" do
|
|
22
|
+
render
|
|
23
|
+
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
24
|
+
assert_select "tr>td", :text => "First Name".to_s, :count => 2
|
|
25
|
+
assert_select "tr>td", :text => "Last Name".to_s, :count => 2
|
|
26
|
+
assert_select "tr>td", :text => "Email".to_s, :count => 2
|
|
27
|
+
assert_select "tr>td", :text => 1.to_s, :count => 2
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "users/new" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
assign(:user, stub_model(User,
|
|
6
|
+
:first_name => "MyString",
|
|
7
|
+
:last_name => "MyString",
|
|
8
|
+
:email => "MyString",
|
|
9
|
+
:phone => 1
|
|
10
|
+
).as_new_record)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "renders new user form" do
|
|
14
|
+
render
|
|
15
|
+
|
|
16
|
+
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
17
|
+
assert_select "form[action=?][method=?]", users_path, "post" do
|
|
18
|
+
assert_select "input#user_first_name[name=?]", "user[first_name]"
|
|
19
|
+
assert_select "input#user_last_name[name=?]", "user[last_name]"
|
|
20
|
+
assert_select "input#user_email[name=?]", "user[email]"
|
|
21
|
+
assert_select "input#user_phone[name=?]", "user[phone]"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe "users/show" do
|
|
4
|
+
before(:each) do
|
|
5
|
+
@user = assign(:user, stub_model(User,
|
|
6
|
+
:first_name => "First Name",
|
|
7
|
+
:last_name => "Last Name",
|
|
8
|
+
:email => "Email",
|
|
9
|
+
:phone => 1
|
|
10
|
+
))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "renders attributes in <p>" do
|
|
14
|
+
render
|
|
15
|
+
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
16
|
+
rendered.should match(/First Name/)
|
|
17
|
+
rendered.should match(/Last Name/)
|
|
18
|
+
rendered.should match(/Email/)
|
|
19
|
+
rendered.should match(/1/)
|
|
20
|
+
end
|
|
21
|
+
end
|
data/zeus.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"command": "ruby -rubygems -r./engine_plan -eZeus.go",
|
|
3
|
+
|
|
4
|
+
"plan": {
|
|
5
|
+
"boot": {
|
|
6
|
+
"default_bundle": {
|
|
7
|
+
"development_environment": {
|
|
8
|
+
"prerake": {"rake": []},
|
|
9
|
+
"runner": ["r"],
|
|
10
|
+
"console": ["c"],
|
|
11
|
+
"server": ["s"],
|
|
12
|
+
"generate": ["g"],
|
|
13
|
+
"destroy": ["d"],
|
|
14
|
+
"dbconsole": []
|
|
15
|
+
},
|
|
16
|
+
"test_environment": {
|
|
17
|
+
"test_helper": {"test": ["rspec", "testrb"]}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|