draper_new 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +15 -0
  5. data/.yardopts +1 -0
  6. data/CHANGELOG.md +230 -0
  7. data/CONTRIBUTING.md +20 -0
  8. data/Gemfile +16 -0
  9. data/Guardfile +26 -0
  10. data/LICENSE +7 -0
  11. data/README.md +587 -0
  12. data/Rakefile +69 -0
  13. data/draper_new.gemspec +31 -0
  14. data/gemfiles/4.0.gemfile +3 -0
  15. data/gemfiles/4.1.gemfile +3 -0
  16. data/gemfiles/4.2.6.gemfile +3 -0
  17. data/gemfiles/4.2.gemfile +3 -0
  18. data/lib/draper.rb +63 -0
  19. data/lib/draper/automatic_delegation.rb +56 -0
  20. data/lib/draper/collection_decorator.rb +100 -0
  21. data/lib/draper/decoratable.rb +96 -0
  22. data/lib/draper/decoratable/equality.rb +26 -0
  23. data/lib/draper/decorated_association.rb +35 -0
  24. data/lib/draper/decorates_assigned.rb +44 -0
  25. data/lib/draper/decorator.rb +293 -0
  26. data/lib/draper/delegation.rb +13 -0
  27. data/lib/draper/factory.rb +91 -0
  28. data/lib/draper/finders.rb +37 -0
  29. data/lib/draper/helper_proxy.rb +44 -0
  30. data/lib/draper/helper_support.rb +5 -0
  31. data/lib/draper/lazy_helpers.rb +15 -0
  32. data/lib/draper/railtie.rb +70 -0
  33. data/lib/draper/tasks/test.rake +22 -0
  34. data/lib/draper/test/devise_helper.rb +30 -0
  35. data/lib/draper/test/minitest_integration.rb +6 -0
  36. data/lib/draper/test/rspec_integration.rb +20 -0
  37. data/lib/draper/test_case.rb +42 -0
  38. data/lib/draper/undecorate.rb +9 -0
  39. data/lib/draper/version.rb +3 -0
  40. data/lib/draper/view_context.rb +104 -0
  41. data/lib/draper/view_context/build_strategy.rb +48 -0
  42. data/lib/draper/view_helpers.rb +37 -0
  43. data/lib/generators/controller_override.rb +17 -0
  44. data/lib/generators/mini_test/decorator_generator.rb +20 -0
  45. data/lib/generators/mini_test/templates/decorator_spec.rb +4 -0
  46. data/lib/generators/mini_test/templates/decorator_test.rb +4 -0
  47. data/lib/generators/rails/decorator_generator.rb +36 -0
  48. data/lib/generators/rails/templates/decorator.rb +19 -0
  49. data/lib/generators/rspec/decorator_generator.rb +9 -0
  50. data/lib/generators/rspec/templates/decorator_spec.rb +4 -0
  51. data/lib/generators/test_unit/decorator_generator.rb +9 -0
  52. data/lib/generators/test_unit/templates/decorator_test.rb +4 -0
  53. data/spec/draper/collection_decorator_spec.rb +307 -0
  54. data/spec/draper/decoratable/equality_spec.rb +10 -0
  55. data/spec/draper/decoratable_spec.rb +202 -0
  56. data/spec/draper/decorated_association_spec.rb +84 -0
  57. data/spec/draper/decorates_assigned_spec.rb +71 -0
  58. data/spec/draper/decorator_spec.rb +816 -0
  59. data/spec/draper/factory_spec.rb +251 -0
  60. data/spec/draper/finders_spec.rb +166 -0
  61. data/spec/draper/helper_proxy_spec.rb +61 -0
  62. data/spec/draper/lazy_helpers_spec.rb +21 -0
  63. data/spec/draper/undecorate_spec.rb +19 -0
  64. data/spec/draper/view_context/build_strategy_spec.rb +116 -0
  65. data/spec/draper/view_context_spec.rb +154 -0
  66. data/spec/draper/view_helpers_spec.rb +8 -0
  67. data/spec/dummy/.rspec +2 -0
  68. data/spec/dummy/Rakefile +7 -0
  69. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  70. data/spec/dummy/app/controllers/localized_urls.rb +5 -0
  71. data/spec/dummy/app/controllers/posts_controller.rb +20 -0
  72. data/spec/dummy/app/decorators/mongoid_post_decorator.rb +4 -0
  73. data/spec/dummy/app/decorators/post_decorator.rb +60 -0
  74. data/spec/dummy/app/helpers/application_helper.rb +5 -0
  75. data/spec/dummy/app/mailers/application_mailer.rb +3 -0
  76. data/spec/dummy/app/mailers/post_mailer.rb +19 -0
  77. data/spec/dummy/app/models/admin.rb +5 -0
  78. data/spec/dummy/app/models/mongoid_post.rb +5 -0
  79. data/spec/dummy/app/models/post.rb +3 -0
  80. data/spec/dummy/app/models/user.rb +5 -0
  81. data/spec/dummy/app/views/layouts/application.html.erb +11 -0
  82. data/spec/dummy/app/views/post_mailer/decorated_email.html.erb +1 -0
  83. data/spec/dummy/app/views/posts/_post.html.erb +40 -0
  84. data/spec/dummy/app/views/posts/show.html.erb +1 -0
  85. data/spec/dummy/bin/rails +4 -0
  86. data/spec/dummy/config.ru +4 -0
  87. data/spec/dummy/config/application.rb +71 -0
  88. data/spec/dummy/config/boot.rb +5 -0
  89. data/spec/dummy/config/database.yml +25 -0
  90. data/spec/dummy/config/environment.rb +5 -0
  91. data/spec/dummy/config/environments/development.rb +33 -0
  92. data/spec/dummy/config/environments/production.rb +57 -0
  93. data/spec/dummy/config/environments/test.rb +31 -0
  94. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  95. data/spec/dummy/config/initializers/inflections.rb +15 -0
  96. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  97. data/spec/dummy/config/initializers/secret_token.rb +8 -0
  98. data/spec/dummy/config/initializers/session_store.rb +8 -0
  99. data/spec/dummy/config/locales/en.yml +5 -0
  100. data/spec/dummy/config/mongoid.yml +79 -0
  101. data/spec/dummy/config/routes.rb +9 -0
  102. data/spec/dummy/db/migrate/20121019115657_create_posts.rb +8 -0
  103. data/spec/dummy/db/schema.rb +21 -0
  104. data/spec/dummy/db/seeds.rb +2 -0
  105. data/spec/dummy/fast_spec/post_decorator_spec.rb +37 -0
  106. data/spec/dummy/lib/tasks/test.rake +16 -0
  107. data/spec/dummy/public/404.html +26 -0
  108. data/spec/dummy/public/422.html +26 -0
  109. data/spec/dummy/public/500.html +25 -0
  110. data/spec/dummy/public/favicon.ico +0 -0
  111. data/spec/dummy/script/rails +6 -0
  112. data/spec/dummy/spec/decorators/active_model_serializers_spec.rb +16 -0
  113. data/spec/dummy/spec/decorators/devise_spec.rb +64 -0
  114. data/spec/dummy/spec/decorators/helpers_spec.rb +21 -0
  115. data/spec/dummy/spec/decorators/post_decorator_spec.rb +66 -0
  116. data/spec/dummy/spec/decorators/spec_type_spec.rb +7 -0
  117. data/spec/dummy/spec/decorators/view_context_spec.rb +22 -0
  118. data/spec/dummy/spec/mailers/post_mailer_spec.rb +33 -0
  119. data/spec/dummy/spec/models/mongoid_post_spec.rb +8 -0
  120. data/spec/dummy/spec/models/post_spec.rb +6 -0
  121. data/spec/dummy/spec/shared_examples/decoratable.rb +24 -0
  122. data/spec/dummy/spec/spec_helper.rb +8 -0
  123. data/spec/dummy/test/decorators/minitest/devise_test.rb +64 -0
  124. data/spec/dummy/test/decorators/minitest/helpers_test.rb +21 -0
  125. data/spec/dummy/test/decorators/minitest/spec_type_test.rb +52 -0
  126. data/spec/dummy/test/decorators/minitest/view_context_test.rb +24 -0
  127. data/spec/dummy/test/decorators/test_unit/devise_test.rb +64 -0
  128. data/spec/dummy/test/decorators/test_unit/helpers_test.rb +21 -0
  129. data/spec/dummy/test/decorators/test_unit/view_context_test.rb +24 -0
  130. data/spec/dummy/test/minitest_helper.rb +2 -0
  131. data/spec/dummy/test/test_helper.rb +3 -0
  132. data/spec/generators/controller/controller_generator_spec.rb +22 -0
  133. data/spec/generators/decorator/decorator_generator_spec.rb +92 -0
  134. data/spec/integration/integration_spec.rb +66 -0
  135. data/spec/performance/active_record.rb +4 -0
  136. data/spec/performance/benchmark.rb +55 -0
  137. data/spec/performance/decorators.rb +45 -0
  138. data/spec/performance/models.rb +20 -0
  139. data/spec/spec_helper.rb +41 -0
  140. data/spec/support/dummy_app.rb +85 -0
  141. data/spec/support/matchers/have_text.rb +50 -0
  142. data/spec/support/shared_examples/decoratable_equality.rb +40 -0
  143. data/spec/support/shared_examples/view_helpers.rb +39 -0
  144. metadata +420 -0
@@ -0,0 +1,9 @@
1
+ Dummy::Application.routes.draw do
2
+ scope "(:locale)", locale: /en|zh/ do
3
+ resources :posts, only: [:show] do
4
+ get "mail", on: :member
5
+ end
6
+ end
7
+
8
+ devise_for :users, :admins if defined?(Devise)
9
+ end
@@ -0,0 +1,8 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,2 @@
1
+ Post.delete_all
2
+ Post.create id: 1
@@ -0,0 +1,37 @@
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 "&lt;script&gt;danger&lt;/script&gt;"
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
36
+ end
37
+ end
@@ -0,0 +1,16 @@
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]
@@ -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,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe Draper::CollectionDecorator do
4
+ describe "#active_model_serializer" do
5
+ it "returns ActiveModel::ArraySerializer" do
6
+ collection_decorator = Draper::CollectionDecorator.new([])
7
+ if defined?(ActiveModel::ArraySerializerSupport)
8
+ collection_serializer = collection_decorator.active_model_serializer
9
+ else
10
+ collection_serializer = ActiveModel::Serializer.serializer_for(collection_decorator)
11
+ end
12
+
13
+ expect(collection_serializer).to be ActiveModel::ArraySerializer
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,64 @@
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
+
55
+ it "is backwards-compatible" do
56
+ user = double("User")
57
+ ActiveSupport::Deprecation.silence do
58
+ sign_in user
59
+ end
60
+
61
+ expect(helper.current_user).to be user
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe "A decorator spec" do
4
+ it "can access helpers through `helper`" do
5
+ expect(helper.content_tag(:p, "Help!")).to eq "<p>Help!</p>"
6
+ end
7
+
8
+ it "can access helpers through `helpers`" do
9
+ expect(helpers.content_tag(:p, "Help!")).to eq "<p>Help!</p>"
10
+ end
11
+
12
+ it "can access helpers through `h`" do
13
+ expect(h.content_tag(:p, "Help!")).to eq "<p>Help!</p>"
14
+ end
15
+
16
+ it "gets the same helper object as a decorator" do
17
+ decorator = Draper::Decorator.new(Object.new)
18
+
19
+ expect(helpers).to be decorator.helpers
20
+ end
21
+ end
@@ -0,0 +1,66 @@
1
+ require 'spec_helper'
2
+
3
+ describe PostDecorator do
4
+ let(:decorator) { PostDecorator.new(object) }
5
+ let(:object) { Post.create }
6
+
7
+ it "can use built-in helpers" do
8
+ expect(decorator.truncated).to eq "Once upon a..."
9
+ end
10
+
11
+ it "can use built-in private helpers" do
12
+ expect(decorator.html_escaped).to eq "&lt;script&gt;danger&lt;/script&gt;"
13
+ end
14
+
15
+ it "can use user-defined helpers from app/helpers" do
16
+ expect(decorator.hello_world).to eq "Hello, world!"
17
+ end
18
+
19
+ it "can be passed to path helpers" do
20
+ expect(helpers.post_path(decorator)).to eq "/en/posts/#{object.id}"
21
+ end
22
+
23
+ it "can use path helpers with its model" do
24
+ expect(decorator.path_with_model).to eq "/en/posts/#{object.id}"
25
+ end
26
+
27
+ it "can use path helpers with its id" do
28
+ expect(decorator.path_with_id).to eq "/en/posts/#{object.id}"
29
+ end
30
+
31
+ it "can be passed to url helpers" do
32
+ expect(helpers.post_url(decorator)).to eq "http://www.example.com:12345/en/posts/#{object.id}"
33
+ end
34
+
35
+ it "can use url helpers with its model" do
36
+ expect(decorator.url_with_model).to eq "http://www.example.com:12345/en/posts/#{object.id}"
37
+ end
38
+
39
+ it "can use url helpers with its id" do
40
+ expect(decorator.url_with_id).to eq "http://www.example.com:12345/en/posts/#{object.id}"
41
+ end
42
+
43
+ it "can be passed implicitly to url_for" do
44
+ expect(decorator.link).to eq "<a href=\"/en/posts/#{object.id}\">#{object.id}</a>"
45
+ end
46
+
47
+ it "serializes overriden attributes" do
48
+ expect(decorator.serializable_hash["updated_at"]).to be :overridden
49
+ end
50
+
51
+ it "serializes to JSON" do
52
+ json = decorator.to_json
53
+ expect(json).to match /"updated_at":"overridden"/
54
+ end
55
+
56
+ it "serializes to XML" do
57
+ pending("Rails < 3.2 does not use `serializable_hash` in `to_xml`") if Rails.version.to_f < 3.2
58
+
59
+ xml = Capybara.string(decorator.to_xml)
60
+ expect(xml).to have_css "post > updated-at", text: "overridden"
61
+ end
62
+
63
+ it "uses a test view context from ApplicationController" do
64
+ expect(Draper::ViewContext.current.controller).to be_an ApplicationController
65
+ end
66
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe "A spec in this folder" do
4
+ it "is a decorator spec" do
5
+ expect(RSpec.current_example.metadata[:type]).to be :decorator
6
+ end
7
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ def it_does_not_leak_view_context
4
+ 2.times do
5
+ it "has an independent view context" do
6
+ expect(Draper::ViewContext.current).not_to be :leaked
7
+ Draper::ViewContext.current = :leaked
8
+ end
9
+ end
10
+ end
11
+
12
+ describe "A decorator spec", type: :decorator do
13
+ it_does_not_leak_view_context
14
+ end
15
+
16
+ describe "A controller spec", type: :controller do
17
+ it_does_not_leak_view_context
18
+ end
19
+
20
+ describe "A mailer spec", type: :mailer do
21
+ it_does_not_leak_view_context
22
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe PostMailer do
4
+ describe "#decorated_email" do
5
+ let(:email_body) { Capybara.string(email.body.to_s) }
6
+ let(:email) { PostMailer.decorated_email(post).deliver }
7
+ let(:post) { Post.create }
8
+
9
+ it "decorates" do
10
+ expect(email_body).to have_content "Today"
11
+ end
12
+
13
+ it "can use path helpers with a model" do
14
+ expect(email_body).to have_css "#path_with_model", text: "/en/posts/#{post.id}"
15
+ end
16
+
17
+ it "can use path helpers with an id" do
18
+ expect(email_body).to have_css "#path_with_id", text: "/en/posts/#{post.id}"
19
+ end
20
+
21
+ it "can use url helpers with a model" do
22
+ expect(email_body).to have_css "#url_with_model", text: "http://www.example.com:12345/en/posts/#{post.id}"
23
+ end
24
+
25
+ it "can use url helpers with an id" do
26
+ expect(email_body).to have_css "#url_with_id", text: "http://www.example.com:12345/en/posts/#{post.id}"
27
+ end
28
+
29
+ it "uses the correct view context controller" do
30
+ expect(email_body).to have_css "#controller", text: "PostMailer"
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'shared_examples/decoratable'
3
+
4
+ if defined?(Mongoid)
5
+ describe MongoidPost do
6
+ it_behaves_like "a decoratable model"
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+ require 'shared_examples/decoratable'
3
+
4
+ describe Post do
5
+ it_behaves_like "a decoratable model"
6
+ end