I have a view which display html based on the value of a variable.
Here’s the code :
<% if @language == ‘e’ %>
<%= link_to “Français”, :action => :index, :id => “f” %>
<% end %>
In my test, I’m trying to set the value of the variable first, but that
just doesn’t seem to work :
it “should display in english when @language is equal to ‘E’” do @language = “e”
render “/search/index”
response.should have_tag(“a[href=?]”, “/search/index/f”)
end
I get the error message saying that no tag was found.
Privacy and Confidentiality Notice:
The information contained in this electronic mail message is intended
for the named recipient(s) only. It may contain privileged and
confidential information. If you are not an intended recipient, you
must not copy, forward, distribute or take any action in reliance on
it. If you have received this electronic mail message in error,
please notify the sender immediately.