You can have a look at the partial _social_layer.html.erb at this link <https://www.railstutorial.org/book/following_users#code-home_page_stats>: it is the code included in the if statement. As I said, I changed my homepage as follows:
<% if logged_in? %> <% if current_user.gamer? %> <%= render 'static_pages/gamers_home' %> <% else %> <%= render 'static_pages/non_gamers_home' %> <% end %> <% else %> <%= render 'static_pages/non_logged_in_home' %> <% end %> I reported an extract of static_pages/gamers_home in my first post. In theory all instance variables inside static_pages_controller.rb should be loaded by the test but they are not. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7e833ceb-3c4d-4b5b-b615-9956b500e534%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.