Pradeep Gatram
2008-Nov-26 15:03 UTC
Different boolean expression evaluation between rspec(view) and rails environments
Hi, Maybe its just too late in the day and I should stop :). But I am stuck at a very weird issue. Here is an excerpt from my erb file <% display_invisible_content = !icon.nil? or (render_detach and entity.mounted?) %> (I have certain, non mountable, entities which do not have mounted? method. It should not have been a problem because the render_detach is true only for mountable entities) I have tested this writing a view spec and exercising the case where icon is nil and render_detach is false. The spec passed w/o calling the mounted? method on entity. When I come across the same scenario on the Rails UI (running in dev mode), the mounted? method is called on entity despite render_detach being false!!! How is this possible? Pradeep --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pradeep Gatram
2008-Nov-27 04:58 UTC
Re: Different boolean expression evaluation between rspec(view) and rails environments
Ooops. Perils of coding late in the day. render_detach boolean was indeed ''true'' :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---