[rspec-users] Problems withe the template...

Alex afolgueras at gmail.com
Wed Apr 22 12:27:19 EDT 2009


Hello everybody !

I have in a view something like this :


<% unless (method_name?(id)) then %>
	<span class="active">
	    <%= link_to h(t(:BTN)), new_url_path(id) %></span>
	 </span>
<% else %>
	<span class="Notactive">
		<%= link_to_function h(t(:BTN)), 'return false;' %>
	</span>
<% end %>


all of this works well ...

and in my spec I try to do this to go in the else part :

@controller.template.stub!(:get_courtier_expire?).and_return (false)



I tried a lot of combinations like ...

@template.stub!(
template.stub!(
@controller.template.should_receive(
template.should_receive(

and it does'nt work ... it always goes in the if not in the else
part ... any suggestions ?


More information about the rspec-users mailing list