draper 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -1
- data/Gemfile +3 -3
- data/Rakefile +8 -8
- data/Readme.markdown +41 -22
- data/doc/css/full_list.css +2 -2
- data/doc/css/style.css +30 -30
- data/doc/js/app.js +10 -10
- data/doc/js/full_list.js +8 -8
- data/draper.gemspec +2 -2
- data/lib/draper.rb +1 -1
- data/lib/draper/base.rb +65 -22
- data/lib/draper/decorated_enumerable_proxy.rb +6 -1
- data/lib/draper/model_support.rb +2 -2
- data/lib/draper/railtie.rb +19 -0
- data/lib/draper/system.rb +7 -4
- data/lib/draper/version.rb +1 -1
- data/lib/generators/draper/decorator/decorator_generator.rb +26 -4
- data/lib/generators/draper/decorator/templates/decorator.rb +2 -2
- data/lib/generators/{rspec → draper/decorator}/templates/decorator_spec.rb +1 -1
- data/lib/generators/{test_unit → draper/decorator}/templates/decorator_test.rb +1 -1
- data/lib/generators/draper/install/install_generator.rb +6 -6
- data/lib/generators/rails/decorator_generator.rb +3 -3
- data/performance/bechmark.rb +5 -5
- data/performance/decorators.rb +4 -4
- data/performance/models.rb +2 -2
- data/spec/draper/base_spec.rb +176 -10
- data/spec/draper/helper_support_spec.rb +1 -1
- data/spec/draper/model_support_spec.rb +23 -14
- data/spec/draper/view_context_spec.rb +4 -4
- data/spec/generators/draper/decorator/decorator_generator_spec.rb +81 -1
- data/spec/generators/draper/install/install_generator_spec.rb +5 -5
- data/spec/spec_helper.rb +3 -0
- data/spec/support/samples/application_controller.rb +8 -11
- data/spec/support/samples/decorator_with_allows.rb +1 -1
- data/spec/support/samples/decorator_with_application_helper.rb +5 -5
- data/spec/support/samples/decorator_with_denies.rb +1 -1
- data/spec/support/samples/decorator_with_multiple_allows.rb +4 -0
- data/spec/support/samples/product.rb +28 -7
- data/spec/support/samples/some_thing.rb +2 -0
- data/spec/support/samples/some_thing_decorator.rb +3 -0
- metadata +62 -37
- data/lib/generators/rspec/decorator_generator.rb +0 -11
- data/lib/generators/test_unit/decorator_generator.rb +0 -11
- data/spec/generators/rspec/decorator_generator_spec.rb +0 -22
- 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
|