Ruby on Rails Friday, February 10, 2017

On 10 February 2017 at 10:34, 'krfg' via Ruby on Rails: Talk
<rubyonrails-talk@googlegroups.com> 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.

Colin

--
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+unsubscribe@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/CAL%3D0gLvrshBfrfwofhmotn5Ory6WOoKp5kBkQHXZ18SBxMSVjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment