Ruby on Rails Friday, February 10, 2017

On 10 February 2017 at 10:34, 'krfg' via Ruby on Rails: Talk
<> wrote:
> You can have a look at the partial _social_layer.html.erb at this link: 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.

The variables are not loaded by the test, they are loaded by the code
in your controller. If they are loaded when running the app but not
when running the test then you are not invoking the controller action
in the same way, or with equivalent database data.


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
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment