ack-mongoid-forums 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/mongoid_forums/admin/base.js +2 -0
  5. data/app/assets/javascripts/mongoid_forums/admin/categories.js +2 -0
  6. data/app/assets/javascripts/mongoid_forums/admin/forums.js +2 -0
  7. data/app/assets/javascripts/mongoid_forums/admin/groups.js +2 -0
  8. data/app/assets/javascripts/mongoid_forums/admin/users.js +2 -0
  9. data/app/assets/javascripts/mongoid_forums/application.js +15 -0
  10. data/app/assets/javascripts/mongoid_forums/forums.js +2 -0
  11. data/app/assets/javascripts/mongoid_forums/posts.js +2 -0
  12. data/app/assets/javascripts/mongoid_forums/topics.js +2 -0
  13. data/app/assets/stylesheets/mongoid_forums/admin/base.css +4 -0
  14. data/app/assets/stylesheets/mongoid_forums/admin/categories.css +4 -0
  15. data/app/assets/stylesheets/mongoid_forums/admin/forums.css +4 -0
  16. data/app/assets/stylesheets/mongoid_forums/admin/groups.css +4 -0
  17. data/app/assets/stylesheets/mongoid_forums/admin/users.css +4 -0
  18. data/app/assets/stylesheets/mongoid_forums/application.css +15 -0
  19. data/app/assets/stylesheets/mongoid_forums/forums.css +4 -0
  20. data/app/assets/stylesheets/mongoid_forums/posts.css +4 -0
  21. data/app/assets/stylesheets/mongoid_forums/topics.css +4 -0
  22. data/app/assets/stylesheets/scaffold.css +56 -0
  23. data/app/controllers/mongoid_forums/admin/base_controller.rb +18 -0
  24. data/app/controllers/mongoid_forums/admin/categories_controller.rb +83 -0
  25. data/app/controllers/mongoid_forums/admin/forums_controller.rb +83 -0
  26. data/app/controllers/mongoid_forums/admin/groups_controller.rb +83 -0
  27. data/app/controllers/mongoid_forums/admin/topics_controller.rb +48 -0
  28. data/app/controllers/mongoid_forums/admin/users_controller.rb +34 -0
  29. data/app/controllers/mongoid_forums/application_controller.rb +57 -0
  30. data/app/controllers/mongoid_forums/forums_controller.rb +66 -0
  31. data/app/controllers/mongoid_forums/posts_controller.rb +133 -0
  32. data/app/controllers/mongoid_forums/redirect_controller.rb +33 -0
  33. data/app/controllers/mongoid_forums/topics_controller.rb +83 -0
  34. data/app/decorators/lib/mongoid_forums/user_class_decorator.rb +1 -0
  35. data/app/helpers/mongoid_forums/admin/base_helper.rb +4 -0
  36. data/app/helpers/mongoid_forums/admin/categories_helper.rb +4 -0
  37. data/app/helpers/mongoid_forums/admin/forums_helper.rb +4 -0
  38. data/app/helpers/mongoid_forums/admin/groups_helper.rb +4 -0
  39. data/app/helpers/mongoid_forums/admin/users_helper.rb +4 -0
  40. data/app/helpers/mongoid_forums/application_helper.rb +20 -0
  41. data/app/helpers/mongoid_forums/formatting_helper.rb +28 -0
  42. data/app/helpers/mongoid_forums/forums_helper.rb +15 -0
  43. data/app/helpers/mongoid_forums/posts_helper.rb +4 -0
  44. data/app/helpers/mongoid_forums/topics_helper.rb +4 -0
  45. data/app/models/mongoid_forums/ability.rb +65 -0
  46. data/app/models/mongoid_forums/alert.rb +80 -0
  47. data/app/models/mongoid_forums/category.rb +31 -0
  48. data/app/models/mongoid_forums/concerns/subscribable.rb +76 -0
  49. data/app/models/mongoid_forums/concerns/viewable.rb +60 -0
  50. data/app/models/mongoid_forums/forum.rb +67 -0
  51. data/app/models/mongoid_forums/group.rb +15 -0
  52. data/app/models/mongoid_forums/post.rb +40 -0
  53. data/app/models/mongoid_forums/subscription.rb +65 -0
  54. data/app/models/mongoid_forums/topic.rb +55 -0
  55. data/app/models/mongoid_forums/view.rb +30 -0
  56. data/app/views/layouts/mongoid_forums/application.haml +21 -0
  57. data/app/views/mongoid_forums/admin/base/index.haml +6 -0
  58. data/app/views/mongoid_forums/admin/categories/edit.haml +4 -0
  59. data/app/views/mongoid_forums/admin/categories/index.haml +21 -0
  60. data/app/views/mongoid_forums/admin/categories/new.haml +4 -0
  61. data/app/views/mongoid_forums/admin/categories/show.haml +21 -0
  62. data/app/views/mongoid_forums/admin/forums/edit.haml +5 -0
  63. data/app/views/mongoid_forums/admin/forums/index.haml +25 -0
  64. data/app/views/mongoid_forums/admin/forums/new.haml +5 -0
  65. data/app/views/mongoid_forums/admin/forums/show.haml +21 -0
  66. data/app/views/mongoid_forums/admin/groups/edit.haml +4 -0
  67. data/app/views/mongoid_forums/admin/groups/index.haml +23 -0
  68. data/app/views/mongoid_forums/admin/groups/new.haml +5 -0
  69. data/app/views/mongoid_forums/admin/groups/show.haml +26 -0
  70. data/app/views/mongoid_forums/admin/users/index.haml +24 -0
  71. data/app/views/mongoid_forums/forums/index.haml +46 -0
  72. data/app/views/mongoid_forums/forums/new.haml +15 -0
  73. data/app/views/mongoid_forums/forums/show.haml +47 -0
  74. data/app/views/mongoid_forums/posts/_form.haml +4 -0
  75. data/app/views/mongoid_forums/posts/_post.haml +24 -0
  76. data/app/views/mongoid_forums/posts/_quoted.haml +9 -0
  77. data/app/views/mongoid_forums/posts/edit.haml +17 -0
  78. data/app/views/mongoid_forums/posts/new.haml +17 -0
  79. data/app/views/mongoid_forums/topics/_topic.haml +2 -0
  80. data/app/views/mongoid_forums/topics/my_posts.haml +6 -0
  81. data/app/views/mongoid_forums/topics/my_subscriptions.haml +5 -0
  82. data/app/views/mongoid_forums/topics/my_topics.haml +6 -0
  83. data/app/views/mongoid_forums/topics/show.haml +16 -0
  84. data/config/locales/en.yml +196 -0
  85. data/config/routes.rb +62 -0
  86. data/lib/ack_mongoid_forums.rb +1 -0
  87. data/lib/generators/mongoid_forums/install/templates/initializer.rb +5 -0
  88. data/lib/generators/mongoid_forums/install_generator.rb +90 -0
  89. data/lib/generators/mongoid_forums/views_generator.rb +27 -0
  90. data/lib/mongoid_forums.rb +53 -0
  91. data/lib/mongoid_forums/default_permissions.rb +63 -0
  92. data/lib/mongoid_forums/engine.rb +20 -0
  93. data/lib/mongoid_forums/sanitizer.rb +10 -0
  94. data/lib/mongoid_forums/version.rb +3 -0
  95. data/lib/tasks/mongoid_forums_tasks.rake +4 -0
  96. data/test/controllers/mongoid_forums/admin/base_controller_test.rb +11 -0
  97. data/test/controllers/mongoid_forums/admin/categories_controller_test.rb +31 -0
  98. data/test/controllers/mongoid_forums/admin/forums_controller_test.rb +31 -0
  99. data/test/controllers/mongoid_forums/admin/groups_controller_test.rb +41 -0
  100. data/test/controllers/mongoid_forums/admin/users_controller_test.rb +11 -0
  101. data/test/controllers/mongoid_forums/forums_controller_test.rb +16 -0
  102. data/test/controllers/mongoid_forums/posts_controller_test.rb +36 -0
  103. data/test/controllers/mongoid_forums/topics_controller_test.rb +36 -0
  104. data/test/dummy/README.rdoc +28 -0
  105. data/test/dummy/Rakefile +6 -0
  106. data/test/dummy/app/assets/javascripts/application.js +15 -0
  107. data/test/dummy/app/assets/javascripts/welcome.js +2 -0
  108. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  109. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  110. data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
  111. data/test/dummy/app/controllers/application_controller.rb +11 -0
  112. data/test/dummy/app/controllers/welcome_controller.rb +4 -0
  113. data/test/dummy/app/helpers/application_helper.rb +2 -0
  114. data/test/dummy/app/helpers/welcome_helper.rb +2 -0
  115. data/test/dummy/app/models/concerns/zero_oid_fix.rb +10 -0
  116. data/test/dummy/app/models/user.rb +43 -0
  117. data/test/dummy/app/views/layouts/application.haml +13 -0
  118. data/test/dummy/app/views/partials/_nav.haml +6 -0
  119. data/test/dummy/app/views/welcome/index.html.erb +2 -0
  120. data/test/dummy/bin/bundle +3 -0
  121. data/test/dummy/bin/rails +4 -0
  122. data/test/dummy/bin/rake +4 -0
  123. data/test/dummy/bin/setup +29 -0
  124. data/test/dummy/config.ru +4 -0
  125. data/test/dummy/config/application.rb +29 -0
  126. data/test/dummy/config/boot.rb +5 -0
  127. data/test/dummy/config/environment.rb +5 -0
  128. data/test/dummy/config/environments/development.rb +41 -0
  129. data/test/dummy/config/environments/production.rb +76 -0
  130. data/test/dummy/config/environments/test.rb +42 -0
  131. data/test/dummy/config/initializers/assets.rb +11 -0
  132. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  133. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  134. data/test/dummy/config/initializers/devise.rb +259 -0
  135. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  136. data/test/dummy/config/initializers/inflections.rb +16 -0
  137. data/test/dummy/config/initializers/kaminari_config.rb +10 -0
  138. data/test/dummy/config/initializers/mime_types.rb +4 -0
  139. data/test/dummy/config/initializers/mongoid_forums.rb +5 -0
  140. data/test/dummy/config/initializers/session_store.rb +3 -0
  141. data/test/dummy/config/initializers/simple_form.rb +166 -0
  142. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  143. data/test/dummy/config/locales/devise.en.yml +60 -0
  144. data/test/dummy/config/locales/en.yml +23 -0
  145. data/test/dummy/config/locales/simple_form.en.yml +31 -0
  146. data/test/dummy/config/mongoid.yml +69 -0
  147. data/test/dummy/config/routes.rb +7 -0
  148. data/test/dummy/config/secrets.yml +22 -0
  149. data/test/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  150. data/test/dummy/public/404.html +67 -0
  151. data/test/dummy/public/422.html +67 -0
  152. data/test/dummy/public/500.html +66 -0
  153. data/test/dummy/public/favicon.ico +0 -0
  154. data/test/dummy/test/controllers/welcome_controller_test.rb +9 -0
  155. data/test/dummy/test/fixtures/users.yml +11 -0
  156. data/test/dummy/test/models/user_test.rb +7 -0
  157. data/test/fixtures/mongoid_forums/categories.yml +11 -0
  158. data/test/fixtures/mongoid_forums/forums.yml +11 -0
  159. data/test/fixtures/mongoid_forums/posts.yml +11 -0
  160. data/test/fixtures/mongoid_forums/ranks.yml +11 -0
  161. data/test/fixtures/mongoid_forums/topics.yml +11 -0
  162. data/test/integration/navigation_test.rb +9 -0
  163. data/test/models/mongoid_forums/category_test.rb +9 -0
  164. data/test/models/mongoid_forums/forum_test.rb +9 -0
  165. data/test/models/mongoid_forums/post_test.rb +9 -0
  166. data/test/models/mongoid_forums/rank_test.rb +9 -0
  167. data/test/models/mongoid_forums/topic_test.rb +9 -0
  168. data/test/mongoid_forums_test.rb +7 -0
  169. data/test/test_helper.rb +17 -0
  170. 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,10 @@
1
+ require 'sanitize'
2
+
3
+ # This is exists so formatters can access it if it so pleases them.
4
+ module MongoidForums
5
+ class Sanitizer
6
+ def self.sanitize(text)
7
+ Sanitize.clean(text, Sanitize::Config::BASIC)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module MongoidForums
2
+ VERSION = "1.0.5"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :mongoid_forums do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+
3
+ module MongoidForums
4
+ class Admin::BaseControllerTest < ActionController::TestCase
5
+ test "should get index" do
6
+ get :index
7
+ assert_response :success
8
+ end
9
+
10
+ end
11
+ 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,11 @@
1
+ require 'test_helper'
2
+
3
+ module MongoidForums
4
+ class Admin::UsersControllerTest < ActionController::TestCase
5
+ test "should get index" do
6
+ get :index
7
+ assert_response :success
8
+ end
9
+
10
+ end
11
+ 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