#11 ✓resolved
Marnen Laibow-Koser

views/events/show spec fails when it tries to call User.current_user.calendars

Reported by Marnen Laibow-Koser | December 11th, 2008 @ 01:20 PM

ActionView::TemplateError in '/events/show should wrap the whole thing in a

of class events' You have a nil object when you didn't expect it! The error occurred while evaluating nil.calendars On line #9of events/_table_header.html.haml
6:     = sortlinks ? sort_link("Date", :date, (@order == 'date' and @direction == 'asc') ? :desc : :asc) : h(_("Date"))
7:     - if @order == 'date'
8:       &= @direction == 'asc' ? '↑' : '↓'
9:   - if User.current_user.calendars.size > 1
10:     %th.calendar&= _('Calendar')
11:   %th
12:     = sortlinks ? sort_link("Event", :name, (@order == 'name' and @direction == 'asc') ? :desc : :asc) : h(_("Event"))

app/views/events/_table_header.html.haml:9:in `_run_plugin_47app47views47events47_table_header46html46haml'
vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_mods.rb:12:in `orig_render'
vendor/gems/haml-2.1.0/lib/haml/helpers.rb:57:in `non_haml'
vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_mods.rb:12:in `orig_render'
app/views/events/show.html.haml:4:in `_run_plugin_47app47views47events47show46html46haml'
/Library/Ruby/Gems/1.8/gems/gettext-1.93.0/lib/gettext/rails.rb:289:in `render_file'
spec/views/events/show.html.haml_spec.rb:18

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<p>This is the issue tracker for the Quorum calendar system. Also see our <a href="http://github.com/marnen/quorum2">Github repository</a> and our <a href="http://quorum2.sourceforge.net">project website</a>.</p>
<p>Please tag bug reports with <strong>bug</strong> and feature requests with <strong>feature</strong>. Use additional descriptive tags as necessary.</p>

Shared Ticket Bins

People watching this ticket

Referenced by

Pages