neifelheim-forem 0.0.1 → 0.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 (56) hide show
  1. data/lib/forem/version.rb +1 -1
  2. data/spec/configuration_spec.rb +12 -0
  3. data/spec/controllers/forem/posts_controller_spec.rb +7 -0
  4. data/spec/controllers/forem/topics_controller_spec.rb +7 -0
  5. data/spec/dummy/README.rdoc +261 -0
  6. data/spec/dummy/Rakefile +7 -0
  7. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  8. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  9. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  10. data/spec/dummy/app/controllers/fake_controller.rb +5 -0
  11. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  12. data/spec/dummy/app/models/user.rb +6 -0
  13. data/spec/dummy/app/views/layouts/application.html.erb +17 -0
  14. data/spec/dummy/config/application.rb +59 -0
  15. data/spec/dummy/config/boot.rb +10 -0
  16. data/spec/dummy/config/database.yml +25 -0
  17. data/spec/dummy/config/environment.rb +5 -0
  18. data/spec/dummy/config/environments/development.rb +37 -0
  19. data/spec/dummy/config/environments/production.rb +67 -0
  20. data/spec/dummy/config/environments/test.rb +37 -0
  21. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  22. data/spec/dummy/config/initializers/forem.rb +1 -0
  23. data/spec/dummy/config/initializers/inflections.rb +15 -0
  24. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  25. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  26. data/spec/dummy/config/initializers/session_store.rb +8 -0
  27. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  28. data/spec/dummy/config/locales/en.yml +5 -0
  29. data/spec/dummy/config/routes.rb +5 -0
  30. data/spec/dummy/config.ru +4 -0
  31. data/spec/dummy/db/development.sqlite3 +0 -0
  32. data/spec/dummy/db/migrate/20130624063712_create_users.rb +9 -0
  33. data/spec/dummy/db/schema.rb +38 -0
  34. data/spec/dummy/db/test.sqlite3 +0 -0
  35. data/spec/dummy/log/development.log +130 -0
  36. data/spec/dummy/log/test.log +3877 -0
  37. data/spec/dummy/public/404.html +26 -0
  38. data/spec/dummy/public/422.html +26 -0
  39. data/spec/dummy/public/500.html +25 -0
  40. data/spec/dummy/public/favicon.ico +0 -0
  41. data/spec/dummy/script/rails +6 -0
  42. data/spec/dummy/spec/models/user_spec.rb +5 -0
  43. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  44. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  45. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  46. data/spec/helpers/forem/posts_helper_spec.rb +17 -0
  47. data/spec/helpers/forem/topics_helper_spec.rb +17 -0
  48. data/spec/integration/posts_spec.rb +59 -0
  49. data/spec/integration/topics_spec.rb +43 -0
  50. data/spec/models/forem/post_spec.rb +7 -0
  51. data/spec/models/forem/topic_spec.rb +7 -0
  52. data/spec/spec_helper.rb +21 -0
  53. data/spec/support/capybara.rb +8 -0
  54. data/spec/support/dummy_login.rb +18 -0
  55. data/spec/support/load_routes.rb +7 -0
  56. metadata +112 -4
@@ -0,0 +1,26 @@
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>
@@ -0,0 +1,26 @@
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>
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,6 @@
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'
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe User do
4
+ pending "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ # Specs in this file have access to a helper object that includes
4
+ # the PostsHelper. For example:
5
+ #
6
+ # describe PostsHelper do
7
+ # describe "string concat" do
8
+ # it "concats two strings with spaces" do
9
+ # helper.concat_strings("this","that").should == "this that"
10
+ # end
11
+ # end
12
+ # end
13
+ module Forem
14
+ describe PostsHelper do
15
+ pending "add some examples to (or delete) #{__FILE__}"
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ # Specs in this file have access to a helper object that includes
4
+ # the TopicsHelper. For example:
5
+ #
6
+ # describe TopicsHelper do
7
+ # describe "string concat" do
8
+ # it "concats two strings with spaces" do
9
+ # helper.concat_strings("this","that").should == "this that"
10
+ # end
11
+ # end
12
+ # end
13
+ module Forem
14
+ describe TopicsHelper do
15
+ pending "add some examples to (or delete) #{__FILE__}"
16
+ end
17
+ end
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+ describe "posts" do
3
+ before do
4
+ @user = User.create(:login => "some_guy")
5
+ @topic = Forem::Topic.new(:subject => "First topic!", :user => @user)
6
+ @topic.posts.build(:text => "First post!")
7
+ @topic.save!
8
+ end
9
+
10
+ context "unauthenticated users" do
11
+ before do
12
+ sign_out!
13
+ end
14
+
15
+ it "cannot access the new action" do
16
+ visit new_topic_post_path(@topic)
17
+ page.current_url.should eql(sign_in_url)
18
+ end
19
+
20
+ it "should see the post count and last post details" do
21
+ visit topics_path
22
+ within "#topics tbody td#posts_count" do
23
+ page.should have_content("1")
24
+ end
25
+ within "#topics tbody td#last_post" do
26
+ page.should have_content("last post was less than a minute ago by some_guy")
27
+ end
28
+ end
29
+ end
30
+
31
+ context "authenticated users" do
32
+ before do
33
+ sign_in!
34
+ end
35
+
36
+ it "reply to a topic" do
37
+ visit topics_path
38
+ click_link "First topic!"
39
+ within ".forem_topic #posts .forem_post" do
40
+ click_link "Reply"
41
+ end
42
+ fill_in "Text", :with => "First reply!"
43
+ click_button "Create Post"
44
+ within "#flash_notice" do
45
+ page.should have_content("Post has been created!")
46
+ end
47
+ within ".forem_topic #posts .forem_post:last" do
48
+ page.should have_content("First reply!")
49
+ end
50
+
51
+ within ".forem_topic #posts .forem_post:last .user" do
52
+ page.should have_content("forem_user")
53
+ end
54
+
55
+ end
56
+ end
57
+
58
+ end
59
+
@@ -0,0 +1,43 @@
1
+ require "spec_helper"
2
+
3
+ describe "topics" do
4
+
5
+ context "authenticated users" do
6
+ before do
7
+ sign_in!
8
+ end
9
+ it "creating a new one" do
10
+ sign_in!
11
+ visit topics_path
12
+ click_link "New Topic"
13
+ fill_in "Subject", :with => "First topic!"
14
+ fill_in "Text", :with => "First post!"
15
+ click_button "Create Topic"
16
+ within "#flash_notice" do
17
+ page.should have_content("Topic has been created!")
18
+ end
19
+ within ".forem_topic" do
20
+ page.should have_content("First post!")
21
+ end
22
+ within ".forem_topic #posts .forem_post .user" do
23
+ page.should have_content("forem_user")
24
+ end
25
+ end
26
+ end
27
+
28
+ context "unauthenticated users" do
29
+ before do
30
+ #Forem::Engine.user_class = User
31
+ sign_out!
32
+ end
33
+ it "cannot see the 'New Topic' link" do
34
+ visit topics_path
35
+ page.should_not have_content("New Topic")
36
+ end
37
+ it "cannot begin to create a new topic" do
38
+ visit new_topic_path
39
+ page.current_url.should eql(sign_in_url)
40
+ end
41
+ end
42
+ end
43
+
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ module Forem
4
+ describe Post do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ module Forem
4
+ describe Topic do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rspec/rails"
6
+ require "capybara/rspec"
7
+
8
+ Rails.backtrace_cleaner.remove_silencers!
9
+
10
+ # Load support files
11
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
12
+
13
+ # Load fixtures from the engine
14
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
15
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
16
+ end
17
+
18
+ RSpec.configure do |config|
19
+ config.use_transactional_fixtures = true
20
+ end
21
+
@@ -0,0 +1,8 @@
1
+ require "capybara/rails"
2
+ require "capybara/dsl"
3
+
4
+ RSpec.configure do |c|
5
+ c.include Capybara, :example_group => {
6
+ :file_path => /\bspec\/integration\//
7
+ }
8
+ end
@@ -0,0 +1,18 @@
1
+ def sign_out!
2
+ ApplicationController.class_eval <<-STRING
3
+ def current_user
4
+ nil
5
+ end
6
+ helper_method :current_user
7
+ STRING
8
+ end
9
+
10
+ def sign_in!(options={})
11
+ ApplicationController.class_eval <<-STRING
12
+ def current_user
13
+ User.find_or_create_by_login("forem_user")
14
+ end
15
+ helper_method :current_user
16
+ STRING
17
+ end
18
+
@@ -0,0 +1,7 @@
1
+ RSpec.configure do |c|
2
+ c.include Forem::Engine.routes.url_helpers,
3
+ :example_group => {
4
+ :file_path => /\bspec\/integration\//
5
+ }
6
+ end
7
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neifelheim-forem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -114,6 +114,60 @@ files:
114
114
  - MIT-LICENSE
115
115
  - Rakefile
116
116
  - README.rdoc
117
+ - spec/integration/topics_spec.rb
118
+ - spec/integration/posts_spec.rb
119
+ - spec/helpers/forem/topics_helper_spec.rb
120
+ - spec/helpers/forem/posts_helper_spec.rb
121
+ - spec/controllers/forem/posts_controller_spec.rb
122
+ - spec/controllers/forem/topics_controller_spec.rb
123
+ - spec/spec_helper.rb
124
+ - spec/models/forem/topic_spec.rb
125
+ - spec/models/forem/post_spec.rb
126
+ - spec/dummy/script/rails
127
+ - spec/dummy/spec/models/user_spec.rb
128
+ - spec/dummy/db/test.sqlite3
129
+ - spec/dummy/db/development.sqlite3
130
+ - spec/dummy/db/migrate/20130624063712_create_users.rb
131
+ - spec/dummy/db/schema.rb
132
+ - spec/dummy/config/environment.rb
133
+ - spec/dummy/config/environments/development.rb
134
+ - spec/dummy/config/environments/production.rb
135
+ - spec/dummy/config/environments/test.rb
136
+ - spec/dummy/config/routes.rb
137
+ - spec/dummy/config/initializers/inflections.rb
138
+ - spec/dummy/config/initializers/forem.rb
139
+ - spec/dummy/config/initializers/backtrace_silencers.rb
140
+ - spec/dummy/config/initializers/secret_token.rb
141
+ - spec/dummy/config/initializers/wrap_parameters.rb
142
+ - spec/dummy/config/initializers/session_store.rb
143
+ - spec/dummy/config/initializers/mime_types.rb
144
+ - spec/dummy/config/application.rb
145
+ - spec/dummy/config/database.yml
146
+ - spec/dummy/config/boot.rb
147
+ - spec/dummy/config/locales/en.yml
148
+ - spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
149
+ - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
150
+ - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
151
+ - spec/dummy/log/test.log
152
+ - spec/dummy/log/development.log
153
+ - spec/dummy/README.rdoc
154
+ - spec/dummy/config.ru
155
+ - spec/dummy/app/helpers/application_helper.rb
156
+ - spec/dummy/app/controllers/application_controller.rb
157
+ - spec/dummy/app/controllers/fake_controller.rb
158
+ - spec/dummy/app/models/user.rb
159
+ - spec/dummy/app/views/layouts/application.html.erb
160
+ - spec/dummy/app/assets/javascripts/application.js
161
+ - spec/dummy/app/assets/stylesheets/application.css
162
+ - spec/dummy/public/favicon.ico
163
+ - spec/dummy/public/404.html
164
+ - spec/dummy/public/422.html
165
+ - spec/dummy/public/500.html
166
+ - spec/dummy/Rakefile
167
+ - spec/configuration_spec.rb
168
+ - spec/support/load_routes.rb
169
+ - spec/support/dummy_login.rb
170
+ - spec/support/capybara.rb
117
171
  homepage: https://github.com/neifelheim/forem
118
172
  licenses: []
119
173
  post_install_message:
@@ -128,7 +182,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
182
  version: '0'
129
183
  segments:
130
184
  - 0
131
- hash: 3193519319419979371
185
+ hash: -20439854857409484
132
186
  required_rubygems_version: !ruby/object:Gem::Requirement
133
187
  none: false
134
188
  requirements:
@@ -137,11 +191,65 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
191
  version: '0'
138
192
  segments:
139
193
  - 0
140
- hash: 3193519319419979371
194
+ hash: -20439854857409484
141
195
  requirements: []
142
196
  rubyforge_project:
143
197
  rubygems_version: 1.8.25
144
198
  signing_key:
145
199
  specification_version: 3
146
200
  summary: The best Rails 3 forum engine in the world.
147
- test_files: []
201
+ test_files:
202
+ - spec/integration/topics_spec.rb
203
+ - spec/integration/posts_spec.rb
204
+ - spec/helpers/forem/topics_helper_spec.rb
205
+ - spec/helpers/forem/posts_helper_spec.rb
206
+ - spec/controllers/forem/posts_controller_spec.rb
207
+ - spec/controllers/forem/topics_controller_spec.rb
208
+ - spec/spec_helper.rb
209
+ - spec/models/forem/topic_spec.rb
210
+ - spec/models/forem/post_spec.rb
211
+ - spec/dummy/script/rails
212
+ - spec/dummy/spec/models/user_spec.rb
213
+ - spec/dummy/db/test.sqlite3
214
+ - spec/dummy/db/development.sqlite3
215
+ - spec/dummy/db/migrate/20130624063712_create_users.rb
216
+ - spec/dummy/db/schema.rb
217
+ - spec/dummy/config/environment.rb
218
+ - spec/dummy/config/environments/development.rb
219
+ - spec/dummy/config/environments/production.rb
220
+ - spec/dummy/config/environments/test.rb
221
+ - spec/dummy/config/routes.rb
222
+ - spec/dummy/config/initializers/inflections.rb
223
+ - spec/dummy/config/initializers/forem.rb
224
+ - spec/dummy/config/initializers/backtrace_silencers.rb
225
+ - spec/dummy/config/initializers/secret_token.rb
226
+ - spec/dummy/config/initializers/wrap_parameters.rb
227
+ - spec/dummy/config/initializers/session_store.rb
228
+ - spec/dummy/config/initializers/mime_types.rb
229
+ - spec/dummy/config/application.rb
230
+ - spec/dummy/config/database.yml
231
+ - spec/dummy/config/boot.rb
232
+ - spec/dummy/config/locales/en.yml
233
+ - spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
234
+ - spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
235
+ - spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
236
+ - spec/dummy/log/test.log
237
+ - spec/dummy/log/development.log
238
+ - spec/dummy/README.rdoc
239
+ - spec/dummy/config.ru
240
+ - spec/dummy/app/helpers/application_helper.rb
241
+ - spec/dummy/app/controllers/application_controller.rb
242
+ - spec/dummy/app/controllers/fake_controller.rb
243
+ - spec/dummy/app/models/user.rb
244
+ - spec/dummy/app/views/layouts/application.html.erb
245
+ - spec/dummy/app/assets/javascripts/application.js
246
+ - spec/dummy/app/assets/stylesheets/application.css
247
+ - spec/dummy/public/favicon.ico
248
+ - spec/dummy/public/404.html
249
+ - spec/dummy/public/422.html
250
+ - spec/dummy/public/500.html
251
+ - spec/dummy/Rakefile
252
+ - spec/configuration_spec.rb
253
+ - spec/support/load_routes.rb
254
+ - spec/support/dummy_login.rb
255
+ - spec/support/capybara.rb