jcasimir/draper — Issue #102: Routes In  Decorators
Author: Gerhardk
Created: 2011-12-19 15:21:19+00:00
State: open

Hey I am running into a weird error with the decorators.
The error/problem is when I have link_to(account_path(model.id)) inside my decorator it works when I render the view. But when I run my rspec decorator test :

```ruby
### Rspec Test
it "should render link" do
@account = AccountDecorator(account)
@account.tabnavs.should_not be_nil
end

###Decorator
def tabnavs
content_tag(:li, link_to('Summary', account_path(model, :ofc=>"#{model.id}.json"),:remote => true))
end
```

I get the following error:

AccountDecorator should render link
Failure/Error: @account.tabnavs.should_not be_nil
undefined method `account_path' for #

Can you please advise what is needed so the test can understand where to find the account_path

Thanks for a awesome gem
Gerhard