draper 4.0.2 → 4.0.5
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 +4 -4
- data/.rspec +1 -2
- data/CHANGELOG.md +24 -0
- data/README.md +26 -7
- data/lib/draper/automatic_delegation.rb +14 -4
- data/lib/draper/collection_decorator.rb +0 -6
- data/lib/draper/compatibility/broadcastable.rb +24 -0
- data/lib/draper/compatibility/global_id.rb +9 -5
- data/lib/draper/decoratable/collection_proxy.rb +15 -0
- data/lib/draper/decoratable.rb +7 -2
- data/lib/draper/decorator.rb +2 -18
- data/lib/draper/query_methods.rb +1 -1
- data/lib/draper/railtie.rb +14 -5
- data/lib/draper/version.rb +1 -1
- data/lib/draper/view_context/build_strategy.rb +1 -9
- data/lib/draper.rb +0 -6
- metadata +16 -235
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -24
- data/.github/workflows/ci.yml +0 -55
- data/.gitignore +0 -18
- data/Gemfile +0 -24
- data/bin/bundle +0 -114
- data/bin/rake +0 -29
- data/draper.gemspec +0 -34
- data/spec/draper/collection_decorator_spec.rb +0 -291
- data/spec/draper/configuration_spec.rb +0 -49
- data/spec/draper/decoratable/equality_spec.rb +0 -10
- data/spec/draper/decoratable_spec.rb +0 -235
- data/spec/draper/decorated_association_spec.rb +0 -82
- data/spec/draper/decorates_assigned_spec.rb +0 -71
- data/spec/draper/decorator_spec.rb +0 -872
- data/spec/draper/draper_spec.rb +0 -25
- data/spec/draper/factory_spec.rb +0 -247
- data/spec/draper/finders_spec.rb +0 -166
- data/spec/draper/helper_proxy_spec.rb +0 -61
- data/spec/draper/lazy_helpers_spec.rb +0 -21
- data/spec/draper/query_methods/load_strategy_spec.rb +0 -26
- data/spec/draper/query_methods_spec.rb +0 -70
- data/spec/draper/undecorate_chain_spec.rb +0 -20
- data/spec/draper/undecorate_spec.rb +0 -19
- data/spec/draper/view_context/build_strategy_spec.rb +0 -132
- data/spec/draper/view_context_spec.rb +0 -182
- data/spec/draper/view_helpers_spec.rb +0 -8
- data/spec/dummy/.rspec +0 -2
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/controllers/application_controller.rb +0 -2
- data/spec/dummy/app/controllers/base_controller.rb +0 -4
- data/spec/dummy/app/controllers/localized_urls.rb +0 -5
- data/spec/dummy/app/controllers/posts_controller.rb +0 -20
- data/spec/dummy/app/decorators/mongoid_post_decorator.rb +0 -4
- data/spec/dummy/app/decorators/post_decorator.rb +0 -60
- data/spec/dummy/app/helpers/application_helper.rb +0 -5
- data/spec/dummy/app/jobs/publish_post_job.rb +0 -7
- data/spec/dummy/app/mailers/application_mailer.rb +0 -3
- data/spec/dummy/app/mailers/post_mailer.rb +0 -19
- data/spec/dummy/app/models/admin.rb +0 -5
- data/spec/dummy/app/models/application_record.rb +0 -3
- data/spec/dummy/app/models/mongoid_post.rb +0 -5
- data/spec/dummy/app/models/post.rb +0 -3
- data/spec/dummy/app/models/user.rb +0 -5
- data/spec/dummy/app/views/layouts/application.html.erb +0 -11
- data/spec/dummy/app/views/post_mailer/decorated_email.html.erb +0 -1
- data/spec/dummy/app/views/posts/_post.html.erb +0 -42
- data/spec/dummy/app/views/posts/show.html.erb +0 -1
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/config/application.rb +0 -68
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -35
- data/spec/dummy/config/environments/production.rb +0 -59
- data/spec/dummy/config/environments/test.rb +0 -35
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/draper.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -8
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/mongoid.yml +0 -142
- data/spec/dummy/config/routes.rb +0 -9
- data/spec/dummy/config/storage.yml +0 -7
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/migrate/20121019115657_create_posts.rb +0 -8
- data/spec/dummy/db/schema.rb +0 -21
- data/spec/dummy/db/seeds.rb +0 -2
- data/spec/dummy/fast_spec/post_decorator_spec.rb +0 -37
- data/spec/dummy/lib/tasks/test.rake +0 -16
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/spec/decorators/active_model_serializers_spec.rb +0 -12
- data/spec/dummy/spec/decorators/devise_spec.rb +0 -55
- data/spec/dummy/spec/decorators/helpers_spec.rb +0 -21
- data/spec/dummy/spec/decorators/post_decorator_spec.rb +0 -64
- data/spec/dummy/spec/decorators/spec_type_spec.rb +0 -7
- data/spec/dummy/spec/decorators/view_context_spec.rb +0 -22
- data/spec/dummy/spec/jobs/publish_post_job_spec.rb +0 -9
- data/spec/dummy/spec/mailers/post_mailer_spec.rb +0 -25
- data/spec/dummy/spec/models/application_spec.rb +0 -7
- data/spec/dummy/spec/models/mongoid_post_spec.rb +0 -8
- data/spec/dummy/spec/models/post_spec.rb +0 -15
- data/spec/dummy/spec/shared_examples/decoratable.rb +0 -22
- data/spec/dummy/spec/spec_helper.rb +0 -8
- data/spec/dummy/test/decorators/minitest/devise_test.rb +0 -55
- data/spec/dummy/test/decorators/minitest/helpers_test.rb +0 -21
- data/spec/dummy/test/decorators/minitest/spec_type_test.rb +0 -52
- data/spec/dummy/test/decorators/minitest/view_context_test.rb +0 -24
- data/spec/dummy/test/decorators/test_unit/devise_test.rb +0 -55
- data/spec/dummy/test/decorators/test_unit/helpers_test.rb +0 -21
- data/spec/dummy/test/decorators/test_unit/view_context_test.rb +0 -24
- data/spec/dummy/test/minitest_helper.rb +0 -2
- data/spec/dummy/test/test_helper.rb +0 -3
- data/spec/generators/controller/controller_generator_spec.rb +0 -23
- data/spec/generators/decorator/decorator_generator_spec.rb +0 -93
- data/spec/generators/install/install_generator_spec.rb +0 -19
- data/spec/integration/integration_spec.rb +0 -70
- data/spec/performance/active_record.rb +0 -4
- data/spec/performance/benchmark.rb +0 -55
- data/spec/performance/decorators.rb +0 -45
- data/spec/performance/models.rb +0 -20
- data/spec/spec_helper.rb +0 -50
- data/spec/support/dummy_app.rb +0 -85
- data/spec/support/matchers/have_text.rb +0 -50
- data/spec/support/shared_examples/decoratable_equality.rb +0 -40
- data/spec/support/shared_examples/view_helpers.rb +0 -39
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
development:
|
|
7
|
-
adapter: sqlite3
|
|
8
|
-
database: db/development.sqlite3
|
|
9
|
-
pool: 5
|
|
10
|
-
timeout: 5000
|
|
11
|
-
|
|
12
|
-
# Warning: The database defined as "test" will be erased and
|
|
13
|
-
# re-generated from your development database when you run "rake".
|
|
14
|
-
# Do not set this db to the same as development or production.
|
|
15
|
-
test:
|
|
16
|
-
adapter: sqlite3
|
|
17
|
-
database: db/test.sqlite3
|
|
18
|
-
pool: 5
|
|
19
|
-
timeout: 5000
|
|
20
|
-
|
|
21
|
-
production:
|
|
22
|
-
adapter: sqlite3
|
|
23
|
-
database: db/production.sqlite3
|
|
24
|
-
pool: 5
|
|
25
|
-
timeout: 5000
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
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 web server when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
8
|
-
|
|
9
|
-
# Show full error reports and disable caching
|
|
10
|
-
config.consider_all_requests_local = true
|
|
11
|
-
config.action_controller.perform_caching = false
|
|
12
|
-
|
|
13
|
-
# Print deprecation notices to the Rails logger
|
|
14
|
-
config.active_support.deprecation = :log
|
|
15
|
-
|
|
16
|
-
# Only use best-standards-support built into browsers
|
|
17
|
-
config.action_dispatch.best_standards_support = :builtin
|
|
18
|
-
|
|
19
|
-
config.eager_load = false
|
|
20
|
-
|
|
21
|
-
# Raise exception on mass assignment protection for Active Record models
|
|
22
|
-
# config.active_record.mass_assignment_sanitizer = :strict
|
|
23
|
-
|
|
24
|
-
# Log the query plan for queries taking more than this (works
|
|
25
|
-
# with SQLite, MySQL, and PostgreSQL)
|
|
26
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
|
27
|
-
|
|
28
|
-
# Do not compress assets
|
|
29
|
-
# config.assets.compress = false
|
|
30
|
-
|
|
31
|
-
# Expands the lines which load the assets
|
|
32
|
-
# config.assets.debug = true
|
|
33
|
-
|
|
34
|
-
config.active_storage.service = :local
|
|
35
|
-
end
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# Code is not reloaded between requests
|
|
5
|
-
config.cache_classes = true
|
|
6
|
-
|
|
7
|
-
# Full error reports are disabled and caching is turned on
|
|
8
|
-
config.consider_all_requests_local = false
|
|
9
|
-
config.action_controller.perform_caching = true
|
|
10
|
-
|
|
11
|
-
# Disable Rails's static asset server (Apache or nginx will already do this)
|
|
12
|
-
config.serve_static_assets = false
|
|
13
|
-
|
|
14
|
-
config.eager_load = true
|
|
15
|
-
|
|
16
|
-
# Defaults to nil and saved in location specified by config.assets.prefix
|
|
17
|
-
# config.assets.manifest = YOUR_PATH
|
|
18
|
-
|
|
19
|
-
# Specifies the header that your server uses for sending files
|
|
20
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
|
21
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
22
|
-
|
|
23
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
24
|
-
# config.force_ssl = true
|
|
25
|
-
|
|
26
|
-
# See everything in the log (default is :info)
|
|
27
|
-
# config.log_level = :debug
|
|
28
|
-
|
|
29
|
-
# Prepend all log lines with the following tags
|
|
30
|
-
# config.log_tags = [ :subdomain, :uuid ]
|
|
31
|
-
|
|
32
|
-
# Use a different logger for distributed setups
|
|
33
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
|
34
|
-
|
|
35
|
-
# Use a different cache store in production
|
|
36
|
-
# config.cache_store = :mem_cache_store
|
|
37
|
-
|
|
38
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
|
39
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
|
40
|
-
|
|
41
|
-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
|
42
|
-
# config.assets.precompile += %w( search.js )
|
|
43
|
-
|
|
44
|
-
# Enable threaded mode
|
|
45
|
-
# config.threadsafe!
|
|
46
|
-
|
|
47
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
48
|
-
# the I18n.default_locale when a translation can not be found)
|
|
49
|
-
config.i18n.fallbacks = true
|
|
50
|
-
|
|
51
|
-
# Send deprecation notices to registered listeners
|
|
52
|
-
config.active_support.deprecation = :notify
|
|
53
|
-
|
|
54
|
-
# Log the query plan for queries taking more than this (works
|
|
55
|
-
# with SQLite, MySQL, and PostgreSQL)
|
|
56
|
-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
|
57
|
-
|
|
58
|
-
config.active_storage.service = :local
|
|
59
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
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
|
|
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"
|
|
13
|
-
|
|
14
|
-
# Show full error reports and disable caching
|
|
15
|
-
config.consider_all_requests_local = true
|
|
16
|
-
config.action_controller.perform_caching = false
|
|
17
|
-
|
|
18
|
-
# Raise exceptions instead of rendering exception templates
|
|
19
|
-
config.action_dispatch.show_exceptions = false
|
|
20
|
-
|
|
21
|
-
# Disable request forgery protection in test environment
|
|
22
|
-
config.action_controller.allow_forgery_protection = false
|
|
23
|
-
|
|
24
|
-
# Raise exception on mass assignment protection for Active Record models
|
|
25
|
-
# config.active_record.mass_assignment_sanitizer = :strict
|
|
26
|
-
|
|
27
|
-
# Print deprecation notices to the stderr
|
|
28
|
-
config.active_support.deprecation = :stderr
|
|
29
|
-
|
|
30
|
-
config.eager_load = false
|
|
31
|
-
|
|
32
|
-
config.active_job.queue_adapter = :test
|
|
33
|
-
|
|
34
|
-
config.active_storage.service = :test
|
|
35
|
-
end
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
5
|
-
|
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Add new inflection rules using the following format
|
|
4
|
-
# (all these examples are active by default):
|
|
5
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
|
8
|
-
# inflect.irregular 'person', 'people'
|
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
|
10
|
-
# end
|
|
11
|
-
#
|
|
12
|
-
# These inflection rules are supported but not enabled by default:
|
|
13
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
|
14
|
-
# inflect.acronym 'RESTful'
|
|
15
|
-
# end
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
|
7
|
-
Dummy::Application.config.secret_key_base = 'c2e3474d3816f60bf6dd0f3b983e7283c7ff5373e11a96935340b544a31964dbe5ee077136165ee2975e0005f5e80207c0059e6d5589699031242ba5a06dcb87'
|
|
8
|
-
Dummy::Application.config.secret_token = 'c2e3474d3816f60bf6dd0f3b983e7283c7ff5373e11a96935340b544a31964dbe5ee077136165ee2975e0005f5e80207c0059e6d5589699031242ba5a06dcb87'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
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
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
development:
|
|
2
|
-
# Configure available database clients. (required)
|
|
3
|
-
clients:
|
|
4
|
-
# Defines the default client. (required)
|
|
5
|
-
default:
|
|
6
|
-
# Defines the name of the default database that Mongoid can connect to.
|
|
7
|
-
# (required).
|
|
8
|
-
database: dummy_development
|
|
9
|
-
# Provides the hosts the default client can connect to. Must be an array
|
|
10
|
-
# of host:port pairs. (required)
|
|
11
|
-
hosts:
|
|
12
|
-
- localhost:27017
|
|
13
|
-
options:
|
|
14
|
-
# Change the default write concern. (default = { w: 1 })
|
|
15
|
-
# write:
|
|
16
|
-
# w: 1
|
|
17
|
-
|
|
18
|
-
# Change the default read preference. Valid options for mode are: :secondary,
|
|
19
|
-
# :secondary_preferred, :primary, :primary_preferred, :nearest
|
|
20
|
-
# (default: primary)
|
|
21
|
-
# read:
|
|
22
|
-
# mode: :secondary_preferred
|
|
23
|
-
# tag_sets:
|
|
24
|
-
# - use: web
|
|
25
|
-
|
|
26
|
-
# The name of the user for authentication.
|
|
27
|
-
# user: 'user'
|
|
28
|
-
|
|
29
|
-
# The password of the user for authentication.
|
|
30
|
-
# password: 'password'
|
|
31
|
-
|
|
32
|
-
# The user's database roles.
|
|
33
|
-
# roles:
|
|
34
|
-
# - 'dbOwner'
|
|
35
|
-
|
|
36
|
-
# Change the default authentication mechanism. Valid options are: :scram,
|
|
37
|
-
# :mongodb_cr, :mongodb_x509, and :plain. (default on 3.0 is :scram, default
|
|
38
|
-
# on 2.4 and 2.6 is :plain)
|
|
39
|
-
# auth_mech: :scram
|
|
40
|
-
|
|
41
|
-
# The database or source to authenticate the user against. (default: admin)
|
|
42
|
-
# auth_source: admin
|
|
43
|
-
|
|
44
|
-
# Force a the driver cluster to behave in a certain manner instead of auto-
|
|
45
|
-
# discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct
|
|
46
|
-
# when connecting to hidden members of a replica set.
|
|
47
|
-
# connect: :direct
|
|
48
|
-
|
|
49
|
-
# Changes the default time in seconds the server monitors refresh their status
|
|
50
|
-
# via ismaster commands. (default: 10)
|
|
51
|
-
# heartbeat_frequency: 10
|
|
52
|
-
|
|
53
|
-
# The time in seconds for selecting servers for a near read preference. (default: 5)
|
|
54
|
-
# local_threshold: 5
|
|
55
|
-
|
|
56
|
-
# The timeout in seconds for selecting a server for an operation. (default: 30)
|
|
57
|
-
# server_selection_timeout: 30
|
|
58
|
-
|
|
59
|
-
# The maximum number of connections in the connection pool. (default: 5)
|
|
60
|
-
# max_pool_size: 5
|
|
61
|
-
|
|
62
|
-
# The minimum number of connections in the connection pool. (default: 1)
|
|
63
|
-
# min_pool_size: 1
|
|
64
|
-
|
|
65
|
-
# The time to wait, in seconds, in the connection pool for a connection
|
|
66
|
-
# to be checked in before timing out. (default: 5)
|
|
67
|
-
# wait_queue_timeout: 5
|
|
68
|
-
|
|
69
|
-
# The time to wait to establish a connection before timing out, in seconds.
|
|
70
|
-
# (default: 5)
|
|
71
|
-
# connect_timeout: 5
|
|
72
|
-
|
|
73
|
-
# The timeout to wait to execute operations on a socket before raising an error.
|
|
74
|
-
# (default: 5)
|
|
75
|
-
# socket_timeout: 5
|
|
76
|
-
|
|
77
|
-
# The name of the replica set to connect to. Servers provided as seeds that do
|
|
78
|
-
# not belong to this replica set will be ignored.
|
|
79
|
-
# replica_set: name
|
|
80
|
-
|
|
81
|
-
# Whether to connect to the servers via ssl. (default: false)
|
|
82
|
-
# ssl: true
|
|
83
|
-
|
|
84
|
-
# The certificate file used to identify the connection against MongoDB.
|
|
85
|
-
# ssl_cert: /path/to/my.cert
|
|
86
|
-
|
|
87
|
-
# The private keyfile used to identify the connection against MongoDB.
|
|
88
|
-
# Note that even if the key is stored in the same file as the certificate,
|
|
89
|
-
# both need to be explicitly specified.
|
|
90
|
-
# ssl_key: /path/to/my.key
|
|
91
|
-
|
|
92
|
-
# A passphrase for the private key.
|
|
93
|
-
# ssl_key_pass_phrase: password
|
|
94
|
-
|
|
95
|
-
# Whether or not to do peer certification validation. (default: true)
|
|
96
|
-
# ssl_verify: true
|
|
97
|
-
|
|
98
|
-
# The file containing a set of concatenated certification authority certifications
|
|
99
|
-
# used to validate certs passed from the other end of the connection.
|
|
100
|
-
# ssl_ca_cert: /path/to/ca.cert
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
# Configure Mongoid specific options. (optional)
|
|
104
|
-
options:
|
|
105
|
-
# Includes the root model name in json serialization. (default: false)
|
|
106
|
-
# include_root_in_json: false
|
|
107
|
-
|
|
108
|
-
# Include the _type field in serialization. (default: false)
|
|
109
|
-
# include_type_for_serialization: false
|
|
110
|
-
|
|
111
|
-
# Preload all models in development, needed when models use
|
|
112
|
-
# inheritance. (default: false)
|
|
113
|
-
# preload_models: false
|
|
114
|
-
|
|
115
|
-
# Raise an error when performing a #find and the document is not found.
|
|
116
|
-
# (default: true)
|
|
117
|
-
# raise_not_found_error: true
|
|
118
|
-
|
|
119
|
-
# Raise an error when defining a scope with the same name as an
|
|
120
|
-
# existing method. (default: false)
|
|
121
|
-
# scope_overwrite_exception: false
|
|
122
|
-
|
|
123
|
-
# Use Active Support's time zone in conversions. (default: true)
|
|
124
|
-
# use_activesupport_time_zone: true
|
|
125
|
-
|
|
126
|
-
# Ensure all times are UTC in the app side. (default: false)
|
|
127
|
-
# use_utc: false
|
|
128
|
-
|
|
129
|
-
# Set the Mongoid and Ruby driver log levels when not in a Rails
|
|
130
|
-
# environment. The Mongoid logger will be set to the Rails logger
|
|
131
|
-
# otherwise.(default: :info)
|
|
132
|
-
# log_level: :info
|
|
133
|
-
test:
|
|
134
|
-
clients:
|
|
135
|
-
default:
|
|
136
|
-
database: dummy_test
|
|
137
|
-
hosts:
|
|
138
|
-
- localhost:27017
|
|
139
|
-
options:
|
|
140
|
-
read:
|
|
141
|
-
mode: :primary
|
|
142
|
-
max_pool_size: 1
|
data/spec/dummy/config/routes.rb
DELETED
data/spec/dummy/config.ru
DELETED
data/spec/dummy/db/schema.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
|
5
|
-
#
|
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
|
7
|
-
# database schema. If you need to create the application database on another
|
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
11
|
-
#
|
|
12
|
-
# It's strongly recommended to check this file into your version control system.
|
|
13
|
-
|
|
14
|
-
ActiveRecord::Schema.define(version: 20121019115657) do
|
|
15
|
-
|
|
16
|
-
create_table "posts", force: true do |t|
|
|
17
|
-
t.datetime "created_at", null: false
|
|
18
|
-
t.datetime "updated_at", null: false
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
end
|
data/spec/dummy/db/seeds.rb
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
require 'draper'
|
|
2
|
-
|
|
3
|
-
require 'active_model/naming'
|
|
4
|
-
require_relative '../app/decorators/post_decorator'
|
|
5
|
-
|
|
6
|
-
Draper::ViewContext.test_strategy :fast
|
|
7
|
-
|
|
8
|
-
Post = Struct.new(:id) { extend ActiveModel::Naming }
|
|
9
|
-
|
|
10
|
-
describe PostDecorator do
|
|
11
|
-
let(:decorator) { PostDecorator.new(object) }
|
|
12
|
-
let(:object) { Post.new(42) }
|
|
13
|
-
|
|
14
|
-
it "can use built-in helpers" do
|
|
15
|
-
expect(decorator.truncated).to eq "Once upon a..."
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "can use built-in private helpers" do
|
|
19
|
-
expect(decorator.html_escaped).to eq "<script>danger</script>"
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "can't use user-defined helpers from app/helpers" do
|
|
23
|
-
expect{decorator.hello_world}.to raise_error NoMethodError, /hello_world/
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "can't use path helpers" do
|
|
27
|
-
expect{decorator.path_with_model}.to raise_error NoMethodError, /post_path/
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it "can't use url helpers" do
|
|
31
|
-
expect{decorator.url_with_model}.to raise_error NoMethodError, /post_url/
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it "can't be passed implicitly to url_for" do
|
|
35
|
-
expect{decorator.link}.to raise_error ArgumentError
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require 'rake/testtask'
|
|
2
|
-
require 'rspec/core/rake_task'
|
|
3
|
-
|
|
4
|
-
Rake::Task[:test].clear
|
|
5
|
-
Rake::TestTask.new :test do |t|
|
|
6
|
-
t.libs << "test"
|
|
7
|
-
t.pattern = "test/**/*_test.rb"
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
RSpec::Core::RakeTask.new :spec
|
|
11
|
-
|
|
12
|
-
RSpec::Core::RakeTask.new :fast_spec do |t|
|
|
13
|
-
t.pattern = "fast_spec/**/*_spec.rb"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
task default: [:test, :spec, :fast_spec]
|
data/spec/dummy/log/.gitkeep
DELETED
|
File without changes
|
data/spec/dummy/public/404.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
-
div.dialog {
|
|
8
|
-
width: 25em;
|
|
9
|
-
padding: 0 4em;
|
|
10
|
-
margin: 4em auto 0 auto;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-right-color: #999;
|
|
13
|
-
border-bottom-color: #999;
|
|
14
|
-
}
|
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<!-- This file lives in public/404.html -->
|
|
21
|
-
<div class="dialog">
|
|
22
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
|
23
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
|
24
|
-
</div>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
data/spec/dummy/public/422.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
-
div.dialog {
|
|
8
|
-
width: 25em;
|
|
9
|
-
padding: 0 4em;
|
|
10
|
-
margin: 4em auto 0 auto;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-right-color: #999;
|
|
13
|
-
border-bottom-color: #999;
|
|
14
|
-
}
|
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<!-- This file lives in public/422.html -->
|
|
21
|
-
<div class="dialog">
|
|
22
|
-
<h1>The change you wanted was rejected.</h1>
|
|
23
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
24
|
-
</div>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
data/spec/dummy/public/500.html
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
-
div.dialog {
|
|
8
|
-
width: 25em;
|
|
9
|
-
padding: 0 4em;
|
|
10
|
-
margin: 4em auto 0 auto;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-right-color: #999;
|
|
13
|
-
border-bottom-color: #999;
|
|
14
|
-
}
|
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<!-- This file lives in public/500.html -->
|
|
21
|
-
<div class="dialog">
|
|
22
|
-
<h1>We're sorry, but something went wrong.</h1>
|
|
23
|
-
</div>
|
|
24
|
-
</body>
|
|
25
|
-
</html>
|
|
File without changes
|
data/spec/dummy/script/rails
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
-
|
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
|
6
|
-
require 'rails/commands'
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Draper::CollectionDecorator do
|
|
4
|
-
describe "#active_model_serializer" do
|
|
5
|
-
it "returns ActiveModel::Serializer::CollectionSerializer" do
|
|
6
|
-
collection_decorator = Draper::CollectionDecorator.new([])
|
|
7
|
-
collection_serializer = ActiveModel::Serializer.serializer_for(collection_decorator)
|
|
8
|
-
|
|
9
|
-
expect(collection_serializer).to be ActiveModel::Serializer::CollectionSerializer
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
if defined?(Devise)
|
|
4
|
-
describe "A decorator spec" do
|
|
5
|
-
it "can sign in a real user" do
|
|
6
|
-
user = User.new
|
|
7
|
-
sign_in user
|
|
8
|
-
|
|
9
|
-
expect(helper.current_user).to be user
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "can sign in a mock user" do
|
|
13
|
-
user = double("User")
|
|
14
|
-
sign_in :user, user
|
|
15
|
-
|
|
16
|
-
expect(helper.current_user).to be user
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it "can sign in a real admin" do
|
|
20
|
-
admin = Admin.new
|
|
21
|
-
sign_in admin
|
|
22
|
-
|
|
23
|
-
expect(helper.current_admin).to be admin
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it "can sign in a mock admin" do
|
|
27
|
-
admin = double("Admin")
|
|
28
|
-
sign_in :admin, admin
|
|
29
|
-
|
|
30
|
-
expect(helper.current_admin).to be admin
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "can sign out a real user" do
|
|
34
|
-
user = User.new
|
|
35
|
-
sign_in user
|
|
36
|
-
sign_out user
|
|
37
|
-
|
|
38
|
-
expect(helper.current_user).to be_nil
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it "can sign out a mock user" do
|
|
42
|
-
user = double("User")
|
|
43
|
-
sign_in :user, user
|
|
44
|
-
sign_out :user
|
|
45
|
-
|
|
46
|
-
expect(helper.current_user).to be_nil
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it "can sign out without a user" do
|
|
50
|
-
sign_out :user
|
|
51
|
-
|
|
52
|
-
expect(helper.current_user).to be_nil
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|