1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00

Merge pull request #1 from mikezter/master

Merge master into patch-1
This commit is contained in:
Mike 2011-10-08 07:45:25 -07:00
commit 1a74447e23
2 changed files with 4 additions and 4 deletions

View file

@ -196,7 +196,7 @@ Hate seeing that `h.` proxy all over? Willing to mix a bazillion methods into yo
```ruby
class ArticleDecorator < ApplicationDecorator
decorates :article
lazy_helpers
include Draper::LazyHelpers
def published_at
date = content_tag(:span, model.published_at.strftime("%A, %B %e").squeeze(" "), :class => 'date')

View file

@ -5,9 +5,9 @@ describe Draper::Base do
subject{ Draper::Base.new(source) }
let(:source){ Product.new }
context(".lazy_helpers") do
it "makes Rails helpers available without using the h. proxy" do
Draper::Base.lazy_helpers
context("module LazyHelpers") do
it "makes Rails helpers available without using the h. proxy by including it" do
Draper::Base.send(:include, Draper::LazyHelpers)
subject.send(:pluralize, 5, "cat").should == "5 cats"
end
end