activity_consumer 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -0
  3. data/app/controllers/activity_consumer/remote_activities_controller.rb +5 -5
  4. data/app/models/activity_consumer/remote_activity.rb +4 -3
  5. data/lib/activity_consumer/version.rb +1 -1
  6. data/spec/controllers/activity_consumer/remote_activities_controller_spec.rb +23 -23
  7. data/spec/dummy/config/application.rb +6 -54
  8. data/spec/dummy/config/boot.rb +2 -9
  9. data/spec/dummy/config/cable.yml +9 -0
  10. data/spec/dummy/config/environment.rb +4 -4
  11. data/spec/dummy/config/environments/development.rb +37 -20
  12. data/spec/dummy/config/environments/production.rb +57 -38
  13. data/spec/dummy/config/environments/test.rb +20 -15
  14. data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
  15. data/spec/dummy/config/initializers/assets.rb +11 -0
  16. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  17. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  18. data/spec/dummy/config/initializers/inflections.rb +6 -5
  19. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  20. data/spec/dummy/config/initializers/new_framework_defaults.rb +23 -0
  21. data/spec/dummy/config/initializers/session_store.rb +1 -6
  22. data/spec/dummy/config/initializers/wrap_parameters.rb +5 -5
  23. data/spec/dummy/config/locales/en.yml +20 -2
  24. data/spec/dummy/config/puma.rb +47 -0
  25. data/spec/dummy/config/routes.rb +0 -1
  26. data/spec/dummy/config/secrets.yml +22 -0
  27. data/spec/dummy/config/spring.rb +6 -0
  28. data/spec/dummy/public/assets/activity_consumer/application-da3774e883bf61cb6341af13300902649648ac9b4f3ff1009688fa92c46472aa.js +11580 -0
  29. data/spec/dummy/public/assets/application-da3774e883bf61cb6341af13300902649648ac9b4f3ff1009688fa92c46472aa.js +11580 -0
  30. data/spec/dummy/public/assets/application-da3774e883bf61cb6341af13300902649648ac9b4f3ff1009688fa92c46472aa.js.gz +0 -0
  31. data/spec/dummy/public/assets/application-f9e7c1541e1b8783561468c59162bd896007380f5a3799ef2169d3a3fdf40bed.css +14 -0
  32. data/spec/dummy/public/assets/application-f9e7c1541e1b8783561468c59162bd896007380f5a3799ef2169d3a3fdf40bed.css.gz +0 -0
  33. data/spec/models/activity_consumer/remote_activity_spec.rb +2 -2
  34. data/spec/services/activity_consumer/configuration_spec.rb +1 -1
  35. data/spec/services/activity_consumer/remote_activity_importer_spec.rb +26 -26
  36. data/spec/services/activity_consumer/remote_activity_rest_client_spec.rb +16 -16
  37. data/spec/spec_helper.rb +12 -1
  38. metadata +36 -8
  39. data/README.rdoc +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e856e7fcb239433b20bfc7dd7780bc56679e96c
4
- data.tar.gz: 224848a664ec46753ab55589b8724dafe16db723
3
+ metadata.gz: a6647b116d39f2adb87a1e6b1ac1b34c901acc74
4
+ data.tar.gz: e98b9093055a7377b991634c9c2308af7755d260
5
5
  SHA512:
6
- metadata.gz: 5ce5c2a8c5f812ed8162244dade5a4e5cc872130431cda212126bfa5c77b0157823f72f88946c38a8b3629cfbf41c7b58df269c19108c7dd4e9cccf40f60eb56
7
- data.tar.gz: 4c490afac2e202555e8006588ec5befc3ecb4928e734c56e1eabc10dee9d6e4193e5a7baf2a11210a1d3509750026147af8bdb88fe6801c3cbc6798ced40f835
6
+ metadata.gz: 38a6700684231105cca76392bcb46b66e17374a385ed38dfa97c828ee9befe9f0226532169ab254cd1a00ca88c7d6407cded9c9f73507b757218135f7ea3a2e4
7
+ data.tar.gz: 8f90a797139a00e5a5f1ce78f605ce8650cc05907822e709bf2ce0cfb6b7aef5d63f4ae3532ca872af6e4a0125bf4d6c2c62f20c0208df44fdef6bea6da20bad
data/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # ActivityConsumer
2
+
3
+ This project rocks and uses MIT-LICENSE.
4
+
5
+ It is released on rubygems.org : https://rubygems.org/gems/activity_consumer
6
+
7
+ ## How to build and release
8
+
9
+ `gem build activity_consumer.gemspec`
10
+
11
+ `gem push activity_consumer-0.4.0.gem`
@@ -6,18 +6,18 @@ module ActivityConsumer
6
6
  # GET /remote_activities.json
7
7
  def index
8
8
  @remote_activities = RemoteActivity.order('created_at DESC, timestamp DESC')
9
-
9
+
10
10
  respond_to do |format|
11
11
  format.html # index.html.erb
12
12
  format.json { render json: @remote_activities }
13
13
  end
14
14
  end
15
-
15
+
16
16
  # GET /remote_activities/1
17
17
  # GET /remote_activities/1.json
18
18
  def show
19
19
  @remote_activity = RemoteActivity.find(params[:id])
20
-
20
+
21
21
  respond_to do |format|
22
22
  format.html # show.html.erb
23
23
  format.json { render json: @remote_activity }
@@ -42,8 +42,8 @@ module ActivityConsumer
42
42
  Rails.logger.error e.message
43
43
  Rails.logger.error e.backtrace.join("\n")
44
44
  end
45
-
46
- redirect_to :back
45
+
46
+ redirect_back(fallback_location: :back)
47
47
  end
48
48
 
49
49
  private
@@ -1,8 +1,9 @@
1
1
  module ActivityConsumer
2
-
2
+
3
3
  class RemoteActivity < ActiveRecord::Base
4
-
5
- attr_accessible :action, :payload, :timestamp, :etag, :was_successful, :error
4
+
5
+ # TODO remove due to deprecation in rails >= 4
6
+ # attr_accessible :action, :payload, :timestamp, :etag, :was_successful, :error
6
7
  validates_presence_of :action, :timestamp
7
8
 
8
9
  serialize :payload, Hash
@@ -1,3 +1,3 @@
1
1
  module ActivityConsumer
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -8,8 +8,8 @@ end
8
8
 
9
9
  module ActivityConsumer
10
10
 
11
- describe RemoteActivitiesController do
12
-
11
+ describe RemoteActivitiesController, :type => :controller do
12
+
13
13
  describe "GET import_latest" do
14
14
 
15
15
  before(:each) do
@@ -17,9 +17,9 @@ module ActivityConsumer
17
17
  end
18
18
 
19
19
  it "uses RemoteActivityImporter" do
20
- ActivityConsumer::RemoteActivityImporter.any_instance.should_receive(:import).once.and_return({})
21
- get :import_latest, use_route: :activity_consumer
22
- response.should redirect_to("where_i_came_from")
20
+ expect_any_instance_of(ActivityConsumer::RemoteActivityImporter).to receive(:import).once.and_return({})
21
+ get :import_latest, params: { use_route: :activity_consumer }
22
+ expect(response).to redirect_to("where_i_came_from")
23
23
  end
24
24
 
25
25
  it "fills flash message with stats of import" do
@@ -27,32 +27,32 @@ module ActivityConsumer
27
27
  no_activities: 13, no_errors: 4,
28
28
  activities: { foo: { create: 8, update: 2, destroy: 3 } }
29
29
  }
30
- ActivityConsumer::RemoteActivityImporter.any_instance.should_receive(:import).once.and_return(stats)
31
- get :import_latest, use_route: :activity_consumer
32
-
33
- flash[:error].should == "4 Fehler beim Import."
34
- flash[:notice].should == "Import abgeschlossen. 13 Änderungen: 8 neue Foos, 2 geänderte Foos, 3 gelöschte Foos"
30
+ expect_any_instance_of(ActivityConsumer::RemoteActivityImporter).to receive(:import).once.and_return(stats)
31
+ get :import_latest, params: { use_route: :activity_consumer }
32
+
33
+ expect(flash[:error]).to eq("4 Fehler beim Import.")
34
+ expect(flash[:notice]).to eq("Import abgeschlossen. 13 Änderungen: 8 neue Foos, 2 geänderte Foos, 3 gelöschte Foos")
35
35
  end
36
36
 
37
37
  it "shows no error message when there was no error" do
38
38
  stats = {
39
- no_activities: 13, no_errors: 0,
39
+ no_activities: 13, no_errors: 0,
40
40
  activities: { foo: { create: 8, update: 2, destroy: 3 } }
41
41
  }
42
- ActivityConsumer::RemoteActivityImporter.any_instance.should_receive(:import).once.and_return(stats)
43
- get :import_latest, use_route: :activity_consumer
44
-
45
- flash[:error].should be_nil
42
+ expect_any_instance_of(ActivityConsumer::RemoteActivityImporter).to receive(:import).once.and_return(stats)
43
+ get :import_latest, params: { use_route: :activity_consumer }
44
+
45
+ expect(flash[:error]).to be_nil
46
46
  end
47
47
 
48
48
  it "shows a dedicated message when there was nothing to import" do
49
49
  stats = {
50
50
  no_errors: 0, no_activities: 0, activities: {}
51
51
  }
52
- ActivityConsumer::RemoteActivityImporter.any_instance.should_receive(:import).once.and_return(stats)
53
- get :import_latest, use_route: :activity_consumer
54
-
55
- flash[:notice].should == "Es gab nichts zu importieren."
52
+ expect_any_instance_of(ActivityConsumer::RemoteActivityImporter).to receive(:import).once.and_return(stats)
53
+ get :import_latest, params: { use_route: :activity_consumer }
54
+
55
+ expect(flash[:notice]).to eq("Es gab nichts zu importieren.")
56
56
  end
57
57
 
58
58
  it "actually imports stuff" do
@@ -62,11 +62,11 @@ module ActivityConsumer
62
62
  c.import_types = ['Foo']
63
63
  end
64
64
 
65
- get :import_latest, use_route: :activity_consumer
66
- flash[:error].should == nil
67
- flash[:notice].should == "Import abgeschlossen. 3 Änderungen: ein neues Foo, ein geändertes Foo, ein gelöschtes Foo"
65
+ get :import_latest, params: { use_route: :activity_consumer }
66
+ expect(flash[:error]).to eq(nil)
67
+ expect(flash[:notice]).to eq("Import abgeschlossen. 3 Änderungen: ein neues Foo, ein geändertes Foo, ein gelöschtes Foo")
68
68
  end
69
-
69
+
70
70
  end
71
71
  end
72
72
  end
@@ -1,13 +1,9 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
- # Pick the frameworks you want:
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_mailer/railtie"
7
- require "active_resource/railtie"
8
- require "sprockets/railtie"
9
- # require "rails/test_unit/railtie"
3
+ require 'rails/all'
10
4
 
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
11
7
  Bundler.require(*Rails.groups)
12
8
  require "activity_consumer"
13
9
 
@@ -16,52 +12,8 @@ module Dummy
16
12
  # Settings in config/environments/* take precedence over those specified here.
17
13
  # Application configuration should go into files in config/initializers
18
14
  # -- all .rb files in that directory are automatically loaded.
19
-
20
- # Custom directories with classes and modules you want to be autoloadable.
21
- # config.autoload_paths += %W(#{config.root}/extras)
22
-
23
- # Only load the plugins named here, in the order given (default is alphabetical).
24
- # :all can be used as a placeholder for all plugins not explicitly named.
25
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
-
27
- # Activate observers that should always be running.
28
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
-
30
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
- config.active_record.default_timezone = :utc # means dates in DB are UTC
33
- config.time_zone = 'Berlin' # means dates should be displayed and entered in forms as 'Berlin' time zone
34
-
35
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
36
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
37
- # config.i18n.default_locale = :de
15
+ config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
38
16
  config.i18n.default_locale = :de
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
-
46
- # Enable escaping HTML in JSON.
47
- config.active_support.escape_html_entities_in_json = true
48
-
49
- # Use SQL instead of Active Record's schema dumper when creating the database.
50
- # This is necessary if your schema can't be completely dumped by the schema dumper,
51
- # like if you have constraints or database-specific column types
52
- # config.active_record.schema_format = :sql
53
-
54
- # Enforce whitelist mode for mass assignment.
55
- # This will create an empty whitelist of attributes available for mass-assignment for all models
56
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
57
- # parameters by using an attr_accessible or attr_protected declaration.
58
- config.active_record.whitelist_attributes = true
59
-
60
- # Enable the asset pipeline
61
- config.assets.enabled = true
62
-
63
- # Version of your assets, change this if you want to expire all your assets
64
- config.assets.version = '1.0'
17
+ config.time_zone = 'Berlin'
65
18
  end
66
19
  end
67
-
@@ -1,10 +1,3 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
2
 
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
@@ -1,5 +1,5 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
3
 
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,37 +1,54 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
15
14
 
16
- # Don't care if the mailer can't send
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
+
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => 'public, max-age=172800'
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
28
+
29
+ # Don't care if the mailer can't send.
17
30
  config.action_mailer.raise_delivery_errors = false
18
31
 
19
- # Print deprecation notices to the Rails logger
32
+ config.action_mailer.perform_caching = false
33
+
34
+ # Print deprecation notices to the Rails logger.
20
35
  config.active_support.deprecation = :log
21
36
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
37
+ # Raise an error on page load if there are pending migrations.
38
+ config.active_record.migration_error = :page_load
24
39
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
40
+ # Debug mode disables concatenation and preprocessing of assets.
41
+ # This option may cause significant delays in view rendering with a large
42
+ # number of complex assets.
43
+ config.assets.debug = true
27
44
 
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
45
+ # Suppress logger output for asset requests.
46
+ config.assets.quiet = true
31
47
 
32
- # Do not compress assets
33
- config.assets.compress = false
48
+ # Raises error for missing translations
49
+ # config.action_view.raise_on_missing_translations = true
34
50
 
35
- # Expands the lines which load the assets
36
- config.assets.debug = true
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
37
54
  end
@@ -1,67 +1,86 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
- # Full error reports are disabled and caching is turned on
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
8
14
  config.consider_all_requests_local = false
9
15
  config.action_controller.perform_caching = true
10
16
 
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
17
+ # Disable serving static files from the `/public` folder by default since
18
+ # Apache or NGINX already handles this.
19
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
13
20
 
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
21
+ # Compress JavaScripts and CSS.
22
+ config.assets.js_compressor = :uglifier
23
+ # config.assets.css_compressor = :sass
16
24
 
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
25
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
18
26
  config.assets.compile = false
19
27
 
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
28
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
29
+
30
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
31
+ # config.action_controller.asset_host = 'http://assets.example.com'
22
32
 
23
- # Defaults to nil and saved in location specified by config.assets.prefix
24
- # config.assets.manifest = YOUR_PATH
33
+ # Specifies the header that your server uses for sending files.
34
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
35
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
25
36
 
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
37
+ # Mount Action Cable outside main process or domain
38
+ # config.action_cable.mount_path = nil
39
+ # config.action_cable.url = 'wss://example.com/cable'
40
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
29
41
 
30
42
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
43
  # config.force_ssl = true
32
44
 
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
45
+ # Use the lowest log level to ensure availability of diagnostic information
46
+ # when problems arise.
47
+ config.log_level = :debug
35
48
 
36
- # Prepend all log lines with the following tags
37
- # config.log_tags = [ :subdomain, :uuid ]
49
+ # Prepend all log lines with the following tags.
50
+ config.log_tags = [ :request_id ]
38
51
 
39
- # Use a different logger for distributed setups
40
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
-
42
- # Use a different cache store in production
52
+ # Use a different cache store in production.
43
53
  # config.cache_store = :mem_cache_store
44
54
 
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
- # config.action_controller.asset_host = "http://assets.example.com"
47
-
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
- # config.assets.precompile += %w( search.js )
55
+ # Use a real queuing backend for Active Job (and separate queues per environment)
56
+ # config.active_job.queue_adapter = :resque
57
+ # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
58
+ config.action_mailer.perform_caching = false
50
59
 
51
- # Disable delivery errors, bad email addresses will be ignored
60
+ # Ignore bad email addresses and do not raise email delivery errors.
61
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
52
62
  # config.action_mailer.raise_delivery_errors = false
53
63
 
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
64
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
- # the I18n.default_locale when a translation can not be found)
65
+ # the I18n.default_locale when a translation cannot be found).
59
66
  config.i18n.fallbacks = true
60
67
 
61
- # Send deprecation notices to registered listeners
68
+ # Send deprecation notices to registered listeners.
62
69
  config.active_support.deprecation = :notify
63
70
 
64
- # Log the query plan for queries taking more than this (works
65
- # with SQLite, MySQL, and PostgreSQL)
66
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
71
+ # Use default logging formatter so that PID and timestamp are not suppressed.
72
+ config.log_formatter = ::Logger::Formatter.new
73
+
74
+ # Use a different logger for distributed setups.
75
+ # require 'syslog/logger'
76
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
77
+
78
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
79
+ logger = ActiveSupport::Logger.new(STDOUT)
80
+ logger.formatter = config.log_formatter
81
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
82
+ end
83
+
84
+ # Do not dump schema after migrations.
85
+ config.active_record.dump_schema_after_migration = false
67
86
  end
@@ -1,5 +1,5 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,31 +7,36 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
13
14
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => 'public, max-age=3600'
19
+ }
16
20
 
17
- # Show full error reports and disable caching
21
+ # Show full error reports and disable caching.
18
22
  config.consider_all_requests_local = true
19
23
  config.action_controller.perform_caching = false
20
24
 
21
- # Raise exceptions instead of rendering exception templates
25
+ # Raise exceptions instead of rendering exception templates.
22
26
  config.action_dispatch.show_exceptions = false
23
27
 
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+ config.action_mailer.perform_caching = false
26
31
 
27
32
  # Tell Action Mailer not to deliver emails to the real world.
28
33
  # The :test delivery method accumulates sent emails in the
29
34
  # ActionMailer::Base.deliveries array.
30
35
  config.action_mailer.delivery_method = :test
31
36
 
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
37
+ # Print deprecation notices to the stderr.
36
38
  config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
37
42
  end
@@ -0,0 +1,6 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ApplicationController.renderer.defaults.merge!(
4
+ # http_host: 'example.org',
5
+ # https: false
6
+ # )
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,23 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.0 upgrade.
4
+ #
5
+ # Once upgraded flip defaults one by one to migrate to the new default.
6
+ #
7
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Enable per-form CSRF tokens. Previous versions had false.
10
+ Rails.application.config.action_controller.per_form_csrf_tokens = false
11
+
12
+ # Enable origin-checking CSRF mitigation. Previous versions had false.
13
+ Rails.application.config.action_controller.forgery_protection_origin_check = false
14
+
15
+ # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
16
+ # Previous versions had false.
17
+ ActiveSupport.to_time_preserves_timezone = false
18
+
19
+ # Require `belongs_to` associations by default. Previous versions had false.
20
+ Rails.application.config.active_record.belongs_to_required_by_default = false
21
+
22
+ # Do not halt callback chains when a callback returns false. Previous versions had true.
23
+ ActiveSupport.halt_callback_chains_on_return_false = true
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'