commontator 4.0.1 → 4.0.2

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -5
  3. data/app/controllers/commontator/comments_controller.rb +6 -6
  4. data/app/controllers/commontator/subscriptions_controller.rb +2 -2
  5. data/app/controllers/commontator/threads_controller.rb +2 -2
  6. data/app/views/commontator/comments/_actions.html.erb +1 -1
  7. data/app/views/commontator/comments/_votes.html.erb +4 -4
  8. data/app/views/commontator/shared/_thread.html.erb +1 -1
  9. data/app/views/commontator/subscriptions/_link.html.erb +1 -1
  10. data/app/views/commontator/threads/_show.html.erb +1 -1
  11. data/config/routes.rb +9 -9
  12. data/lib/commontator/version.rb +1 -1
  13. data/spec/app/controllers/commontator/comments_controller_spec.rb +40 -40
  14. data/spec/app/controllers/commontator/subscriptions_controller_spec.rb +12 -12
  15. data/spec/app/controllers/commontator/threads_controller_spec.rb +12 -12
  16. data/spec/dummy/db/test.sqlite3 +0 -0
  17. data/spec/dummy/log/test.log +4176 -0
  18. metadata +4 -91
  19. data/app/controllers/commontator/application_controller.rb~ +0 -27
  20. data/app/controllers/commontator/comments_controller.rb~ +0 -144
  21. data/app/controllers/commontator/subscriptions_controller.rb~ +0 -32
  22. data/app/controllers/commontator/threads_controller.rb~ +0 -42
  23. data/app/mailers/commontator/subscriptions_mailer.rb~ +0 -50
  24. data/app/models/commontator/comment.rb~ +0 -104
  25. data/app/models/commontator/subscription.rb~ +0 -18
  26. data/app/models/commontator/thread.rb~ +0 -124
  27. data/app/models/commontator/tree.rb~ +0 -123
  28. data/app/views/commontator/comments/_actions.html.erb~ +0 -30
  29. data/app/views/commontator/comments/_body.html.erb~ +0 -8
  30. data/app/views/commontator/comments/_form.html.erb~ +0 -38
  31. data/app/views/commontator/comments/_show.html.erb~ +0 -44
  32. data/app/views/commontator/comments/_votes.html.erb~ +0 -57
  33. data/app/views/commontator/comments/delete.js.erb~ +0 -17
  34. data/app/views/commontator/shared/_thread.html.erb~ +0 -20
  35. data/app/views/commontator/subscriptions/_link.html.erb~ +0 -16
  36. data/app/views/commontator/threads/_show.html.erb~ +0 -62
  37. data/config/initializers/commontator.rb~ +0 -171
  38. data/config/routes.rb~ +0 -22
  39. data/db/migrate/0_install.rb~ +0 -50
  40. data/lib/commontator.rb~ +0 -61
  41. data/lib/commontator/acts_as_commontable.rb~ +0 -45
  42. data/lib/commontator/acts_as_commontator.rb~ +0 -31
  43. data/lib/commontator/controller_includes.rb~ +0 -22
  44. data/lib/commontator/security_transgression.rb~ +0 -3
  45. data/lib/commontator/shared_helper.rb~ +0 -42
  46. data/lib/commontator/version.rb~ +0 -3
  47. data/lib/tasks/commontator_tasks.rake~ +0 -42
  48. data/spec/app/controllers/commontator/comments_controller_spec.rb~ +0 -563
  49. data/spec/app/controllers/commontator/subscriptions_controller_spec.rb~ +0 -99
  50. data/spec/app/controllers/commontator/threads_controller_spec.rb~ +0 -121
  51. data/spec/app/helpers/commontator/application_helper_spec.rb~ +0 -9
  52. data/spec/app/helpers/commontator/threads_helper_spec.rb~ +0 -17
  53. data/spec/app/mailers/commontator/subscriptions_mailer_spec.rb~ +0 -30
  54. data/spec/app/models/commontator/comment_observer_spec.rb~ +0 -27
  55. data/spec/app/models/commontator/comment_spec.rb~ +0 -61
  56. data/spec/app/models/commontator/subscription_spec.rb~ +0 -28
  57. data/spec/app/models/commontator/thread_spec.rb~ +0 -130
  58. data/spec/dummy/README.md~ +0 -3
  59. data/spec/dummy/Rakefile~ +0 -7
  60. data/spec/dummy/config.ru~ +0 -4
  61. data/spec/dummy/config/application.rb~ +0 -23
  62. data/spec/dummy/config/environment.rb~ +0 -5
  63. data/spec/dummy/config/environments/development.rb~ +0 -31
  64. data/spec/dummy/config/environments/production.rb~ +0 -67
  65. data/spec/dummy/config/environments/test.rb~ +0 -31
  66. data/spec/dummy/config/initializers/secret_token.rb~ +0 -12
  67. data/spec/lib/commontator/acts_as_commontable_spec.rb~ +0 -26
  68. data/spec/lib/commontator/acts_as_commontator_spec.rb~ +0 -25
  69. data/spec/lib/commontator/commontable_config_spec.rb~ +0 -26
  70. data/spec/lib/commontator/commontator_config_spec.rb~ +0 -26
  71. data/spec/lib/commontator/controller_includes_spec.rb~ +0 -15
  72. data/spec/lib/commontator/shared_helper_spec.rb~ +0 -16
  73. data/spec/lib/commontator_spec.rb~ +0 -23
  74. data/spec/minitest_helper.rb~ +0 -35
  75. data/spec/spec_helper.rb~ +0 -36
  76. data/spec/test_helper.rb~ +0 -37
@@ -1,3 +0,0 @@
1
- ## Dummy
2
-
3
- A dummy application used for testing the commontator engine.
data/spec/dummy/Rakefile~ DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,23 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require(*Rails.groups)
6
- require "commontator"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
- # config.time_zone = 'Central Time (US & Canada)'
17
-
18
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
- # config.i18n.default_locale = :de
21
- end
22
- end
23
-
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
@@ -1,31 +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
- # Don't care if the mailer can't send
14
- config.action_mailer.raise_delivery_errors = false
15
-
16
- # Print deprecation notices to the Rails logger
17
- config.active_support.deprecation = :log
18
-
19
- # Only use best-standards-support built into browsers
20
- config.action_dispatch.best_standards_support = :builtin
21
-
22
- # Log the query plan for queries taking more than this (works
23
- # with SQLite, MySQL, and PostgreSQL)
24
- config.active_record.auto_explain_threshold_in_seconds = 0.5
25
-
26
- # Do not compress assets
27
- config.assets.compress = false
28
-
29
- # Expands the lines which load the assets
30
- config.assets.debug = true
31
- end
@@ -1,67 +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
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to nil and saved in location specified by config.assets.prefix
24
- # config.assets.manifest = YOUR_PATH
25
-
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
29
-
30
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
- # config.force_ssl = true
32
-
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
35
-
36
- # Prepend all log lines with the following tags
37
- # config.log_tags = [ :subdomain, :uuid ]
38
-
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
43
- # config.cache_store = :mem_cache_store
44
-
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 )
50
-
51
- # Disable delivery errors, bad email addresses will be ignored
52
- # config.action_mailer.raise_delivery_errors = false
53
-
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
- # 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)
59
- config.i18n.fallbacks = true
60
-
61
- # Send deprecation notices to registered listeners
62
- config.active_support.deprecation = :notify
63
-
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
67
- end
@@ -1,31 +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
- # Tell Action Mailer not to deliver emails to the real world.
25
- # The :test delivery method accumulates sent emails in the
26
- # ActionMailer::Base.deliveries array.
27
- config.action_mailer.delivery_method = :test
28
-
29
- # Print deprecation notices to the stderr
30
- config.active_support.deprecation = :stderr
31
- end
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure your secret_key_base is kept private
11
- # if you're sharing your code publicly.
12
- Dummy::Application.config.secret_key_base = '7b77635ba357b3b7bb0c9930e8b0a856155193df3d0f1d1f5144b724c7d89524139756411fd104feff7b7a05494c63ff45d1f0014c6fbc74f3f49fc67ac0ec3e'
@@ -1,26 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Commontator
4
- describe ActsAsCommontable do
5
- it 'must add methods to ActiveRecord and subclasses' do
6
- ActiveRecord::Base.must_respond_to :acts_as_common
7
- ActiveRecord::Base.must_respond_to :is_commontable
8
- ActiveRecord::Base.is_commontable.must_equal false
9
- DummyModel.must_respond_to :acts_as_commontable
10
- DummyModel.must_respond_to :is_commontable
11
- DummyModel.is_commontable.must_equal true
12
- DummyUser.must_respond_to :acts_as_commontable
13
- DummyUser.must_respond_to :is_commontable
14
- DummyUser.is_commontable.must_equal false
15
- end
16
-
17
- it 'must modify models that act_as_commontable' do
18
- dummy = DummyModel.create
19
- dummy.must_respond_to :thread
20
- dummy.must_respond_to :comments
21
- dummy.must_respond_to :subscriptions
22
- dummy.must_respond_to :commontable_config
23
- dummy.commontable_config.must_be_instance_of CommontableConfig
24
- end
25
- end
26
- end
@@ -1,25 +0,0 @@
1
- require 'minitest_helper'
2
-
3
- module Commontator
4
- describe ActsAsCommontator do
5
- it 'must add methods to ActiveRecord and subclasses' do
6
- ActiveRecord::Base.must_respond_to :acts_as_commontator
7
- ActiveRecord::Base.must_respond_to :is_commontator
8
- ActiveRecord::Base.is_commontator.must_equal false
9
- DummyModel.must_respond_to :acts_as_commontator
10
- DummyModel.must_respond_to :is_commontator
11
- DummyModel.is_commontator.must_equal false
12
- DummyUser.must_respond_to :acts_as_commontator
13
- DummyUser.must_respond_to :is_commontator
14
- DummyUser.is_commontator.must_equal true
15
- end
16
-
17
- it 'must modify models that act_as_commontator' do
18
- user = DummyUser.create
19
- user.must_respond_to :comments
20
- user.must_respond_to :subscriptions
21
- user.must_respond_to :commontator_config
22
- user.commontator_config.must_be_instance_of CommontatorConfig
23
- end
24
- end
25
- end
@@ -1,26 +0,0 @@
1
- require 'minitest_helper'
2
-
3
- module Commontator
4
- describe CommontableConfig do
5
- it 'must respond to commontable attributes' do
6
- config = CommontableConfig.new
7
- COMMONTABLE_ATTRIBUTES.each do |attribute|
8
- config.must_respond_to attribute
9
- end
10
- end
11
-
12
- it 'wont respond to engine or commontator attributes' do
13
- config = CommontableConfig.new
14
- (ENGINE_ATTRIBUTES + COMMONTATOR_ATTRIBUTES).each do |attribute|
15
- config.wont_respond_to attribute
16
- end
17
- end
18
-
19
- it 'must be configurable' do
20
- config = CommontableConfig.new(:comment_create_verb_present => 'create')
21
- config.comment_create_verb_present.must_equal 'create'
22
- config = CommontableConfig.new(:comment_create_verb_present => 'post')
23
- config.comment_create_verb_present.must_equal 'post'
24
- end
25
- end
26
- end
@@ -1,26 +0,0 @@
1
- require 'minitest_helper'
2
-
3
- module Commontator
4
- describe CommontatorConfig do
5
- it 'must respond to commontator attributes' do
6
- config = CommontatorConfig.new
7
- COMMONTATOR_ATTRIBUTES.each do |attribute|
8
- config.must_respond_to attribute
9
- end
10
- end
11
-
12
- it 'wont respond to engine or commontable attributes' do
13
- config = CommontatorConfig.new
14
- (ENGINE_ATTRIBUTES + COMMONTABLE_ATTRIBUTES).each do |attribute|
15
- config.wont_respond_to attribute
16
- end
17
- end
18
-
19
- it 'must be configurable' do
20
- config = CommontatorConfig.new(:user_missing_name => 'Anon')
21
- config.user_missing_name.must_equal 'Anon'
22
- config = CommontatorConfig.new(:user_missing_name => 'Anonymous')
23
- config.user_missing_name.must_equal 'Anonymous'
24
- end
25
- end
26
- end
@@ -1,15 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Commontator
4
- describe ControllerIncludes do
5
- it 'must add commontator_thread_show to ActionController instances' do
6
- ActionController::Base.new.respond_to?(:commontator_thread_show, true).must_be true
7
- DummyModelsController.new.respond_to?(:commontator_thread_show, true).must_equal true
8
- end
9
-
10
- it 'must add shared helper to ActionController and subclasses' do
11
- ActionController::Base.helpers.must_respond_to :commontator_thread
12
- DummyModelsController.helpers.must_respond_to :commontator_thread
13
- end
14
- end
15
- end
@@ -1,16 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Commontator
4
- describe SharedHelper do
5
- it 'must show commontator thread' do
6
- controller = DummyModelsController.new
7
- # Workaround for
8
- controller.define_singleton_method(:params) do
9
- {}
10
- end
11
- thread_link = controller.view_context.commontator_thread(DummyModel.create)
12
- thread_link.wont_be_nil
13
- thread_link.wont_be_empty
14
- end
15
- end
16
- end
@@ -1,23 +0,0 @@
1
- require 'minitest_helper'
2
-
3
- module Commontator
4
- describe Commontator do
5
- it 'must respond to all attributes' do
6
- (ENGINE_ATTRIBUTES + COMMONTATOR_ATTRIBUTES + \
7
- COMMONTABLE_ATTRIBUTES).each do |attribute|
8
- Commontator.must_respond_to attribute
9
- end
10
- end
11
-
12
- it 'must be configurable' do
13
- Commontator.configure do |config|
14
- config.current_user_method = 'user'
15
- end
16
- Commontator.current_user_method.must_equal 'user'
17
- Commontator.configure do |config|
18
- config.current_user_method = 'current_user'
19
- end
20
- Commontator.current_user_method.must_equal 'current_user'
21
- end
22
- end
23
- end
@@ -1,35 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
-
6
- require "minitest/autorun"
7
- require "minitest/rails"
8
-
9
- require "minitest/rails/capybara"
10
-
11
- Rails.backtrace_cleaner.remove_silencers!
12
-
13
- Commontator::ApplicationController.class_eval do
14
- include ApplicationHelper
15
- end
16
-
17
- def setup_model_spec
18
- @user = DummyUser.create
19
- @commontable = DummyModel.create
20
- @thread = @commontable.thread
21
- end
22
-
23
- def setup_controller_spec
24
- class_eval {include ApplicationHelper}
25
- sign_out
26
- setup_model_spec
27
- end
28
-
29
- def setup_helper_spec
30
- setup_model_spec
31
- end
32
-
33
- def setup_mailer_spec
34
- setup_model_spec
35
- end
data/spec/spec_helper.rb~ DELETED
@@ -1,36 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
-
6
- require "minitest/autorun"
7
- require "minitest/rails"
8
-
9
- require "minitest/rails/capybara"
10
-
11
- Rails.backtrace_cleaner.remove_silencers!
12
-
13
-
14
- Commontator::ApplicationController.class_eval do
15
- include ApplicationHelper
16
- end
17
-
18
- def setup_model_spec
19
- @user = DummyUser.create
20
- @commontable = DummyModel.create
21
- @thread = @commontable.thread
22
- end
23
-
24
- def setup_controller_spec
25
- class_eval {include ApplicationHelper}
26
- sign_out
27
- setup_model_spec
28
- end
29
-
30
- def setup_helper_spec
31
- setup_model_spec
32
- end
33
-
34
- def setup_mailer_spec
35
- setup_model_spec
36
- end