spud_inquiries 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/README.markdown +16 -5
  2. data/app/controllers/contacts_controller.rb +23 -17
  3. data/app/controllers/spud/admin/inquiries_controller.rb +2 -1
  4. data/app/controllers/spud/admin/inquiry_forms_controller.rb +3 -5
  5. data/app/controllers/spud/inquiries/sitemaps_controller.rb +3 -2
  6. data/app/mailers/spud/inquiry_mailer.rb +3 -2
  7. data/app/models/spud_inquiry.rb +2 -1
  8. data/app/models/spud_inquiry_field.rb +1 -0
  9. data/app/models/spud_inquiry_form.rb +8 -6
  10. data/app/models/spud_inquiry_form_field.rb +2 -5
  11. data/app/views/contacts/_show.html.erb +7 -5
  12. data/app/views/contacts/_show_liquid.html.erb +34 -0
  13. data/app/views/contacts/show.html.erb +4 -4
  14. data/app/views/contacts/show.js.erb +1 -0
  15. data/app/views/contacts/thankyou.js.erb +1 -0
  16. data/app/views/spud/admin/inquiry_forms/_form.html.erb +15 -9
  17. data/app/views/spud/admin/inquiry_forms/_spud_inquiry_form_field_fields.html.erb +8 -2
  18. data/app/views/spud/admin/inquiry_forms/index.html.erb +1 -1
  19. data/app/views/spud/admin/inquiry_forms/new.html.erb +1 -1
  20. data/app/views/spud/inquiries/sitemaps/show.xml.builder +1 -1
  21. data/config/routes.rb +15 -21
  22. data/db/migrate/20120117133412_create_spud_inquiry_fields.rb +1 -1
  23. data/db/migrate/20120122173829_add_field_order_to_spud_inquiry_form_fields.rb +1 -1
  24. data/db/migrate/20120126132407_add_spud_inquiry_form_id_to_spud_inquiries.rb +2 -2
  25. data/db/migrate/20120127023335_add_url_name_to_spud_inquiry_forms.rb +1 -1
  26. data/db/migrate/20121228145215_add_thank_you_content_to_spud_inquiry_form.rb +5 -0
  27. data/db/migrate/20130627121030_add_placeholder_to_spud_inquiry_form_fields.rb +5 -0
  28. data/lib/spud_inquiries/configuration.rb +2 -1
  29. data/lib/spud_inquiries/engine.rb +4 -0
  30. data/lib/spud_inquiries/liquid_form.rb +2 -1
  31. data/lib/spud_inquiries/version.rb +1 -1
  32. data/spec/controllers/contacts_controller_spec.rb +69 -0
  33. data/spec/controllers/spud/admin/inquiries_controller_spec.rb +55 -0
  34. data/spec/controllers/spud/admin/inquiry_forms_controller_spec.rb +97 -0
  35. data/spec/controllers/spud/inquiries/sitemaps_controller_spec.rb +23 -0
  36. data/spec/dummy/config/database.yml +0 -28
  37. data/spec/dummy/db/schema.rb +10 -8
  38. data/spec/dummy/log/development.log +87 -72
  39. data/spec/dummy/log/test.log +1244 -0
  40. data/spec/models/spud_inquiry_field_spec.rb +18 -0
  41. data/spec/models/spud_inquiry_form_field_spec.rb +36 -0
  42. data/spec/models/spud_inquiry_form_spec.rb +28 -0
  43. data/spec/models/spud_inquiry_spec.rb +22 -0
  44. data/spec/spec_helper.rb +9 -0
  45. metadata +28 -5
@@ -0,0 +1,69 @@
1
+ require 'spec_helper'
2
+
3
+ describe ContactsController do
4
+ before(:each) do
5
+ Spud::Core.configure do |config|
6
+ config.site_name = "Test Site"
7
+ config.multisite_mode_enabled = false
8
+ config.multisite_config = []
9
+ end
10
+ end
11
+
12
+ describe :show do
13
+ it "should return a form by url name" do
14
+ form = FactoryGirl.create(:spud_inquiry_form)
15
+ get :show, :id => form.url_name
16
+ assigns(:inquiry_form).should == form
17
+ assigns(:inquiry).should_not be_blank
18
+ end
19
+
20
+ it "should redirect to root if inquiry not found" do
21
+ get :show, :id => 1234
22
+ response.should redirect_to "/"
23
+ end
24
+ end
25
+
26
+ describe :inquire do
27
+ before(:each) do
28
+ @form = FactoryGirl.create(:spud_inquiry_form)
29
+ @field = FactoryGirl.create(:spud_inquiry_form_field,:spud_inquiry_form => @form,:name => "email",:field_type => '0', :required => true)
30
+ end
31
+
32
+ it "should fail if spam field assigned" do
33
+ post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id}, :other_email => "test@spamcastle.com"
34
+ flash[:error].should =~ /You must be a robot/i
35
+ end
36
+
37
+ it "should fail if inquiry not submitted" do
38
+ post :inquire
39
+ response.should redirect_to "/"
40
+ end
41
+
42
+ it "should fail if the inquiry form is invalid" do
43
+ post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id + 2}
44
+ response.should redirect_to "/"
45
+ end
46
+
47
+ it "should fail if required field is blank" do
48
+ post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id}
49
+ response.should be_success
50
+ response.should_not redirect_to contact_thankyou_url
51
+ end
52
+
53
+ # it "should succed if fields are valid" do
54
+ # post :inquire,:spud_inquiry => {:spud_inquiry_form_id => @form.id, "email" => "test@test.com"}
55
+ # assigns(:inquiry).should be_valid
56
+ # response.should be_success
57
+ # response.should redirect_to contact_thankyou_url
58
+
59
+ # end
60
+
61
+ end
62
+
63
+ describe :thankyou do
64
+ it "should render successfully" do
65
+ get :thankyou
66
+ response.should be_success
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,55 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spud::Admin::InquiriesController do
4
+ before(:each) do
5
+ activate_authlogic
6
+ u = SpudUser.new(:login => "testuser",:email => "test@testuser.com",:password => "test",:password_confirmation => "test")
7
+ u.super_admin = true
8
+ u.save
9
+ @user = SpudUserSession.create(u)
10
+ Spud::Core.configure do |config|
11
+ config.site_name = "Test Site"
12
+ config.multisite_mode_enabled = false
13
+ config.multisite_config = []
14
+ end
15
+ end
16
+
17
+ describe :index do
18
+ it "should return an array of menus" do
19
+ 2.times {|x| s = FactoryGirl.create(:spud_inquiry)}
20
+ get :index
21
+ assigns(:inquiries).count.should be > 1
22
+ end
23
+ end
24
+
25
+ describe :show do
26
+ it "should return a preview of an inquiry" do
27
+ s = FactoryGirl.create(:spud_inquiry)
28
+ get :show, :id => s.id
29
+ assigns(:inquiry).should == s
30
+ end
31
+
32
+ it "should redirect to index if inquiry not found" do
33
+ get :show, :id => 1234
34
+ response.should redirect_to spud_admin_inquiries_url
35
+ end
36
+ end
37
+
38
+ describe :destroy do
39
+ it "should destroy the menu" do
40
+ inquiry = FactoryGirl.create(:spud_inquiry)
41
+ lambda {
42
+ delete :destroy, :id => inquiry.id
43
+ }.should change(SpudInquiry,:count).by(-1)
44
+ response.should be_redirect
45
+ end
46
+
47
+ it "should not destroy the menu with a wrong id" do
48
+ inquiry = FactoryGirl.create(:spud_inquiry)
49
+ lambda {
50
+ delete :destroy,:id => "23532"
51
+ }.should_not change(SpudInquiry,:count)
52
+ response.should be_redirect
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,97 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spud::Admin::InquiryFormsController do
4
+ before(:each) do
5
+ activate_authlogic
6
+ u = SpudUser.new(:login => "testuser",:email => "test@testuser.com",:password => "test",:password_confirmation => "test")
7
+ u.super_admin = true
8
+ u.save
9
+ @user = SpudUserSession.create(u)
10
+ Spud::Core.configure do |config|
11
+ config.site_name = "Test Site"
12
+ config.multisite_mode_enabled = false
13
+ config.multisite_config = []
14
+ end
15
+ end
16
+
17
+ describe :index do
18
+ it "should return an array of menus" do
19
+ 2.times {|x| s = FactoryGirl.create(:spud_inquiry_form)}
20
+ get :index
21
+ assigns(:inquiry_forms).count.should be > 1
22
+ end
23
+ end
24
+
25
+ describe :new do
26
+ it "should respond with a new form" do
27
+ get :new
28
+ assigns(:inquiry_form).should_not be_blank
29
+ response.should be_success
30
+ end
31
+ end
32
+
33
+ describe :create do
34
+ it "should create a new form with a valid form submission" do
35
+ lambda {
36
+ post :create, :spud_inquiry_form => FactoryGirl.attributes_for(:spud_inquiry_form).reject{|k,v| k == 'site_id' || k == 'id'}
37
+ }.should change(SpudInquiryForm,:count).by(1)
38
+ response.should be_redirect
39
+ end
40
+
41
+ it "should not create a form with an invalid form entry" do
42
+ lambda {
43
+ post :create, :spud_inquiry_form => FactoryGirl.attributes_for(:spud_inquiry_form,:name => nil).reject{|k,v| k == 'site_id' || k == 'id'}
44
+ }.should_not change(SpudInquiryForm,:count)
45
+ end
46
+ end
47
+
48
+ describe :edit do
49
+ it "should respond with form by id" do
50
+ form1 = FactoryGirl.create(:spud_inquiry_form)
51
+ form2 = FactoryGirl.create(:spud_inquiry_form)
52
+ get :edit,:id => form2.id
53
+ assigns(:inquiry_form).should == form2
54
+ end
55
+
56
+ it "should redirect to index if form not found" do
57
+ get :edit,:id => 1234
58
+ response.should redirect_to spud_admin_inquiry_forms_url
59
+ end
60
+ end
61
+
62
+ describe :update do
63
+ it "should update the name when the name attribute is changed" do
64
+ form = FactoryGirl.create(:spud_inquiry_form)
65
+ new_name = 'MyForm'
66
+ lambda {
67
+ put :update,:id => form.id, :spud_inquiry_form => form.attributes.merge!(:name => new_name).reject{|k,v| k == 'site_id' || k == 'id'}
68
+ form.reload
69
+ }.should change(form,:name).to(new_name)
70
+
71
+ end
72
+
73
+ it "should redirect to the admin forms after a successful update" do
74
+ form = FactoryGirl.create(:spud_inquiry_form)
75
+ put :update,:id => form.id,:spud_menu => form.attributes.merge!(:name => "MyMenu").reject{|k,v| k == 'site_id' || k == 'id'}
76
+ response.should redirect_to(spud_admin_inquiry_forms_url)
77
+ end
78
+ end
79
+
80
+ describe :destroy do
81
+ it "should destroy the form" do
82
+ form = FactoryGirl.create(:spud_inquiry_form)
83
+ lambda {
84
+ delete :destroy, :id => form.id
85
+ }.should change(SpudInquiryForm,:count).by(-1)
86
+ response.should be_redirect
87
+ end
88
+
89
+ it "should not destroy the form with a wrong id" do
90
+ menu = FactoryGirl.create(:spud_inquiry_form)
91
+ lambda {
92
+ delete :destroy,:id => "23532"
93
+ }.should_not change(SpudInquiryForm,:count)
94
+ response.should be_redirect
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Spud::Inquiries::SitemapsController do
4
+ describe :show do
5
+ before(:each) do
6
+ Spud::Core.configure do |config|
7
+ config.site_name = "Test Site"
8
+ config.multisite_mode_enabled = false
9
+ config.multisite_config = []
10
+ end
11
+ end
12
+
13
+ it "should return the sitemap urls" do
14
+ get :show, :format => :xml
15
+ assigns(:forms).should == SpudInquiryForm.all
16
+ end
17
+
18
+ it "should only respond to an XML format" do
19
+ get :show
20
+ response.response_code.should == 406
21
+ end
22
+ end
23
+ end
@@ -1,37 +1,9 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
1
  development:
7
2
  adapter: mysql2
8
- encoding: utf8
9
- reconnect: true
10
3
  database: spud_inquiries_development
11
- pool: 5
12
4
  username: root
13
- password:
14
- socket: /tmp/mysql.sock
15
5
 
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
6
  test:
20
7
  adapter: mysql2
21
- encoding: utf8
22
- reconnect: true
23
8
  database: spud_inquiries_test
24
- pool: 5
25
9
  username: root
26
- password:
27
- socket: /tmp/mysql.sock
28
-
29
- production:
30
- adapter: mysql2
31
- encoding: utf8
32
- reconnect: true
33
- database: spud_inquiries_production
34
- pool: 5
35
- username: root
36
- password:
37
- socket: /tmp/mysql.sock
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20120610131541) do
14
+ ActiveRecord::Schema.define(:version => 20130627121030) do
15
15
 
16
16
  create_table "spud_admin_permissions", :force => true do |t|
17
17
  t.integer "user_id"
@@ -32,8 +32,8 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
32
32
  t.boolean "marked_as_read", :default => false
33
33
  end
34
34
 
35
- add_index "spud_inquiries", ["marked_as_read"], :name => "index_spud_inquiries_on_marked_as_read"
36
- add_index "spud_inquiries", ["spud_inquiry_form_id"], :name => "index_spud_inquiries_on_spud_inquiry_form_id"
35
+ add_index "spud_inquiries", ["marked_as_read"], :name => "idx_inquiry_read"
36
+ add_index "spud_inquiries", ["spud_inquiry_form_id"], :name => "idx_inquiry_form"
37
37
 
38
38
  create_table "spud_inquiry_fields", :force => true do |t|
39
39
  t.string "name"
@@ -43,7 +43,7 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
43
43
  t.datetime "updated_at", :null => false
44
44
  end
45
45
 
46
- add_index "spud_inquiry_fields", ["spud_inquiry_id"], :name => "index_spud_inquiry_fields_on_spud_inquiry_id"
46
+ add_index "spud_inquiry_fields", ["spud_inquiry_id"], :name => "inquiry_field_parent_id"
47
47
 
48
48
  create_table "spud_inquiry_form_fields", :force => true do |t|
49
49
  t.integer "spud_inquiry_form_id"
@@ -55,21 +55,23 @@ ActiveRecord::Schema.define(:version => 20120610131541) do
55
55
  t.datetime "updated_at", :null => false
56
56
  t.integer "field_order"
57
57
  t.boolean "required"
58
+ t.string "placeholder"
58
59
  end
59
60
 
60
- add_index "spud_inquiry_form_fields", ["field_order"], :name => "index_spud_inquiry_form_fields_on_field_order"
61
+ add_index "spud_inquiry_form_fields", ["field_order"], :name => "form_field_order"
61
62
 
62
63
  create_table "spud_inquiry_forms", :force => true do |t|
63
64
  t.string "name"
64
65
  t.text "content"
65
- t.datetime "created_at", :null => false
66
- t.datetime "updated_at", :null => false
66
+ t.datetime "created_at", :null => false
67
+ t.datetime "updated_at", :null => false
67
68
  t.text "recipients"
68
69
  t.string "subject"
69
70
  t.string "url_name"
71
+ t.text "thank_you_content"
70
72
  end
71
73
 
72
- add_index "spud_inquiry_forms", ["url_name"], :name => "index_spud_inquiry_forms_on_url_name"
74
+ add_index "spud_inquiry_forms", ["url_name"], :name => "idx_form_url_name"
73
75
 
74
76
  create_table "spud_user_settings", :force => true do |t|
75
77
  t.integer "spud_user_id"
@@ -1,88 +1,103 @@
1
-  (337.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
2
-  (275.8ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
3
-  (0.3ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+  (15.1ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
4
+  (7.4ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
5
+  (1.5ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
4
6
  Migrating to CreateSpudInquiries (20120117133405)
5
-  (80.2ms) CREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
6
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120117133405')
7
+  (17.2ms) CREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
8
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120117133405')
7
9
  Migrating to CreateSpudInquiryFields (20120117133412)
8
-  (185.5ms) CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
9
-  (296.6ms) CREATE INDEX `index_spud_inquiry_fields_on_spud_inquiry_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)
10
-  (22.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120117133412')
10
+  (6.3ms) CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
11
+  (7.5ms) CREATE INDEX `inquiry_field_parent_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)
12
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120117133412')
11
13
  Migrating to CreateSpudInquiryForms (20120121194439)
12
-  (66.2ms) CREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
13
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194439')
14
+  (10.7ms) CREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
15
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194439')
14
16
  Migrating to CreateSpudInquiryFormFields (20120121194447)
15
-  (174.4ms) CREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` varchar(255), `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
16
-  (0.8ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194447')
17
+  (6.3ms) CREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` varchar(255), `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
18
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120121194447')
17
19
  Migrating to AddFieldOrderToSpudInquiryFormFields (20120122173829)
18
-  (166.0ms) ALTER TABLE `spud_inquiry_form_fields` ADD `field_order` int(11)
19
-  (166.9ms) ALTER TABLE `spud_inquiry_form_fields` ADD `required` tinyint(1)
20
-  (168.7ms) CREATE INDEX `index_spud_inquiry_form_fields_on_field_order` ON `spud_inquiry_form_fields` (`field_order`)
21
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120122173829')
20
+  (6.9ms) ALTER TABLE `spud_inquiry_form_fields` ADD `field_order` int(11)
21
+  (8.7ms) ALTER TABLE `spud_inquiry_form_fields` ADD `required` tinyint(1)
22
+  (19.6ms) CREATE INDEX `form_field_order` ON `spud_inquiry_form_fields` (`field_order`)
23
+  (1.1ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120122173829')
22
24
  Migrating to AddSpudInquiryFormIdToSpudInquiries (20120126132407)
23
-  (174.5ms) ALTER TABLE `spud_inquiries` ADD `spud_inquiry_form_id` int(11)
24
-  (176.7ms) ALTER TABLE `spud_inquiries` ADD `recipients` text
25
-  (166.3ms) ALTER TABLE `spud_inquiries` ADD `subject` varchar(255)
26
-  (118.8ms) ALTER TABLE `spud_inquiries` ADD `marked_as_read` tinyint(1) DEFAULT 0
27
-  (178.6ms) CREATE INDEX `index_spud_inquiries_on_marked_as_read` ON `spud_inquiries` (`marked_as_read`)
28
-  (157.2ms) CREATE INDEX `index_spud_inquiries_on_spud_inquiry_form_id` ON `spud_inquiries` (`spud_inquiry_form_id`)
29
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120126132407')
25
+  (10.7ms) ALTER TABLE `spud_inquiries` ADD `spud_inquiry_form_id` int(11)
26
+  (8.5ms) ALTER TABLE `spud_inquiries` ADD `recipients` text
27
+  (7.0ms) ALTER TABLE `spud_inquiries` ADD `subject` varchar(255)
28
+  (18.2ms) ALTER TABLE `spud_inquiries` ADD `marked_as_read` tinyint(1) DEFAULT 0
29
+  (8.8ms) CREATE INDEX `idx_inquiry_read` ON `spud_inquiries` (`marked_as_read`)
30
+  (10.4ms) CREATE INDEX `idx_inquiry_form` ON `spud_inquiries` (`spud_inquiry_form_id`)
31
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120126132407')
30
32
  Migrating to AddRecipientsToSpudInquiryForms (20120126132522)
31
-  (163.0ms) ALTER TABLE `spud_inquiry_forms` ADD `recipients` text
32
-  (166.1ms) ALTER TABLE `spud_inquiry_forms` ADD `subject` varchar(255)
33
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120126132522')
33
+  (17.3ms) ALTER TABLE `spud_inquiry_forms` ADD `recipients` text
34
+  (15.7ms) ALTER TABLE `spud_inquiry_forms` ADD `subject` varchar(255)
35
+  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120126132522')
34
36
  Migrating to AddUrlNameToSpudInquiryForms (20120127023335)
35
-  (153.6ms) ALTER TABLE `spud_inquiry_forms` ADD `url_name` varchar(255)
36
-  (157.2ms) CREATE INDEX `index_spud_inquiry_forms_on_url_name` ON `spud_inquiry_forms` (`url_name`)
37
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120127023335')
37
+  (23.9ms) ALTER TABLE `spud_inquiry_forms` ADD `url_name` varchar(255)
38
+  (8.2ms) CREATE INDEX `idx_form_url_name` ON `spud_inquiry_forms` (`url_name`)
39
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120127023335')
38
40
  Migrating to ChangeInquiryFormFieldsColumn (20120413124900)
39
-  (149.4ms) ALTER TABLE `spud_inquiry_form_fields` CHANGE `options` `options` text DEFAULT NULL
40
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120413124900')
41
+  (15.6ms) ALTER TABLE `spud_inquiry_form_fields` CHANGE `options` `options` text DEFAULT NULL
42
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120413124900')
41
43
  Migrating to CreateSpudAdminPermissions (20120610131537)
42
-  (182.7ms) CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
44
+  (7.3ms) CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
43
45
   (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131537')
44
46
  Migrating to CreateSpudUsers (20120610131538)
45
-  (153.7ms) CREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
46
-  (171.1ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
47
-  (166.4ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
48
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131538')
47
+  (5.5ms) CREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
48
+  (13.8ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
49
+  (18.0ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
50
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131538')
49
51
  Migrating to AddTimeZoneToSpudUser (20120610131539)
50
-  (162.8ms) ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
51
-  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131539')
52
+  (20.1ms) ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
53
+  (0.3ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131539')
52
54
  Migrating to AddScopeToSpudAdminPermissions (20120610131540)
53
-  (165.1ms) ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
54
-  (0.8ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131540')
55
+  (17.3ms) ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
56
+  (0.5ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131540')
55
57
  Migrating to CreateSpudUserSettings (20120610131541)
56
-  (149.9ms) CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
57
-  (0.6ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131541')
58
-  (0.1ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
59
-  (0.4ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
60
-  (0.5ms) DROP DATABASE IF EXISTS `spud_inquiries_test`
61
-  (0.3ms) CREATE DATABASE `spud_inquiries_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
62
-  (70.3ms) CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `scope` varchar(255)) ENGINE=InnoDB
63
-  (162.7ms) CREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `spud_inquiry_form_id` int(11), `recipients` text, `subject` varchar(255), `marked_as_read` tinyint(1) DEFAULT 0) ENGINE=InnoDB
64
-  (181.8ms) CREATE INDEX `index_spud_inquiries_on_marked_as_read` ON `spud_inquiries` (`marked_as_read`)
65
-  (166.4ms) CREATE INDEX `index_spud_inquiries_on_spud_inquiry_form_id` ON `spud_inquiries` (`spud_inquiry_form_id`)
66
-  (172.1ms) CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
67
-  (181.0ms) CREATE INDEX `index_spud_inquiry_fields_on_spud_inquiry_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)
68
-  (161.7ms) CREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` text, `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `field_order` int(11), `required` tinyint(1)) ENGINE=InnoDB
69
-  (169.9ms) CREATE INDEX `index_spud_inquiry_form_fields_on_field_order` ON `spud_inquiry_form_fields` (`field_order`)
70
-  (150.3ms) CREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `recipients` text, `subject` varchar(255), `url_name` varchar(255)) ENGINE=InnoDB
71
-  (170.4ms) CREATE INDEX `index_spud_inquiry_forms_on_url_name` ON `spud_inquiry_forms` (`url_name`)
72
-  (149.4ms) CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
73
-  (164.5ms) CREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `time_zone` varchar(255)) ENGINE=InnoDB
74
-  (159.1ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
75
-  (155.5ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
76
-  (161.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
77
-  (172.6ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
58
+  (17.5ms) CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
59
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20120610131541')
60
+ Migrating to AddThankYouContentToSpudInquiryForm (20121228145215)
61
+  (7.4ms) ALTER TABLE `spud_inquiry_forms` ADD `thank_you_content` text
62
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20121228145215')
63
+ Migrating to AddPlaceholderToSpudInquiryFormFields (20130627121030)
64
+  (21.0ms) ALTER TABLE `spud_inquiry_form_fields` ADD `placeholder` varchar(255)
65
+  (0.4ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20130627121030')
66
+  (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations`
67
+ Connecting to database specified by database.yml
68
+  (1.5ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` 
69
+  (5.3ms) DROP DATABASE IF EXISTS `spud_inquiries_test`
70
+  (0.6ms) CREATE DATABASE `spud_inquiries_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`
71
+  (40.1ms) CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `scope` varchar(255)) ENGINE=InnoDB
72
+  (5.5ms) CREATE TABLE `spud_inquiries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `email` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `spud_inquiry_form_id` int(11), `recipients` text, `subject` varchar(255), `marked_as_read` tinyint(1) DEFAULT 0) ENGINE=InnoDB
73
+  (7.8ms) CREATE INDEX `idx_inquiry_read` ON `spud_inquiries` (`marked_as_read`)
74
+  (10.5ms) CREATE INDEX `idx_inquiry_form` ON `spud_inquiries` (`spud_inquiry_form_id`)
75
+  (8.6ms) CREATE TABLE `spud_inquiry_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `value` text, `spud_inquiry_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
76
+  (6.7ms) CREATE INDEX `inquiry_field_parent_id` ON `spud_inquiry_fields` (`spud_inquiry_id`)
77
+  (21.2ms) CREATE TABLE `spud_inquiry_form_fields` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_inquiry_form_id` int(11), `field_type` varchar(255), `name` varchar(255), `options` text, `default_value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `field_order` int(11), `required` tinyint(1), `placeholder` varchar(255)) ENGINE=InnoDB
78
+  (10.8ms) CREATE INDEX `form_field_order` ON `spud_inquiry_form_fields` (`field_order`)
79
+  (17.0ms) CREATE TABLE `spud_inquiry_forms` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `recipients` text, `subject` varchar(255), `url_name` varchar(255), `thank_you_content` text) ENGINE=InnoDB
80
+  (7.0ms) CREATE INDEX `idx_form_url_name` ON `spud_inquiry_forms` (`url_name`)
81
+  (20.8ms) CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
82
+  (6.0ms) CREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `time_zone` varchar(255)) ENGINE=InnoDB
83
+  (15.1ms) CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
84
+  (20.2ms) CREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)
85
+  (16.0ms) CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
86
+  (10.8ms) CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)
78
87
   (0.1ms) SELECT version FROM `schema_migrations`
79
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131541')
80
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120117133405')
81
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120117133412')
82
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120121194439')
83
-  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120121194447')
84
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120122173829')
85
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120126132407')
86
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120126132522')
87
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120127023335')
88
-  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20120413124900')
88
+  (0.3ms) INSERT INTO `schema_migrations` (version) VALUES ('20130627121030')
89
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131537')
90
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131538')
91
+  (0.1ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131539')
92
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131540')
93
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120610131541')
94
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120117133405')
95
+  (0.1ms) INSERT INTO `schema_migrations` (version) VALUES ('20120117133412')
96
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120121194439')
97
+  (0.5ms) INSERT INTO `schema_migrations` (version) VALUES ('20120121194447')
98
+  (0.4ms) INSERT INTO `schema_migrations` (version) VALUES ('20120122173829')
99
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120126132407')
100
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120126132522')
101
+  (1.0ms) INSERT INTO `schema_migrations` (version) VALUES ('20120127023335')
102
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20120413124900')
103
+  (0.2ms) INSERT INTO `schema_migrations` (version) VALUES ('20121228145215')