draper/spec/draper
Bruno Castro d44c86f1e5 fix: Don't delegate public methods overridden by a private in the decorator (#849)
Public methods defined on the object was being delegated to the decorator even though it was overridden by a private method.

## Testing
1. Create a simple PORO with a public method
```ruby
class Job
  def location
    Struct.new(:id) { }
  end
end
```

1. Create a decorator and override the public method with a private
```ruby
class JobDecorator < Draper::Decorator
  delegate_all

  private

  def location
    LocationDecorator.new(object.location)
  end
end
```

3. It should raise an exception when calling `.location` from the decorator
```ruby
[9] pry(main)> JobDecorator.decorate(Job.new).location
NoMethodError: private method `location' called for #<JobDecorator:0x0000559f113ba118>
```

## References
* Issue #771
2019-03-18 11:35:29 -05:00
..
decoratable Check for `decorated?` before using `source` in #== 2013-01-18 10:05:13 +00:00
query_methods feat: Include ORM associations in CollectionDecorator (#845) 2019-02-25 10:44:19 -06:00
view_context Fix failing specs re Rails 5.1 (#800) 2017-05-05 10:28:28 -05:00
collection_decorator_spec.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
configuration_spec.rb feat: Include ORM associations in CollectionDecorator (#845) 2019-02-25 10:44:19 -06:00
decoratable_spec.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
decorated_association_spec.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
decorates_assigned_spec.rb update rspec syntax to the new one 2016-06-09 18:49:42 -03:00
decorator_spec.rb fix: Don't delegate public methods overridden by a private in the decorator (#849) 2019-03-18 11:35:29 -05:00
draper_spec.rb Add SimpleCov for code coverage analysis (#851) 2019-03-18 08:21:35 -05:00
factory_spec.rb Clean and remove empty lines (#844) 2019-02-25 12:22:28 -06:00
finders_spec.rb update rspec syntax to the new one 2016-06-09 18:49:42 -03:00
helper_proxy_spec.rb update rspec syntax to the new one 2016-06-09 18:49:42 -03:00
lazy_helpers_spec.rb update rspec syntax to the new one 2016-06-09 18:49:42 -03:00
query_methods_spec.rb fix: Make CollectionDecorator respond_to? to ORM methods (#850) 2019-03-16 14:15:16 -05:00
undecorate_chain_spec.rb Add undecorate_chain feature 2017-01-16 00:47:54 +03:00
undecorate_spec.rb Draper.undecorate safely undecorates any object 2014-06-01 09:17:47 -07:00
view_context_spec.rb Clean view context when controller changes (#799) 2017-05-08 09:23:13 -05:00
view_helpers_spec.rb Revamp specs 2013-01-17 12:47:25 +00:00