draper 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.travis.yml +0 -1
  2. data/Gemfile +3 -3
  3. data/Rakefile +8 -8
  4. data/Readme.markdown +41 -22
  5. data/doc/css/full_list.css +2 -2
  6. data/doc/css/style.css +30 -30
  7. data/doc/js/app.js +10 -10
  8. data/doc/js/full_list.js +8 -8
  9. data/draper.gemspec +2 -2
  10. data/lib/draper.rb +1 -1
  11. data/lib/draper/base.rb +65 -22
  12. data/lib/draper/decorated_enumerable_proxy.rb +6 -1
  13. data/lib/draper/model_support.rb +2 -2
  14. data/lib/draper/railtie.rb +19 -0
  15. data/lib/draper/system.rb +7 -4
  16. data/lib/draper/version.rb +1 -1
  17. data/lib/generators/draper/decorator/decorator_generator.rb +26 -4
  18. data/lib/generators/draper/decorator/templates/decorator.rb +2 -2
  19. data/lib/generators/{rspec → draper/decorator}/templates/decorator_spec.rb +1 -1
  20. data/lib/generators/{test_unit → draper/decorator}/templates/decorator_test.rb +1 -1
  21. data/lib/generators/draper/install/install_generator.rb +6 -6
  22. data/lib/generators/rails/decorator_generator.rb +3 -3
  23. data/performance/bechmark.rb +5 -5
  24. data/performance/decorators.rb +4 -4
  25. data/performance/models.rb +2 -2
  26. data/spec/draper/base_spec.rb +176 -10
  27. data/spec/draper/helper_support_spec.rb +1 -1
  28. data/spec/draper/model_support_spec.rb +23 -14
  29. data/spec/draper/view_context_spec.rb +4 -4
  30. data/spec/generators/draper/decorator/decorator_generator_spec.rb +81 -1
  31. data/spec/generators/draper/install/install_generator_spec.rb +5 -5
  32. data/spec/spec_helper.rb +3 -0
  33. data/spec/support/samples/application_controller.rb +8 -11
  34. data/spec/support/samples/decorator_with_allows.rb +1 -1
  35. data/spec/support/samples/decorator_with_application_helper.rb +5 -5
  36. data/spec/support/samples/decorator_with_denies.rb +1 -1
  37. data/spec/support/samples/decorator_with_multiple_allows.rb +4 -0
  38. data/spec/support/samples/product.rb +28 -7
  39. data/spec/support/samples/some_thing.rb +2 -0
  40. data/spec/support/samples/some_thing_decorator.rb +3 -0
  41. metadata +62 -37
  42. data/lib/generators/rspec/decorator_generator.rb +0 -11
  43. data/lib/generators/test_unit/decorator_generator.rb +0 -11
  44. data/spec/generators/rspec/decorator_generator_spec.rb +0 -22
  45. data/spec/generators/test_unit/decorator_generator_spec.rb +0 -22
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Generators are not automatically loaded by Rails
4
- require 'generators/test_unit/decorator_generator'
5
-
6
- describe TestUnit::DecoratorGenerator do
7
- # Tell the generator where to put its output (what it thinks of as Rails.root)
8
- destination File.expand_path("../../../../tmp", __FILE__)
9
-
10
- before { prepare_destination }
11
-
12
- describe 'no arguments' do
13
- before { run_generator %w(products) }
14
-
15
- describe 'test/decorators/products_decorator_test.rb' do
16
- subject { file('test/decorators/products_decorator_test.rb') }
17
- it { should exist }
18
- it { should contain "class ProductsDecoratorTest < ActiveSupport::TestCase" }
19
- end
20
-
21
- end
22
- end