draper 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/CHANGELOG.md +3 -0
  2. data/CONTRIBUTING.md +5 -1
  3. data/Gemfile +23 -9
  4. data/README.md +144 -52
  5. data/Rakefile +1 -0
  6. data/draper.gemspec +1 -1
  7. data/lib/draper.rb +9 -6
  8. data/lib/draper/decoratable.rb +3 -7
  9. data/lib/draper/decoratable/equality.rb +14 -0
  10. data/lib/draper/decorator.rb +4 -7
  11. data/lib/draper/helper_proxy.rb +22 -3
  12. data/lib/draper/test/devise_helper.rb +18 -22
  13. data/lib/draper/test/rspec_integration.rb +4 -0
  14. data/lib/draper/test_case.rb +20 -0
  15. data/lib/draper/version.rb +1 -1
  16. data/lib/draper/view_context.rb +75 -13
  17. data/lib/draper/view_context/build_strategy.rb +48 -0
  18. data/lib/draper/view_helpers.rb +2 -2
  19. data/spec/draper/collection_decorator_spec.rb +169 -196
  20. data/spec/draper/decoratable/equality_spec.rb +10 -0
  21. data/spec/draper/decoratable_spec.rb +107 -132
  22. data/spec/draper/decorated_association_spec.rb +99 -96
  23. data/spec/draper/decorator_spec.rb +408 -434
  24. data/spec/draper/finders_spec.rb +160 -126
  25. data/spec/draper/helper_proxy_spec.rb +38 -8
  26. data/spec/draper/view_context/build_strategy_spec.rb +116 -0
  27. data/spec/draper/view_context_spec.rb +154 -0
  28. data/spec/draper/view_helpers_spec.rb +4 -37
  29. data/spec/dummy/app/controllers/posts_controller.rb +7 -0
  30. data/spec/dummy/app/decorators/post_decorator.rb +26 -2
  31. data/spec/dummy/app/helpers/application_helper.rb +3 -0
  32. data/spec/dummy/app/mailers/post_mailer.rb +10 -0
  33. data/spec/dummy/app/models/admin.rb +5 -0
  34. data/spec/dummy/app/models/mongoid_post.rb +5 -0
  35. data/spec/dummy/app/models/user.rb +5 -0
  36. data/spec/dummy/app/views/posts/_post.html.erb +15 -0
  37. data/spec/dummy/bin/rails +4 -0
  38. data/spec/dummy/config/application.rb +9 -3
  39. data/spec/dummy/config/boot.rb +2 -7
  40. data/spec/dummy/config/environments/development.rb +2 -3
  41. data/spec/dummy/config/environments/production.rb +2 -0
  42. data/spec/dummy/config/environments/test.rb +3 -4
  43. data/spec/dummy/config/initializers/secret_token.rb +1 -0
  44. data/spec/dummy/config/mongoid.yml +80 -0
  45. data/spec/dummy/config/routes.rb +2 -0
  46. data/spec/dummy/fast_spec/post_decorator_spec.rb +38 -0
  47. data/spec/dummy/lib/tasks/test.rake +11 -5
  48. data/spec/dummy/spec/decorators/devise_spec.rb +64 -0
  49. data/spec/dummy/spec/decorators/helpers_spec.rb +21 -0
  50. data/spec/dummy/spec/decorators/post_decorator_spec.rb +26 -6
  51. data/spec/dummy/spec/decorators/spec_type_spec.rb +7 -0
  52. data/spec/dummy/spec/decorators/view_context_spec.rb +22 -0
  53. data/spec/dummy/spec/mailers/post_mailer_spec.rb +10 -6
  54. data/spec/dummy/spec/models/mongoid_post_spec.rb +10 -0
  55. data/spec/dummy/spec/models/post_spec.rb +5 -5
  56. data/spec/dummy/spec/spec_helper.rb +1 -0
  57. data/spec/dummy/test/decorators/minitest/devise_test.rb +64 -0
  58. data/spec/dummy/test/decorators/minitest/helpers_test.rb +21 -0
  59. data/spec/dummy/{mini_test/mini_test_integration_test.rb → test/decorators/minitest/spec_type_test.rb} +9 -3
  60. data/spec/dummy/test/decorators/minitest/view_context_test.rb +24 -0
  61. data/spec/dummy/test/decorators/test_unit/devise_test.rb +64 -0
  62. data/spec/dummy/test/decorators/test_unit/helpers_test.rb +21 -0
  63. data/spec/dummy/test/decorators/test_unit/view_context_test.rb +24 -0
  64. data/spec/dummy/test/minitest_helper.rb +4 -0
  65. data/spec/dummy/test/test_helper.rb +3 -0
  66. data/spec/generators/decorator/decorator_generator_spec.rb +1 -0
  67. data/spec/integration/integration_spec.rb +31 -6
  68. data/spec/spec_helper.rb +32 -25
  69. data/spec/support/shared_examples/decoratable_equality.rb +40 -0
  70. data/spec/support/shared_examples/view_helpers.rb +39 -0
  71. metadata +56 -44
  72. data/spec/dummy/README.rdoc +0 -261
  73. data/spec/dummy/spec/decorators/rspec_integration_spec.rb +0 -19
  74. data/spec/support/action_controller.rb +0 -12
  75. data/spec/support/active_model.rb +0 -7
  76. data/spec/support/active_record.rb +0 -9
  77. data/spec/support/decorators/decorator_with_application_helper.rb +0 -25
  78. data/spec/support/decorators/namespaced_product_decorator.rb +0 -5
  79. data/spec/support/decorators/non_active_model_product_decorator.rb +0 -2
  80. data/spec/support/decorators/product_decorator.rb +0 -23
  81. data/spec/support/decorators/products_decorator.rb +0 -10
  82. data/spec/support/decorators/some_thing_decorator.rb +0 -2
  83. data/spec/support/decorators/specific_product_decorator.rb +0 -2
  84. data/spec/support/decorators/widget_decorator.rb +0 -2
  85. data/spec/support/models/namespaced_product.rb +0 -49
  86. data/spec/support/models/non_active_model_product.rb +0 -3
  87. data/spec/support/models/product.rb +0 -95
  88. data/spec/support/models/some_thing.rb +0 -5
  89. data/spec/support/models/uninferrable_decorator_model.rb +0 -3
  90. data/spec/support/models/widget.rb +0 -2
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+
3
+ if defined?(Devise)
4
+ class DeviseTest < Draper::TestCase
5
+ def test_sign_in_a_real_user
6
+ user = User.new
7
+ sign_in user
8
+
9
+ assert_same user, helper.current_user
10
+ end
11
+
12
+ def test_sign_in_a_mock_user
13
+ user = Object.new
14
+ sign_in :user, user
15
+
16
+ assert_same user, helper.current_user
17
+ end
18
+
19
+ def test_sign_in_a_real_admin
20
+ admin = Admin.new
21
+ sign_in admin
22
+
23
+ assert_same admin, helper.current_admin
24
+ end
25
+
26
+ def test_sign_in_a_mock_admin
27
+ admin = Object.new
28
+ sign_in :admin, admin
29
+
30
+ assert_same admin, helper.current_admin
31
+ end
32
+
33
+ def test_sign_out_a_real_user
34
+ user = User.new
35
+ sign_in user
36
+ sign_out user
37
+
38
+ assert helper.current_user.nil?
39
+ end
40
+
41
+ def test_sign_out_a_mock_user
42
+ user = Object.new
43
+ sign_in :user, user
44
+ sign_out :user
45
+
46
+ assert helper.current_user.nil?
47
+ end
48
+
49
+ def test_sign_out_without_a_user
50
+ sign_out :user
51
+
52
+ assert helper.current_user.nil?
53
+ end
54
+
55
+ def test_backwards_compatibility
56
+ user = Object.new
57
+ ActiveSupport::Deprecation.silence do
58
+ sign_in user
59
+ end
60
+
61
+ assert_same user, helper.current_user
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,21 @@
1
+ require 'test_helper'
2
+
3
+ class HelpersTest < Draper::TestCase
4
+ def test_access_helpers_through_helper
5
+ assert_equal "<p>Help!</p>", helper.content_tag(:p, "Help!")
6
+ end
7
+
8
+ def test_access_helpers_through_helpers
9
+ assert_equal "<p>Help!</p>", helpers.content_tag(:p, "Help!")
10
+ end
11
+
12
+ def test_access_helpers_through_h
13
+ assert_equal "<p>Help!</p>", h.content_tag(:p, "Help!")
14
+ end
15
+
16
+ def test_same_helper_object_as_decorators
17
+ decorator = Draper::Decorator.new(Object.new)
18
+
19
+ assert_same decorator.helpers, helpers
20
+ end
21
+ end
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ def it_does_not_leak_view_context
4
+ 2.times do |n|
5
+ define_method("test_has_independent_view_context_#{n}") do
6
+ refute_equal :leaked, Draper::ViewContext.current
7
+ Draper::ViewContext.current = :leaked
8
+ end
9
+ end
10
+ end
11
+
12
+ class DecoratorTest < Draper::TestCase
13
+ it_does_not_leak_view_context
14
+ end
15
+
16
+ class ControllerTest < ActionController::TestCase
17
+ tests Class.new(ActionController::Base)
18
+
19
+ it_does_not_leak_view_context
20
+ end
21
+
22
+ class MailerTest < ActionMailer::TestCase
23
+ it_does_not_leak_view_context
24
+ end
@@ -0,0 +1,4 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'minitest/autorun'
4
+ require 'minitest/rails'
@@ -0,0 +1,3 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'ammeter/init'
2
3
 
3
4
  # Generators are not automatically loaded by Rails
4
5
  require 'generators/decorator/decorator_generator'
@@ -3,30 +3,55 @@ require 'support/dummy_app'
3
3
  require 'support/matchers/have_text'
4
4
 
5
5
  app = DummyApp.new(ENV["RAILS_ENV"])
6
+ spec_types = {
7
+ view: ["/posts/1", "PostsController"],
8
+ mailer: ["/posts/1/mail", "PostMailer"]
9
+ }
6
10
 
7
11
  app.start_server do
8
- {view: "/posts/1", mailer: "/posts/1/mail"}.each do |type, path|
12
+ spec_types.each do |type, (path, controller)|
9
13
  page = app.get(path)
10
14
 
11
15
  describe "in a #{type}" do
12
16
  it "runs in the correct environment" do
13
- page.should have_text(app.environment).in("#environment")
17
+ expect(page).to have_text(app.environment).in("#environment")
18
+ end
19
+
20
+ it "uses the correct view context controller" do
21
+ expect(page).to have_text(controller).in("#controller")
22
+ end
23
+
24
+ it "can use built-in helpers" do
25
+ expect(page).to have_text("Once upon a...").in("#truncated")
26
+ end
27
+
28
+ it "can use built-in private helpers" do
29
+ # Nokogiri unescapes text!
30
+ expect(page).to have_text("<script>danger</script>").in("#html_escaped")
31
+ end
32
+
33
+ it "can use user-defined helpers from app/helpers" do
34
+ expect(page).to have_text("Hello, world!").in("#hello_world")
35
+ end
36
+
37
+ it "can use user-defined helpers from the controller" do
38
+ expect(page).to have_text("Goodnight, moon!").in("#goodnight_moon")
14
39
  end
15
40
 
16
41
  it "can use path helpers with a model" do
17
- page.should have_text("/en/posts/1").in("#path_with_model")
42
+ expect(page).to have_text("/en/posts/1").in("#path_with_model")
18
43
  end
19
44
 
20
45
  it "can use path helpers with an id" do
21
- page.should have_text("/en/posts/1").in("#path_with_id")
46
+ expect(page).to have_text("/en/posts/1").in("#path_with_id")
22
47
  end
23
48
 
24
49
  it "can use url helpers with a model" do
25
- page.should have_text("http://www.example.com:12345/en/posts/1").in("#url_with_model")
50
+ expect(page).to have_text("http://www.example.com:12345/en/posts/1").in("#url_with_model")
26
51
  end
27
52
 
28
53
  it "can use url helpers with an id" do
29
- page.should have_text("http://www.example.com:12345/en/posts/1").in("#url_with_id")
54
+ expect(page).to have_text("http://www.example.com:12345/en/posts/1").in("#url_with_id")
30
55
  end
31
56
  end
32
57
  end
@@ -1,29 +1,36 @@
1
1
  require 'bundler/setup'
2
- require 'ammeter/init'
3
- require 'rails'
4
-
5
- require 'action_view'
2
+ require 'draper'
6
3
  require 'action_controller'
7
4
  require 'action_controller/test_case'
8
5
 
9
- Bundler.require
10
-
11
- require 'support/active_model'
12
- require 'support/active_record'
13
- require 'support/action_controller'
14
-
15
- require 'support/models/product'
16
- require 'support/models/namespaced_product'
17
- require 'support/models/non_active_model_product'
18
- require 'support/models/widget'
19
- require 'support/models/some_thing'
20
- require 'support/models/uninferrable_decorator_model'
21
-
22
- require 'support/decorators/product_decorator'
23
- require 'support/decorators/namespaced_product_decorator'
24
- require 'support/decorators/non_active_model_product_decorator'
25
- require 'support/decorators/widget_decorator'
26
- require 'support/decorators/specific_product_decorator'
27
- require 'support/decorators/products_decorator'
28
- require 'support/decorators/some_thing_decorator'
29
- require 'support/decorators/decorator_with_application_helper'
6
+ RSpec.configure do |config|
7
+ config.treat_symbols_as_metadata_keys_with_true_values = true
8
+ config.expect_with(:rspec) {|c| c.syntax = :expect}
9
+ config.order = :random
10
+ end
11
+
12
+ class Model; include Draper::Decoratable; end
13
+
14
+ class Product < Model; end
15
+ class ProductDecorator < Draper::Decorator; end
16
+ class ProductsDecorator < Draper::CollectionDecorator; end
17
+
18
+ class ProductPresenter < Draper::Decorator; end
19
+
20
+ class OtherDecorator < Draper::Decorator; end
21
+
22
+ module Namespaced
23
+ class Product < Model; end
24
+ class ProductDecorator < Draper::Decorator; end
25
+
26
+ class OtherDecorator < Draper::Decorator; end
27
+ end
28
+
29
+ # After each example, revert changes made to the class
30
+ def protect_class(klass)
31
+ before { stub_const klass.name, Class.new(klass) }
32
+ end
33
+
34
+ def protect_module(mod)
35
+ before { stub_const mod.name, mod.dup }
36
+ end
@@ -0,0 +1,40 @@
1
+ shared_examples_for "decoration-aware #==" do |subject|
2
+ it "is true for itself" do
3
+ expect(subject == subject).to be_true
4
+ end
5
+
6
+ it "is false for another object" do
7
+ expect(subject == Object.new).to be_false
8
+ end
9
+
10
+ it "is true for a decorated version of itself" do
11
+ decorated = double(source: subject, decorated?: true)
12
+
13
+ expect(subject == decorated).to be_true
14
+ end
15
+
16
+ it "is false for a decorated other object" do
17
+ decorated = double(source: Object.new, decorated?: true)
18
+
19
+ expect(subject == decorated).to be_false
20
+ end
21
+
22
+ it "is false for a decoratable object with a `source` association" do
23
+ decoratable = double(source: subject, decorated?: false)
24
+
25
+ expect(subject == decoratable).to be_false
26
+ end
27
+
28
+ it "is false for an undecoratable object with a `source` association" do
29
+ undecoratable = double(source: subject)
30
+
31
+ expect(subject == undecoratable).to be_false
32
+ end
33
+
34
+ it "is true for a multiply-decorated version of itself" do
35
+ decorated = double(source: subject, decorated?: true)
36
+ redecorated = double(source: decorated, decorated?: true)
37
+
38
+ expect(subject == redecorated).to be_true
39
+ end
40
+ end
@@ -0,0 +1,39 @@
1
+ shared_examples_for "view helpers" do |subject|
2
+ describe "#helpers" do
3
+ it "returns the current view context" do
4
+ Draper::ViewContext.stub current: :current_view_context
5
+ expect(subject.helpers).to be :current_view_context
6
+ end
7
+
8
+ it "is aliased to #h" do
9
+ Draper::ViewContext.stub current: :current_view_context
10
+ expect(subject.h).to be :current_view_context
11
+ end
12
+ end
13
+
14
+ describe "#localize" do
15
+ it "delegates to #helpers" do
16
+ subject.stub helpers: double
17
+ subject.helpers.should_receive(:localize).with(:an_object, some: "parameter")
18
+ subject.localize(:an_object, some: "parameter")
19
+ end
20
+
21
+ it "is aliased to #l" do
22
+ subject.stub helpers: double
23
+ subject.helpers.should_receive(:localize).with(:an_object, some: "parameter")
24
+ subject.l(:an_object, some: "parameter")
25
+ end
26
+ end
27
+
28
+ describe ".helpers" do
29
+ it "returns the current view context" do
30
+ Draper::ViewContext.stub current: :current_view_context
31
+ expect(subject.class.helpers).to be :current_view_context
32
+ end
33
+
34
+ it "is aliased to .h" do
35
+ Draper::ViewContext.stub current: :current_view_context
36
+ expect(subject.class.h).to be :current_view_context
37
+ end
38
+ end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-14 00:00:00.000000000 Z
13
+ date: 2013-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -172,8 +172,8 @@ dependencies:
172
172
  - - ! '>='
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
- description: Draper adds a nicely-separated object-oriented layer of presentation
176
- logic to your Rails apps.
175
+ description: Draper adds an object-oriented layer of presentation logic to your Rails
176
+ apps.
177
177
  email:
178
178
  - jeff@casimircreative.com
179
179
  - steve@steveklabnik.com
@@ -197,6 +197,7 @@ files:
197
197
  - lib/draper/automatic_delegation.rb
198
198
  - lib/draper/collection_decorator.rb
199
199
  - lib/draper/decoratable.rb
200
+ - lib/draper/decoratable/equality.rb
200
201
  - lib/draper/decorated_association.rb
201
202
  - lib/draper/decorator.rb
202
203
  - lib/draper/delegation.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/draper/test_case.rb
213
214
  - lib/draper/version.rb
214
215
  - lib/draper/view_context.rb
216
+ - lib/draper/view_context/build_strategy.rb
215
217
  - lib/draper/view_helpers.rb
216
218
  - lib/generators/decorator/decorator_generator.rb
217
219
  - lib/generators/decorator/templates/decorator.rb
@@ -224,14 +226,16 @@ files:
224
226
  - lib/generators/test_unit/decorator_generator.rb
225
227
  - lib/generators/test_unit/templates/decorator_test.rb
226
228
  - spec/draper/collection_decorator_spec.rb
229
+ - spec/draper/decoratable/equality_spec.rb
227
230
  - spec/draper/decoratable_spec.rb
228
231
  - spec/draper/decorated_association_spec.rb
229
232
  - spec/draper/decorator_spec.rb
230
233
  - spec/draper/finders_spec.rb
231
234
  - spec/draper/helper_proxy_spec.rb
235
+ - spec/draper/view_context/build_strategy_spec.rb
236
+ - spec/draper/view_context_spec.rb
232
237
  - spec/draper/view_helpers_spec.rb
233
238
  - spec/dummy/.rspec
234
- - spec/dummy/README.rdoc
235
239
  - spec/dummy/Rakefile
236
240
  - spec/dummy/app/controllers/application_controller.rb
237
241
  - spec/dummy/app/controllers/localized_urls.rb
@@ -240,11 +244,15 @@ files:
240
244
  - spec/dummy/app/helpers/application_helper.rb
241
245
  - spec/dummy/app/mailers/application_mailer.rb
242
246
  - spec/dummy/app/mailers/post_mailer.rb
247
+ - spec/dummy/app/models/admin.rb
248
+ - spec/dummy/app/models/mongoid_post.rb
243
249
  - spec/dummy/app/models/post.rb
250
+ - spec/dummy/app/models/user.rb
244
251
  - spec/dummy/app/views/layouts/application.html.erb
245
252
  - spec/dummy/app/views/post_mailer/decorated_email.html.erb
246
253
  - spec/dummy/app/views/posts/_post.html.erb
247
254
  - spec/dummy/app/views/posts/show.html.erb
255
+ - spec/dummy/bin/rails
248
256
  - spec/dummy/config.ru
249
257
  - spec/dummy/config/application.rb
250
258
  - spec/dummy/config/boot.rb
@@ -259,23 +267,37 @@ files:
259
267
  - spec/dummy/config/initializers/secret_token.rb
260
268
  - spec/dummy/config/initializers/session_store.rb
261
269
  - spec/dummy/config/locales/en.yml
270
+ - spec/dummy/config/mongoid.yml
262
271
  - spec/dummy/config/routes.rb
263
272
  - spec/dummy/db/migrate/20121019115657_create_posts.rb
264
273
  - spec/dummy/db/schema.rb
265
274
  - spec/dummy/db/seeds.rb
275
+ - spec/dummy/fast_spec/post_decorator_spec.rb
266
276
  - spec/dummy/lib/tasks/test.rake
267
277
  - spec/dummy/log/.gitkeep
268
- - spec/dummy/mini_test/mini_test_integration_test.rb
269
278
  - spec/dummy/public/404.html
270
279
  - spec/dummy/public/422.html
271
280
  - spec/dummy/public/500.html
272
281
  - spec/dummy/public/favicon.ico
273
282
  - spec/dummy/script/rails
283
+ - spec/dummy/spec/decorators/devise_spec.rb
284
+ - spec/dummy/spec/decorators/helpers_spec.rb
274
285
  - spec/dummy/spec/decorators/post_decorator_spec.rb
275
- - spec/dummy/spec/decorators/rspec_integration_spec.rb
286
+ - spec/dummy/spec/decorators/spec_type_spec.rb
287
+ - spec/dummy/spec/decorators/view_context_spec.rb
276
288
  - spec/dummy/spec/mailers/post_mailer_spec.rb
289
+ - spec/dummy/spec/models/mongoid_post_spec.rb
277
290
  - spec/dummy/spec/models/post_spec.rb
278
291
  - spec/dummy/spec/spec_helper.rb
292
+ - spec/dummy/test/decorators/minitest/devise_test.rb
293
+ - spec/dummy/test/decorators/minitest/helpers_test.rb
294
+ - spec/dummy/test/decorators/minitest/spec_type_test.rb
295
+ - spec/dummy/test/decorators/minitest/view_context_test.rb
296
+ - spec/dummy/test/decorators/test_unit/devise_test.rb
297
+ - spec/dummy/test/decorators/test_unit/helpers_test.rb
298
+ - spec/dummy/test/decorators/test_unit/view_context_test.rb
299
+ - spec/dummy/test/minitest_helper.rb
300
+ - spec/dummy/test/test_helper.rb
279
301
  - spec/generators/decorator/decorator_generator_spec.rb
280
302
  - spec/integration/integration_spec.rb
281
303
  - spec/performance/active_record.rb
@@ -283,25 +305,10 @@ files:
283
305
  - spec/performance/decorators.rb
284
306
  - spec/performance/models.rb
285
307
  - spec/spec_helper.rb
286
- - spec/support/action_controller.rb
287
- - spec/support/active_model.rb
288
- - spec/support/active_record.rb
289
- - spec/support/decorators/decorator_with_application_helper.rb
290
- - spec/support/decorators/namespaced_product_decorator.rb
291
- - spec/support/decorators/non_active_model_product_decorator.rb
292
- - spec/support/decorators/product_decorator.rb
293
- - spec/support/decorators/products_decorator.rb
294
- - spec/support/decorators/some_thing_decorator.rb
295
- - spec/support/decorators/specific_product_decorator.rb
296
- - spec/support/decorators/widget_decorator.rb
297
308
  - spec/support/dummy_app.rb
298
309
  - spec/support/matchers/have_text.rb
299
- - spec/support/models/namespaced_product.rb
300
- - spec/support/models/non_active_model_product.rb
301
- - spec/support/models/product.rb
302
- - spec/support/models/some_thing.rb
303
- - spec/support/models/uninferrable_decorator_model.rb
304
- - spec/support/models/widget.rb
310
+ - spec/support/shared_examples/decoratable_equality.rb
311
+ - spec/support/shared_examples/view_helpers.rb
305
312
  homepage: http://github.com/drapergem/draper
306
313
  licenses: []
307
314
  post_install_message:
@@ -328,14 +335,16 @@ specification_version: 3
328
335
  summary: View Models for Rails
329
336
  test_files:
330
337
  - spec/draper/collection_decorator_spec.rb
338
+ - spec/draper/decoratable/equality_spec.rb
331
339
  - spec/draper/decoratable_spec.rb
332
340
  - spec/draper/decorated_association_spec.rb
333
341
  - spec/draper/decorator_spec.rb
334
342
  - spec/draper/finders_spec.rb
335
343
  - spec/draper/helper_proxy_spec.rb
344
+ - spec/draper/view_context/build_strategy_spec.rb
345
+ - spec/draper/view_context_spec.rb
336
346
  - spec/draper/view_helpers_spec.rb
337
347
  - spec/dummy/.rspec
338
- - spec/dummy/README.rdoc
339
348
  - spec/dummy/Rakefile
340
349
  - spec/dummy/app/controllers/application_controller.rb
341
350
  - spec/dummy/app/controllers/localized_urls.rb
@@ -344,11 +353,15 @@ test_files:
344
353
  - spec/dummy/app/helpers/application_helper.rb
345
354
  - spec/dummy/app/mailers/application_mailer.rb
346
355
  - spec/dummy/app/mailers/post_mailer.rb
356
+ - spec/dummy/app/models/admin.rb
357
+ - spec/dummy/app/models/mongoid_post.rb
347
358
  - spec/dummy/app/models/post.rb
359
+ - spec/dummy/app/models/user.rb
348
360
  - spec/dummy/app/views/layouts/application.html.erb
349
361
  - spec/dummy/app/views/post_mailer/decorated_email.html.erb
350
362
  - spec/dummy/app/views/posts/_post.html.erb
351
363
  - spec/dummy/app/views/posts/show.html.erb
364
+ - spec/dummy/bin/rails
352
365
  - spec/dummy/config.ru
353
366
  - spec/dummy/config/application.rb
354
367
  - spec/dummy/config/boot.rb
@@ -363,23 +376,37 @@ test_files:
363
376
  - spec/dummy/config/initializers/secret_token.rb
364
377
  - spec/dummy/config/initializers/session_store.rb
365
378
  - spec/dummy/config/locales/en.yml
379
+ - spec/dummy/config/mongoid.yml
366
380
  - spec/dummy/config/routes.rb
367
381
  - spec/dummy/db/migrate/20121019115657_create_posts.rb
368
382
  - spec/dummy/db/schema.rb
369
383
  - spec/dummy/db/seeds.rb
384
+ - spec/dummy/fast_spec/post_decorator_spec.rb
370
385
  - spec/dummy/lib/tasks/test.rake
371
386
  - spec/dummy/log/.gitkeep
372
- - spec/dummy/mini_test/mini_test_integration_test.rb
373
387
  - spec/dummy/public/404.html
374
388
  - spec/dummy/public/422.html
375
389
  - spec/dummy/public/500.html
376
390
  - spec/dummy/public/favicon.ico
377
391
  - spec/dummy/script/rails
392
+ - spec/dummy/spec/decorators/devise_spec.rb
393
+ - spec/dummy/spec/decorators/helpers_spec.rb
378
394
  - spec/dummy/spec/decorators/post_decorator_spec.rb
379
- - spec/dummy/spec/decorators/rspec_integration_spec.rb
395
+ - spec/dummy/spec/decorators/spec_type_spec.rb
396
+ - spec/dummy/spec/decorators/view_context_spec.rb
380
397
  - spec/dummy/spec/mailers/post_mailer_spec.rb
398
+ - spec/dummy/spec/models/mongoid_post_spec.rb
381
399
  - spec/dummy/spec/models/post_spec.rb
382
400
  - spec/dummy/spec/spec_helper.rb
401
+ - spec/dummy/test/decorators/minitest/devise_test.rb
402
+ - spec/dummy/test/decorators/minitest/helpers_test.rb
403
+ - spec/dummy/test/decorators/minitest/spec_type_test.rb
404
+ - spec/dummy/test/decorators/minitest/view_context_test.rb
405
+ - spec/dummy/test/decorators/test_unit/devise_test.rb
406
+ - spec/dummy/test/decorators/test_unit/helpers_test.rb
407
+ - spec/dummy/test/decorators/test_unit/view_context_test.rb
408
+ - spec/dummy/test/minitest_helper.rb
409
+ - spec/dummy/test/test_helper.rb
383
410
  - spec/generators/decorator/decorator_generator_spec.rb
384
411
  - spec/integration/integration_spec.rb
385
412
  - spec/performance/active_record.rb
@@ -387,23 +414,8 @@ test_files:
387
414
  - spec/performance/decorators.rb
388
415
  - spec/performance/models.rb
389
416
  - spec/spec_helper.rb
390
- - spec/support/action_controller.rb
391
- - spec/support/active_model.rb
392
- - spec/support/active_record.rb
393
- - spec/support/decorators/decorator_with_application_helper.rb
394
- - spec/support/decorators/namespaced_product_decorator.rb
395
- - spec/support/decorators/non_active_model_product_decorator.rb
396
- - spec/support/decorators/product_decorator.rb
397
- - spec/support/decorators/products_decorator.rb
398
- - spec/support/decorators/some_thing_decorator.rb
399
- - spec/support/decorators/specific_product_decorator.rb
400
- - spec/support/decorators/widget_decorator.rb
401
417
  - spec/support/dummy_app.rb
402
418
  - spec/support/matchers/have_text.rb
403
- - spec/support/models/namespaced_product.rb
404
- - spec/support/models/non_active_model_product.rb
405
- - spec/support/models/product.rb
406
- - spec/support/models/some_thing.rb
407
- - spec/support/models/uninferrable_decorator_model.rb
408
- - spec/support/models/widget.rb
419
+ - spec/support/shared_examples/decoratable_equality.rb
420
+ - spec/support/shared_examples/view_helpers.rb
409
421
  has_rdoc: