Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Testing the Whole App Before Filters

Dinesh Vijaykumar
Dinesh Vijaykumar
9,879 Points

full_name error

I seem to get this error after changing the statuses.yml file and running the test -

StatusesControllerTest#test_should_show_status: ActionView::Template::Error: undefined method full_name' for nil:NilClass app/views/statuses/show.html.erb:5:inapp_views_statuses_show_html_erb_591757366996659267_70249387002900' test/controllers/statuses_controller_test.rb:29:in `block in <class:StatusesControllerTest>'

statuses.yml -

one:
  content: MyText
  user: din

two:
  content: MyText
  user: din

users.yml -

din:
 first_name: "Dinesh"
 last_name: "Vijaykumar"
 email: "dindin1@live.co.uk"
 profile_name: "drdindin"

show.html.erb -

<p id="notice"><%= notice %></p>

<p>
  <strong>Name:</strong>
  <%= current_user.full_name %>
</p>

<p>
  <strong>Content:</strong>
  <%= @status.content %>
</p>

<%= link_to 'Edit', edit_status_path(@status) %> |
<%= link_to 'Back', statuses_path %>