<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Rendering a view and passing a variable</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<P><FONT SIZE=2>Hello all,<BR>
<BR>
I have a view which display html based on the value of a variable. Here's the code :<BR>
<BR>
<% if @language == 'e' %><BR>
<%= link_to "Fran&ccedil;ais", :action => :index, :id => "f" %><BR>
<% end %><BR>
<BR>
In my test, I'm trying to set the value of the variable first, but that just doesn't seem to work :<BR>
<BR>
it "should display in english when @language is equal to 'E'" do<BR>
@language = "e"<BR>
render "/search/index"<BR>
response.should have_tag("a[href=?]", "/search/index/f")<BR>
end<BR>
<BR>
I get the error message saying that no tag was found.<BR>
<BR>
Any help would be appreciated<BR>
<BR>
Thank you in advance<BR>
<BR>
Olivier Dupuis</FONT>
</P>
</BODY>
</HTML>