ack-mongoid-forums 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +35 -0
- data/app/assets/javascripts/mongoid_forums/admin/base.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/categories.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/forums.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/groups.js +2 -0
- data/app/assets/javascripts/mongoid_forums/admin/users.js +2 -0
- data/app/assets/javascripts/mongoid_forums/application.js +15 -0
- data/app/assets/javascripts/mongoid_forums/forums.js +2 -0
- data/app/assets/javascripts/mongoid_forums/posts.js +2 -0
- data/app/assets/javascripts/mongoid_forums/topics.js +2 -0
- data/app/assets/stylesheets/mongoid_forums/admin/base.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/categories.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/forums.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/groups.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/admin/users.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/application.css +15 -0
- data/app/assets/stylesheets/mongoid_forums/forums.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/posts.css +4 -0
- data/app/assets/stylesheets/mongoid_forums/topics.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/mongoid_forums/admin/base_controller.rb +18 -0
- data/app/controllers/mongoid_forums/admin/categories_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/forums_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/groups_controller.rb +83 -0
- data/app/controllers/mongoid_forums/admin/topics_controller.rb +48 -0
- data/app/controllers/mongoid_forums/admin/users_controller.rb +34 -0
- data/app/controllers/mongoid_forums/application_controller.rb +57 -0
- data/app/controllers/mongoid_forums/forums_controller.rb +66 -0
- data/app/controllers/mongoid_forums/posts_controller.rb +133 -0
- data/app/controllers/mongoid_forums/redirect_controller.rb +33 -0
- data/app/controllers/mongoid_forums/topics_controller.rb +83 -0
- data/app/decorators/lib/mongoid_forums/user_class_decorator.rb +1 -0
- data/app/helpers/mongoid_forums/admin/base_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/categories_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/forums_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/groups_helper.rb +4 -0
- data/app/helpers/mongoid_forums/admin/users_helper.rb +4 -0
- data/app/helpers/mongoid_forums/application_helper.rb +20 -0
- data/app/helpers/mongoid_forums/formatting_helper.rb +28 -0
- data/app/helpers/mongoid_forums/forums_helper.rb +15 -0
- data/app/helpers/mongoid_forums/posts_helper.rb +4 -0
- data/app/helpers/mongoid_forums/topics_helper.rb +4 -0
- data/app/models/mongoid_forums/ability.rb +65 -0
- data/app/models/mongoid_forums/alert.rb +80 -0
- data/app/models/mongoid_forums/category.rb +31 -0
- data/app/models/mongoid_forums/concerns/subscribable.rb +76 -0
- data/app/models/mongoid_forums/concerns/viewable.rb +60 -0
- data/app/models/mongoid_forums/forum.rb +67 -0
- data/app/models/mongoid_forums/group.rb +15 -0
- data/app/models/mongoid_forums/post.rb +40 -0
- data/app/models/mongoid_forums/subscription.rb +65 -0
- data/app/models/mongoid_forums/topic.rb +55 -0
- data/app/models/mongoid_forums/view.rb +30 -0
- data/app/views/layouts/mongoid_forums/application.haml +21 -0
- data/app/views/mongoid_forums/admin/base/index.haml +6 -0
- data/app/views/mongoid_forums/admin/categories/edit.haml +4 -0
- data/app/views/mongoid_forums/admin/categories/index.haml +21 -0
- data/app/views/mongoid_forums/admin/categories/new.haml +4 -0
- data/app/views/mongoid_forums/admin/categories/show.haml +21 -0
- data/app/views/mongoid_forums/admin/forums/edit.haml +5 -0
- data/app/views/mongoid_forums/admin/forums/index.haml +25 -0
- data/app/views/mongoid_forums/admin/forums/new.haml +5 -0
- data/app/views/mongoid_forums/admin/forums/show.haml +21 -0
- data/app/views/mongoid_forums/admin/groups/edit.haml +4 -0
- data/app/views/mongoid_forums/admin/groups/index.haml +23 -0
- data/app/views/mongoid_forums/admin/groups/new.haml +5 -0
- data/app/views/mongoid_forums/admin/groups/show.haml +26 -0
- data/app/views/mongoid_forums/admin/users/index.haml +24 -0
- data/app/views/mongoid_forums/forums/index.haml +46 -0
- data/app/views/mongoid_forums/forums/new.haml +15 -0
- data/app/views/mongoid_forums/forums/show.haml +47 -0
- data/app/views/mongoid_forums/posts/_form.haml +4 -0
- data/app/views/mongoid_forums/posts/_post.haml +24 -0
- data/app/views/mongoid_forums/posts/_quoted.haml +9 -0
- data/app/views/mongoid_forums/posts/edit.haml +17 -0
- data/app/views/mongoid_forums/posts/new.haml +17 -0
- data/app/views/mongoid_forums/topics/_topic.haml +2 -0
- data/app/views/mongoid_forums/topics/my_posts.haml +6 -0
- data/app/views/mongoid_forums/topics/my_subscriptions.haml +5 -0
- data/app/views/mongoid_forums/topics/my_topics.haml +6 -0
- data/app/views/mongoid_forums/topics/show.haml +16 -0
- data/config/locales/en.yml +196 -0
- data/config/routes.rb +62 -0
- data/lib/ack_mongoid_forums.rb +1 -0
- data/lib/generators/mongoid_forums/install/templates/initializer.rb +5 -0
- data/lib/generators/mongoid_forums/install_generator.rb +90 -0
- data/lib/generators/mongoid_forums/views_generator.rb +27 -0
- data/lib/mongoid_forums.rb +53 -0
- data/lib/mongoid_forums/default_permissions.rb +63 -0
- data/lib/mongoid_forums/engine.rb +20 -0
- data/lib/mongoid_forums/sanitizer.rb +10 -0
- data/lib/mongoid_forums/version.rb +3 -0
- data/lib/tasks/mongoid_forums_tasks.rake +4 -0
- data/test/controllers/mongoid_forums/admin/base_controller_test.rb +11 -0
- data/test/controllers/mongoid_forums/admin/categories_controller_test.rb +31 -0
- data/test/controllers/mongoid_forums/admin/forums_controller_test.rb +31 -0
- data/test/controllers/mongoid_forums/admin/groups_controller_test.rb +41 -0
- data/test/controllers/mongoid_forums/admin/users_controller_test.rb +11 -0
- data/test/controllers/mongoid_forums/forums_controller_test.rb +16 -0
- data/test/controllers/mongoid_forums/posts_controller_test.rb +36 -0
- data/test/controllers/mongoid_forums/topics_controller_test.rb +36 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/welcome.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +11 -0
- data/test/dummy/app/controllers/welcome_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/welcome_helper.rb +2 -0
- data/test/dummy/app/models/concerns/zero_oid_fix.rb +10 -0
- data/test/dummy/app/models/user.rb +43 -0
- data/test/dummy/app/views/layouts/application.haml +13 -0
- data/test/dummy/app/views/partials/_nav.haml +6 -0
- data/test/dummy/app/views/welcome/index.html.erb +2 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +29 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +76 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/devise.rb +259 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/kaminari_config.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/mongoid_forums.rb +5 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/simple_form.rb +166 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/devise.en.yml +60 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/locales/simple_form.en.yml +31 -0
- data/test/dummy/config/mongoid.yml +69 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/controllers/welcome_controller_test.rb +9 -0
- data/test/dummy/test/fixtures/users.yml +11 -0
- data/test/dummy/test/models/user_test.rb +7 -0
- data/test/fixtures/mongoid_forums/categories.yml +11 -0
- data/test/fixtures/mongoid_forums/forums.yml +11 -0
- data/test/fixtures/mongoid_forums/posts.yml +11 -0
- data/test/fixtures/mongoid_forums/ranks.yml +11 -0
- data/test/fixtures/mongoid_forums/topics.yml +11 -0
- data/test/integration/navigation_test.rb +9 -0
- data/test/models/mongoid_forums/category_test.rb +9 -0
- data/test/models/mongoid_forums/forum_test.rb +9 -0
- data/test/models/mongoid_forums/post_test.rb +9 -0
- data/test/models/mongoid_forums/rank_test.rb +9 -0
- data/test/models/mongoid_forums/topic_test.rb +9 -0
- data/test/mongoid_forums_test.rb +7 -0
- data/test/test_helper.rb +17 -0
- metadata +442 -0
@@ -0,0 +1 @@
|
|
1
|
+
require "mongoid_forums"
|
@@ -0,0 +1,5 @@
|
|
1
|
+
MongoidForums.user_class = "<%= user_class %>"
|
2
|
+
MongoidForums.email_from_address = "please-change-me@example.com"
|
3
|
+
# If you do not want to use gravatar for avatars then specify the method to use here:
|
4
|
+
# MongoidForums.avatar_user_method = :custom_avatar_url
|
5
|
+
MongoidForums.per_page = <%= MongoidForums.per_page.inspect %>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# Thanks to radar/forem
|
2
|
+
# The code used to inspire this generator!
|
3
|
+
require 'mongoid_forums'
|
4
|
+
require 'rails/generators'
|
5
|
+
module MongoidForums
|
6
|
+
module Generators
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
8
|
+
class_option "user-class", :type => :string
|
9
|
+
class_option "current-user-helper", :type => :string
|
10
|
+
|
11
|
+
source_root File.expand_path("../install/templates", __FILE__)
|
12
|
+
desc "Used to install MongoidForums"
|
13
|
+
|
14
|
+
def determine_user_class
|
15
|
+
@user_class = options["user-class"].presence ||
|
16
|
+
ask("What is your user class called? [User]").presence ||
|
17
|
+
'User'
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def determine_current_user_helper
|
22
|
+
if options["current-user-helper"]
|
23
|
+
current_user_helper = options["current-user-helper"]
|
24
|
+
else
|
25
|
+
current_user_helper = ask("What is the current_user helper called in your app? [current_user]")
|
26
|
+
end
|
27
|
+
current_user_helper = :current_user if current_user_helper.blank?
|
28
|
+
puts "Defining mongoid_forums_user method inside ApplicationController..."
|
29
|
+
|
30
|
+
mongoid_forums_user_method = %Q{
|
31
|
+
def mongoid_forums_user
|
32
|
+
#{current_user_helper}
|
33
|
+
end
|
34
|
+
helper_method :mongoid_forums_user
|
35
|
+
}
|
36
|
+
|
37
|
+
inject_into_file("#{Rails.root}/app/controllers/application_controller.rb",
|
38
|
+
mongoid_forums_user_method,
|
39
|
+
:after => "ActionController::Base\n")
|
40
|
+
end
|
41
|
+
|
42
|
+
def add_mongoid_forums_initializer
|
43
|
+
path = "#{Rails.root}/config/initializers/mongoid_forums.rb"
|
44
|
+
if File.exists?(path)
|
45
|
+
puts "Skipping config/initializers/mongoid_forums.rb creation, as file already exists!"
|
46
|
+
else
|
47
|
+
puts "Adding mongoid_forums initializer (config/initializers/mongoid_forums.rb)..."
|
48
|
+
template "initializer.rb", path
|
49
|
+
require path
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def mount_engine
|
54
|
+
puts "Mounting MongoidForums::Engine at \"/forums\" in config/routes.rb..."
|
55
|
+
insert_into_file("#{Rails.root}/config/routes.rb", :after => /routes.draw.do\n/) do
|
56
|
+
%Q{ mount MongoidForums::Engine, :at => "/forums"\n}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def finished
|
61
|
+
output = "\n\n" + ("*" * 53)
|
62
|
+
output += %Q{\nDone! MongoidForums has been successfully installed. Yaaaaay!
|
63
|
+
Here's what happened:\n\n}
|
64
|
+
|
65
|
+
output += step("A new file was created at config/initializers/mongoid_forums.rb
|
66
|
+
This is where you put MongoidForums's configuration settings.\n")
|
67
|
+
output += step("The engine was mounted in your config/routes.rb file using this line:
|
68
|
+
mount MongoidForums::Engine, :at => \"/forums\"
|
69
|
+
If you want to change where the forums are located, just change the \"/forums\" path at the end of this line to whatever you want.")
|
70
|
+
output += %Q{\nAnd finally:
|
71
|
+
#{step("We told you that MongoidForums has been successfully installed and walked you through the steps.")}}
|
72
|
+
output += "Thanks for using MongoidForums!"
|
73
|
+
puts output
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def step(words)
|
79
|
+
@step ||= 0
|
80
|
+
@step += 1
|
81
|
+
"#{@step}) #{words}\n"
|
82
|
+
end
|
83
|
+
|
84
|
+
def user_class
|
85
|
+
@user_class
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Thanks to plataformatec/devise
|
2
|
+
# The code used to inspire this generator!
|
3
|
+
require 'rails/generators'
|
4
|
+
module MongoidForums
|
5
|
+
module Generators
|
6
|
+
class ViewsGenerator < Rails::Generators::Base #:nodoc:
|
7
|
+
source_root File.expand_path("../../../../app/views/mongoid_forums", __FILE__)
|
8
|
+
desc "Used to copy Mongoid Forum's views to your application's views."
|
9
|
+
|
10
|
+
def copy_views
|
11
|
+
view_directory :admin
|
12
|
+
#view_directory :categories
|
13
|
+
view_directory :forums
|
14
|
+
#view_directory :moderation
|
15
|
+
view_directory :posts
|
16
|
+
#view_directory :subscription_mailer
|
17
|
+
view_directory :topics
|
18
|
+
end
|
19
|
+
|
20
|
+
protected
|
21
|
+
|
22
|
+
def view_directory(name)
|
23
|
+
directory name.to_s, "app/views/mongoid_forums/#{name}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Fix for #185 and build issues
|
2
|
+
require 'active_support/core_ext/kernel/singleton_class'
|
3
|
+
require 'decorators'
|
4
|
+
require "mongoid_forums/engine"
|
5
|
+
require 'mongoid_forums/sanitizer'
|
6
|
+
require 'mongoid_forums/default_permissions'
|
7
|
+
require 'sanitize'
|
8
|
+
require 'haml'
|
9
|
+
require "mongoid"
|
10
|
+
|
11
|
+
module MongoidForums
|
12
|
+
mattr_accessor :per_page, :user_class, :formatter, :email_from_address, :sign_in_path
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def decorate_user_class!
|
16
|
+
MongoidForums.user_class.class_eval do
|
17
|
+
include MongoidForums::DefaultPermissions
|
18
|
+
|
19
|
+
has_many :mongoid_forums_posts, :class_name => "MongoidForums::Post", :foreign_key => "user_id"
|
20
|
+
has_many :mongoid_forums_topics, :class_name => "MongoidForums::Topic", :foreign_key => "user_id"
|
21
|
+
|
22
|
+
field :mongoid_admin, type: Boolean, default: false
|
23
|
+
|
24
|
+
def mongoid_forums_admin?
|
25
|
+
mongoid_admin
|
26
|
+
end unless method_defined? :mongoid_forums_admin
|
27
|
+
|
28
|
+
# Using +to_s+ by default for backwards compatibility
|
29
|
+
def forum_display_name
|
30
|
+
to_s
|
31
|
+
end unless method_defined? :forum_display_name
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def per_page
|
37
|
+
@@per_page || 20
|
38
|
+
end
|
39
|
+
|
40
|
+
def user_class
|
41
|
+
if @@user_class.is_a?(Class)
|
42
|
+
raise "You can't set MongoidForums.user_class to be a class. Please use a string instead.\n\n " +
|
43
|
+
"See https://github.com/radar/forem/issues/88 for more information."
|
44
|
+
elsif @@user_class.is_a?(String)
|
45
|
+
begin
|
46
|
+
Object.const_get(@@user_class)
|
47
|
+
rescue NameError
|
48
|
+
@@user_class.constantize
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module MongoidForums
|
2
|
+
# Defines a whole bunch of permissions for mongoid_forums
|
3
|
+
# Access (most) areas by default
|
4
|
+
module DefaultPermissions
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
unless method_defined?(:can_read_mongoid_forums_category?)
|
9
|
+
def can_read_mongoid_forums_category?(category)
|
10
|
+
true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
unless method_defined?(:can_read_mongoid_forums_forums?)
|
15
|
+
def can_read_mongoid_forums_forums?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
unless method_defined?(:can_read_mongoid_forums_forum?)
|
21
|
+
def can_read_mongoid_forums_forum?(forum)
|
22
|
+
true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
unless method_defined?(:can_create_mongoid_forums_topics?)
|
27
|
+
def can_create_mongoid_forums_topics?(forum)
|
28
|
+
true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
unless method_defined?(:can_reply_to_mongoid_forums_topic?)
|
33
|
+
def can_reply_to_mongoid_forums_topic?(topic)
|
34
|
+
true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
unless method_defined?(:can_edit_mongoid_forums_posts?)
|
39
|
+
def can_edit_mongoid_forums_posts?(forum)
|
40
|
+
true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
unless method_defined?(:can_destroy_mongoid_forums_posts?)
|
45
|
+
def can_destroy_mongoid_forums_posts?(forum)
|
46
|
+
true
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
unless method_defined?(:can_read_mongoid_forums_topic?)
|
51
|
+
def can_read_mongoid_forums_topic?(topic)
|
52
|
+
!topic.hidden? || mongoid_forums_admin?
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
unless method_defined?(:can_moderate_mongoid_forums_forum?)
|
57
|
+
def can_moderate_mongoid_forums_forum?(forum)
|
58
|
+
forum.moderator?(self)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'simple_form'
|
2
|
+
require 'kaminari'
|
3
|
+
|
4
|
+
module MongoidForums
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
isolate_namespace MongoidForums
|
7
|
+
|
8
|
+
class << self
|
9
|
+
attr_accessor :root
|
10
|
+
def root
|
11
|
+
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
config.to_prepare do
|
16
|
+
Decorators.register! Engine.root, Rails.root
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class Admin::CategoriesControllerTest < ActionController::TestCase
|
5
|
+
test "should get new" do
|
6
|
+
get :new
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get create" do
|
11
|
+
get :create
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get edit" do
|
16
|
+
get :edit
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get update" do
|
21
|
+
get :update
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get destroy" do
|
26
|
+
get :destroy
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class Admin::ForumsControllerTest < ActionController::TestCase
|
5
|
+
test "should get new" do
|
6
|
+
get :new
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get create" do
|
11
|
+
get :create
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get edit" do
|
16
|
+
get :edit
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get update" do
|
21
|
+
get :update
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get destroy" do
|
26
|
+
get :destroy
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class Admin::GroupsControllerTest < ActionController::TestCase
|
5
|
+
test "should get index" do
|
6
|
+
get :index
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get new" do
|
11
|
+
get :new
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get create" do
|
16
|
+
get :create
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get edit" do
|
21
|
+
get :edit
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get update" do
|
26
|
+
get :update
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
test "should get show" do
|
31
|
+
get :show
|
32
|
+
assert_response :success
|
33
|
+
end
|
34
|
+
|
35
|
+
test "should get destroy" do
|
36
|
+
get :destroy
|
37
|
+
assert_response :success
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class ForumsControllerTest < ActionController::TestCase
|
5
|
+
test "should get index" do
|
6
|
+
get :index
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get show" do
|
11
|
+
get :show
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module MongoidForums
|
4
|
+
class PostsControllerTest < ActionController::TestCase
|
5
|
+
test "should get new" do
|
6
|
+
get :new
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get create" do
|
11
|
+
get :create
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get show" do
|
16
|
+
get :show
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get edit" do
|
21
|
+
get :edit
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get update" do
|
26
|
+
get :update
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
test "should get destroy" do
|
31
|
+
get :destroy
|
32
|
+
assert_response :success
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|