clearance 0.8.8 → 0.9.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of clearance might be problematic. Click here for more details.
- data/CHANGELOG.md +8 -0
- data/README.md +27 -32
- data/Rakefile +25 -31
- data/app/controllers/clearance/passwords_controller.rb +1 -1
- data/app/controllers/clearance/sessions_controller.rb +1 -1
- data/app/models/clearance_mailer.rb +4 -4
- data/app/views/passwords/edit.html.erb +1 -1
- data/app/views/passwords/new.html.erb +2 -2
- data/app/views/sessions/new.html.erb +1 -1
- data/app/views/users/_form.html.erb +1 -1
- data/app/views/users/new.html.erb +1 -1
- data/config/routes.rb +30 -0
- data/lib/clearance.rb +2 -1
- data/lib/clearance/authentication.rb +2 -2
- data/lib/clearance/configuration.rb +10 -3
- data/lib/clearance/engine.rb +8 -0
- data/lib/clearance/user.rb +5 -6
- data/lib/rails/generators/clearance_features_generator.rb +20 -0
- data/{generators/clearance_features/templates → lib/rails/generators/clearance_features_templates}/features/password_reset.feature +1 -1
- data/{generators/clearance_features/templates → lib/rails/generators/clearance_features_templates}/features/sign_in.feature +0 -0
- data/{generators/clearance_features/templates → lib/rails/generators/clearance_features_templates}/features/sign_out.feature +0 -0
- data/{generators/clearance_features/templates → lib/rails/generators/clearance_features_templates}/features/sign_up.feature +0 -0
- data/{generators/clearance_features/templates → lib/rails/generators/clearance_features_templates}/features/step_definitions/clearance_steps.rb +13 -5
- data/lib/rails/generators/clearance_generator.rb +68 -0
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/README +0 -0
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/clearance.rb +0 -0
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/factories.rb +0 -0
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/migrations/create_users.rb +0 -1
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/migrations/update_users.rb +0 -1
- data/{generators/clearance/templates → lib/rails/generators/clearance_templates}/user.rb +0 -0
- data/lib/rails/generators/clearance_views_generator.rb +14 -0
- data/{generators/clearance_views/templates/formtastic → lib/rails/generators/clearance_views_templates/formtastic/erb}/passwords/edit.html.erb +3 -3
- data/{generators/clearance_views/templates/formtastic → lib/rails/generators/clearance_views_templates/formtastic/erb}/passwords/new.html.erb +3 -3
- data/{generators/clearance_views/templates/formtastic → lib/rails/generators/clearance_views_templates/formtastic/erb}/sessions/new.html.erb +3 -3
- data/{generators/clearance_views/templates/formtastic → lib/rails/generators/clearance_views_templates/formtastic/erb}/users/_inputs.html.erb +1 -1
- data/{generators/clearance_views/templates/formtastic → lib/rails/generators/clearance_views_templates/formtastic/erb}/users/new.html.erb +2 -2
- data/shoulda_macros/clearance.rb +9 -17
- data/test/controllers/confirmations_controller_test.rb +6 -6
- data/test/controllers/passwords_controller_test.rb +10 -10
- data/test/controllers/sessions_controller_test.rb +57 -16
- data/test/controllers/users_controller_test.rb +12 -8
- data/test/models/clearance_mailer_test.rb +2 -2
- data/test/models/user_test.rb +14 -7
- data/test/rails_root/app/helpers/application_helper.rb +0 -3
- data/test/rails_root/config/application.rb +46 -0
- data/test/rails_root/config/boot.rb +5 -109
- data/test/rails_root/config/environment.rb +5 -15
- data/test/rails_root/config/environments/development.rb +15 -15
- data/test/rails_root/config/environments/production.rb +42 -1
- data/test/rails_root/config/environments/test.rb +25 -29
- data/test/rails_root/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_root/config/initializers/inflections.rb +1 -1
- data/test/rails_root/config/initializers/secret_token.rb +7 -0
- data/test/rails_root/config/initializers/session_store.rb +8 -0
- data/test/rails_root/config/routes.rb +57 -2
- data/test/rails_root/features/step_definitions/web_steps.rb +125 -165
- data/test/rails_root/features/support/env.rb +24 -14
- data/test/rails_root/features/support/paths.rb +26 -4
- data/test/rails_root/test/functional/accounts_controller_test.rb +0 -1
- data/test/rails_root/test/performance/browsing_test.rb +9 -0
- data/test/rails_root/test/test_helper.rb +13 -0
- data/test/rails_root/vendor/plugins/dynamic_form/init.rb +5 -0
- data/test/rails_root/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb +300 -0
- data/test/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb +42 -0
- data/test/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_test.rb +370 -0
- data/test/rails_root/vendor/plugins/dynamic_form/test/test_helper.rb +9 -0
- data/test/test_helper.rb +30 -1
- metadata +104 -49
- data/VERSION +0 -1
- data/generators/clearance/USAGE +0 -1
- data/generators/clearance/clearance_generator.rb +0 -68
- data/generators/clearance/lib/insert_commands.rb +0 -33
- data/generators/clearance/lib/rake_commands.rb +0 -22
- data/generators/clearance_features/USAGE +0 -1
- data/generators/clearance_features/clearance_features_generator.rb +0 -19
- data/generators/clearance_features/templates/features/support/paths.rb +0 -23
- data/generators/clearance_views/USAGE +0 -0
- data/generators/clearance_views/clearance_views_generator.rb +0 -27
- data/lib/clearance/routes.rb +0 -49
- data/test/rails_root/app/helpers/confirmations_helper.rb +0 -2
- data/test/rails_root/app/helpers/passwords_helper.rb +0 -2
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/time_formats.rb +0 -4
- data/test/rails_root/db/migrate/20100225210436_clearance_create_users.rb +0 -21
- data/test/rails_root/features/step_definitions/clearance_steps.rb +0 -122
- data/test/rails_root/features/step_definitions/factory_girl_steps.rb +0 -5
- data/test/rails_root/public/dispatch.rb +0 -10
- data/test/rails_root/script/create_project.rb +0 -52
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/generators/formtastic_stylesheets/formtastic_stylesheets_generator.rb +0 -21
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/lib/formtastic.rb +0 -1236
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/lib/justin_french/formtastic.rb +0 -10
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/rails/init.rb +0 -3
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/spec/formtastic_spec.rb +0 -2900
- data/test/rails_root/vendor/gems/justinfrench-formtastic-0.2.1/spec/test_helper.rb +0 -14
@@ -4,7 +4,7 @@ class UsersControllerTest < ActionController::TestCase
|
|
4
4
|
|
5
5
|
tests Clearance::UsersController
|
6
6
|
|
7
|
-
|
7
|
+
should filter_param(:password)
|
8
8
|
|
9
9
|
context "when signed out" do
|
10
10
|
setup { sign_out }
|
@@ -12,9 +12,9 @@ class UsersControllerTest < ActionController::TestCase
|
|
12
12
|
context "on GET to #new" do
|
13
13
|
setup { get :new }
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
should respond_with(:success)
|
16
|
+
should render_template(:new)
|
17
|
+
should_not set_the_flash
|
18
18
|
|
19
19
|
should_display_a_sign_up_form
|
20
20
|
end
|
@@ -33,11 +33,15 @@ class UsersControllerTest < ActionController::TestCase
|
|
33
33
|
context "on POST to #create with valid attributes" do
|
34
34
|
setup do
|
35
35
|
user_attributes = Factory.attributes_for(:user)
|
36
|
+
@old_user_count = User.count
|
36
37
|
post :create, :user => user_attributes
|
37
38
|
end
|
38
39
|
|
39
40
|
should_assign_to :user
|
40
|
-
|
41
|
+
|
42
|
+
should "create a new user" do
|
43
|
+
assert_equal @old_user_count + 1, User.count
|
44
|
+
end
|
41
45
|
|
42
46
|
should "send the confirmation email" do
|
43
47
|
assert_sent_email do |email|
|
@@ -45,7 +49,7 @@ class UsersControllerTest < ActionController::TestCase
|
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
48
|
-
|
52
|
+
should set_the_flash.to(/confirm/i)
|
49
53
|
should_redirect_to_url_after_create
|
50
54
|
end
|
51
55
|
end
|
@@ -53,12 +57,12 @@ class UsersControllerTest < ActionController::TestCase
|
|
53
57
|
signed_in_user_context do
|
54
58
|
context "GET to new" do
|
55
59
|
setup { get :new }
|
56
|
-
|
60
|
+
should redirect_to("the home page") { root_url }
|
57
61
|
end
|
58
62
|
|
59
63
|
context "POST to create" do
|
60
64
|
setup { post :create, :user => {} }
|
61
|
-
|
65
|
+
should redirect_to("the home page") { root_url }
|
62
66
|
end
|
63
67
|
end
|
64
68
|
|
@@ -5,7 +5,7 @@ class ClearanceMailerTest < ActiveSupport::TestCase
|
|
5
5
|
context "A change password email" do
|
6
6
|
setup do
|
7
7
|
@user = Factory(:user)
|
8
|
-
@email = ClearanceMailer.
|
8
|
+
@email = ClearanceMailer.change_password @user
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be from DO_NOT_REPLY" do
|
@@ -30,7 +30,7 @@ class ClearanceMailerTest < ActiveSupport::TestCase
|
|
30
30
|
context "A confirmation email" do
|
31
31
|
setup do
|
32
32
|
@user = Factory(:user)
|
33
|
-
@email = ClearanceMailer.
|
33
|
+
@email = ClearanceMailer.confirmation @user
|
34
34
|
end
|
35
35
|
|
36
36
|
should "be from DO_NOT_REPLY" do
|
data/test/models/user_test.rb
CHANGED
@@ -2,26 +2,31 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class UserTest < ActiveSupport::TestCase
|
4
4
|
|
5
|
+
# db
|
6
|
+
|
7
|
+
should have_db_index(:email)
|
8
|
+
should have_db_index(:remember_token)
|
9
|
+
|
5
10
|
# signing up
|
6
11
|
|
7
12
|
context "When signing up" do
|
8
13
|
should_validate_presence_of :email, :password
|
9
|
-
|
10
|
-
|
11
|
-
|
14
|
+
should allow_value("foo@example.com").for(:email)
|
15
|
+
should_not allow_value("foo").for(:email)
|
16
|
+
should_not allow_value("example.com").for(:email)
|
12
17
|
|
13
18
|
should "require password confirmation on create" do
|
14
19
|
user = Factory.build(:user, :password => 'blah',
|
15
20
|
:password_confirmation => 'boogidy')
|
16
21
|
assert ! user.save
|
17
|
-
assert user.errors
|
22
|
+
assert user.errors[:password].any?
|
18
23
|
end
|
19
24
|
|
20
25
|
should "require non blank password confirmation on create" do
|
21
26
|
user = Factory.build(:user, :password => 'blah',
|
22
27
|
:password_confirmation => '')
|
23
28
|
assert ! user.save
|
24
|
-
assert user.errors
|
29
|
+
assert user.errors[:password].any?
|
25
30
|
end
|
26
31
|
|
27
32
|
should "initialize salt" do
|
@@ -234,7 +239,8 @@ class UserTest < ActiveSupport::TestCase
|
|
234
239
|
|
235
240
|
subject { @user }
|
236
241
|
|
237
|
-
|
242
|
+
should allow_value(nil).for(:email)
|
243
|
+
should allow_value("").for(:email)
|
238
244
|
end
|
239
245
|
|
240
246
|
context "a user with an optional password" do
|
@@ -249,7 +255,8 @@ class UserTest < ActiveSupport::TestCase
|
|
249
255
|
|
250
256
|
subject { @user }
|
251
257
|
|
252
|
-
|
258
|
+
should allow_value(nil).for(:password)
|
259
|
+
should allow_value("").for(:password)
|
253
260
|
end
|
254
261
|
|
255
262
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
module Rails3Root
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Add additional load paths for your own custom dirs
|
16
|
+
# config.load_paths += %W( #{config.root}/extras )
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# Configure generators values. Many other options are available, be sure to check the documentation.
|
34
|
+
# config.generators do |g|
|
35
|
+
# g.orm :active_record
|
36
|
+
# g.template_engine :erb
|
37
|
+
# g.test_framework :test_unit, :fixture => true
|
38
|
+
# end
|
39
|
+
|
40
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
41
|
+
config.encoding = "utf-8"
|
42
|
+
|
43
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
44
|
+
config.filter_parameters += [:password]
|
45
|
+
end
|
46
|
+
end
|
@@ -1,110 +1,6 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
module Rails
|
7
|
-
class << self
|
8
|
-
def boot!
|
9
|
-
unless booted?
|
10
|
-
preinitialize
|
11
|
-
pick_boot.run
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def booted?
|
16
|
-
defined? Rails::Initializer
|
17
|
-
end
|
18
|
-
|
19
|
-
def pick_boot
|
20
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
-
end
|
22
|
-
|
23
|
-
def vendor_rails?
|
24
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
-
end
|
26
|
-
|
27
|
-
def preinitialize
|
28
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
-
end
|
30
|
-
|
31
|
-
def preinitializer_path
|
32
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Boot
|
37
|
-
def run
|
38
|
-
load_initializer
|
39
|
-
Rails::Initializer.run(:set_load_path)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class VendorBoot < Boot
|
44
|
-
def load_initializer
|
45
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
-
Rails::GemDependency.add_frozen_gem_path
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class GemBoot < Boot
|
52
|
-
def load_initializer
|
53
|
-
self.class.load_rubygems
|
54
|
-
load_rails_gem
|
55
|
-
require 'initializer'
|
56
|
-
end
|
57
|
-
|
58
|
-
def load_rails_gem
|
59
|
-
if version = self.class.gem_version
|
60
|
-
gem 'rails', version
|
61
|
-
else
|
62
|
-
gem 'rails'
|
63
|
-
end
|
64
|
-
rescue Gem::LoadError => load_error
|
65
|
-
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
-
exit 1
|
67
|
-
end
|
68
|
-
|
69
|
-
class << self
|
70
|
-
def rubygems_version
|
71
|
-
Gem::RubyGemsVersion rescue nil
|
72
|
-
end
|
73
|
-
|
74
|
-
def gem_version
|
75
|
-
if defined? RAILS_GEM_VERSION
|
76
|
-
RAILS_GEM_VERSION
|
77
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
-
ENV['RAILS_GEM_VERSION']
|
79
|
-
else
|
80
|
-
parse_gem_version(read_environment_rb)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def load_rubygems
|
85
|
-
require 'rubygems'
|
86
|
-
min_version = '1.3.1'
|
87
|
-
unless rubygems_version >= min_version
|
88
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
-
exit 1
|
90
|
-
end
|
91
|
-
|
92
|
-
rescue LoadError
|
93
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
94
|
-
exit 1
|
95
|
-
end
|
96
|
-
|
97
|
-
def parse_gem_version(text)
|
98
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
99
|
-
end
|
100
|
-
|
101
|
-
private
|
102
|
-
def read_environment_rb
|
103
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
1
|
+
require 'rubygems'
|
2
|
+
# Set up gems listed in the Gemfile.
|
3
|
+
if File.exist?(File.expand_path('../../Gemfile', __FILE__))
|
4
|
+
require 'bundler'
|
5
|
+
Bundler.setup
|
107
6
|
end
|
108
|
-
|
109
|
-
# All that for this:
|
110
|
-
Rails.boot!
|
@@ -1,17 +1,7 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
# Load the rails application
|
2
|
+
require File.expand_path('../application', __FILE__)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
config.time_zone = 'Eastern Time (US & Canada)'
|
7
|
-
config.action_controller.session = {
|
8
|
-
:session_key => "_clearance_session",
|
9
|
-
:secret => ['clearance', 'random', 'words', 'here'].map {|k| Digest::MD5.hexdigest(k) }.join
|
10
|
-
}
|
4
|
+
# Initialize the rails application
|
5
|
+
Rails3Root::Application.initialize!
|
11
6
|
|
12
|
-
|
13
|
-
:lib => 'formtastic',
|
14
|
-
:source => 'http://gems.github.com'
|
15
|
-
|
16
|
-
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
|
17
|
-
end
|
7
|
+
ActionMailer::Base.default_url_options = { :host => 'localhost:3000' }
|
@@ -1,19 +1,19 @@
|
|
1
|
-
|
1
|
+
Rails3Root::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
3
|
|
3
|
-
# In the development environment your application's code is reloaded on
|
4
|
-
# every request. This slows down response time but is perfect for development
|
5
|
-
# since you don't have to restart the webserver when you make code changes.
|
6
|
-
config.cache_classes = false
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
7
8
|
|
8
|
-
# Log error messages when you accidentally call methods on nil.
|
9
|
-
config.whiny_nils = true
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
10
11
|
|
11
|
-
# Show full error reports and disable caching
|
12
|
-
config.
|
13
|
-
config.
|
14
|
-
config.
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
15
16
|
|
16
|
-
# Don't care if the mailer can't send
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
18
|
-
|
19
|
-
HOST = "localhost"
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
end
|
@@ -1 +1,42 @@
|
|
1
|
-
|
1
|
+
Rails3Root::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
19
|
+
# just comment this out and Rails will serve the files
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
end
|
@@ -1,36 +1,32 @@
|
|
1
|
-
|
1
|
+
Rails3Root::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
3
|
|
3
|
-
# The test environment is used exclusively to run your application's
|
4
|
-
# test suite. You never need to work with it otherwise. Remember that
|
5
|
-
# your test database is "scratch space" for the test suite and is wiped
|
6
|
-
# and recreated between test runs. Don't rely on the data there!
|
7
|
-
config.cache_classes = true
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
8
9
|
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
10
|
-
config.whiny_nils = true
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
11
12
|
|
12
|
-
# Show full error reports and disable caching
|
13
|
-
config.
|
14
|
-
config.action_controller.perform_caching
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
15
16
|
|
16
|
-
#
|
17
|
-
config.
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
18
19
|
|
19
|
-
#
|
20
|
-
|
21
|
-
# ActionMailer::Base.deliveries array.
|
22
|
-
config.action_mailer.delivery_method = :test
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
23
22
|
|
24
|
-
|
25
|
-
:
|
26
|
-
|
27
|
-
config.
|
28
|
-
:source => "http://gemcutter.org",
|
29
|
-
:version => '>= 1.2.3'
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
30
27
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
config.
|
35
|
-
|
36
|
-
:version => '>= 0.6.0'
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
end
|