I had reinstalled the plugin yesterday but I reinstalled it and its revision 2680<br>It still gives me the error.<br><br><div><span class="gmail_quote">On 10/1/07, <b class="gmail_sendername">David Chelimsky</b> &lt;<a href="mailto:dchelimsky@gmail.com">
dchelimsky@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 10/1/07, Andrew WC Brown &lt;<a href="mailto:omen.king@gmail.com">
omen.king@gmail.com</a>&gt; wrote:<br>&gt; 1.0.9<br><br>That&#39;s not been released, so you must be working from trunk. I don&#39;t<br>think, however, you have the latest trunk because I *think* this has<br>been fixed.<br>
<br>Try updating (per<br><a href="http://rspec.rubyforge.org/documentation/rails/install.html">http://rspec.rubyforge.org/documentation/rails/install.html</a> near the<br>bottom) and see if this problem goes away.<br><br>
Cheers,<br>David<br><br>&gt;<br>&gt;<br>&gt; On 10/1/07, David Chelimsky &lt;<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; wrote:<br>&gt; &gt; On 10/1/07, Andrew WC Brown &lt;<a href="mailto:omen.king@gmail.com">
omen.king@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; How about spec&#39;ing links?<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &lt;%= link_to &#39;Create new game&#39;, new_games_path %&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp; it &quot;should have a create games link for admin&quot; do
<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;template.stub!(:logged_in?).and_return(true)<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; template.stub!(:admin?).and_return(true)<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;template.should have_tag(&#39;a&#39;,&#39;Create new game&#39;)<br>&gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;render &quot;/games/index.rhtml&quot;
<br>&gt; &gt; &gt;&nbsp;&nbsp; end<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; It says that it didn&#39;t show up<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; 1)<br>&gt; &gt; &gt;&nbsp;&nbsp;&#39;/games/index.rhtml should have a create games link for admin&#39; FAILED
<br>&gt; &gt; &gt; Expected at least 1 elements, found 0.<br>&gt; &gt; &gt; &lt;false&gt; is not true.<br>&gt; &gt; &gt; ./spec/views/games/index.rhtml_spec.rb:70:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Also all specs have a problem with the named route
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;&nbsp;&nbsp;ActionView::TemplateError in &#39;/games/index.rhtml should render a list<br>&gt; of<br>&gt; &gt; &gt; games for authenticated users&#39;<br>&gt; &gt; &gt;&nbsp;&nbsp;undefined local variable or method `new_games_path&#39; for
<br>&gt; &gt; &gt; #&lt;#&lt;Class:0x32bd2a4&gt;:0x32bb5bc&gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I am I suppose to stub the named route somehow?<br>&gt; &gt; &gt; since a link_to generates an anchor tag shouldn&#39;t of my spec have
<br>&gt; passed?<br>&gt; &gt;<br>&gt; &gt; What version of rspec/rspec_on_rails are you using?<br>&gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; On 10/1/07, David Chelimsky &lt; <a href="mailto:dchelimsky@gmail.com">
dchelimsky@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; &gt; On 10/1/07, Andrew WC Brown &lt;<a href="mailto:omen.king@gmail.com">omen.king@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; &gt; &gt; It didn&#39;t know what controller was, should it not know it what it is
<br>&gt; by<br>&gt; &gt; &gt; &gt; &gt; default or do I have to assign a controller at the top of my spec?<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; Try template instead, or @controller.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; The controller used in view specs is a generic controller that ships
<br>&gt; &gt; &gt; &gt; w/ rspec_on_rails, not the controller that is mapped to the view.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; On 10/1/07, Andrew WC Brown &lt; 
<a href="mailto:omen.king@gmail.com">omen.king@gmail.com</a> &gt; wrote:<br>&gt; &gt; &gt; &gt; &gt; &gt; The was really helpful, thanks David!<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &quot;There is no simple answer to your question. If anyone offers you
<br>&gt; one,<br>&gt; &gt; &gt; &gt; &gt; &gt; treat it with a grain of salt.&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; The game I&#39;m specing actually has an attribute called<br>&gt; grains_of_salt.
<br>&gt; &gt; &gt; &gt; &gt; &gt; No Lie.<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; On 10/1/07, David Chelimsky &lt; 
<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; On 10/1/07, Andrew WC Brown &lt; <a href="mailto:omen.king@gmail.com">omen.king@gmail.com</a> &gt; wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I&#39;m trying to spec a view but haven&#39;t done much view specing.<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; This view render different partials depending on
<br>&gt; authentication of<br>&gt; &gt; &gt; the<br>&gt; &gt; &gt; &gt; &gt; user:<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; annon, admin, player<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; So I I&#39;ll write if conditionals in the view with the partials
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; it &quot;should render signup propaganda for annon users trying<br>&gt; to<br>&gt; &gt; &gt; view
<br>&gt; &gt; &gt; &gt; &gt; games&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; render &quot;/games/index.rhtml&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; @logged_in?.should eql(false)
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; response.should<br>&gt; &gt; &gt; &gt; &gt; render_template(&#39;_signup_propaganda&#39;)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Now for my partial I know it&#39;ll be wrapped all in a div with a<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; class=&quot;signup_propaganda&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Should I be testing for that instead? Can I write expectations
<br>&gt; for<br>&gt; &gt; &gt; &gt; &gt; partials<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; similar to above?<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;When your specing views are you testing for the outputted
<br>&gt; &gt; &gt; results?<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; it &quot;should render signup propaganda for annon users trying<br>&gt; to<br>&gt; &gt; &gt; view<br>&gt; &gt; &gt; &gt; &gt; games&quot;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;render &quot;/games/index.rhtml&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@logged_in?.should eql(false)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
response.should have_tag(div,<br>&gt; &quot;class=/&quot;signup_propaganda/&quot;&quot;)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; How should I be writing my spec?
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; There is no simple answer to your question. If anyone offers you<br>&gt; &gt; &gt; one,<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; treat it with a grain of salt.
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Coding by example is a process. If you&#39;re doing it right, the<br>&gt; &gt; &gt; examples<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; are going to change as you progress. So in this case, I might
<br>&gt; start<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; like this:<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; it &quot;should render signup propaganda for annon users trying to<br>&gt; view<br>
&gt; &gt; &gt; &gt; &gt; games&quot; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; controller.stub!(:logged_in?).and_return(false)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; render &quot;/games/index.rhtml&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; 
response.should have_tag(&#39;div.signup_propaganda&#39;)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; The code to make this pass could just be:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &lt;div class=&#39;signup_propoganda&#39;/&gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; At this point I&#39;d want to add an example about what a logged in
<br>&gt; user<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; sees to force the conditional:<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; it &quot;should NOT render signup propaganda for logged in users
<br>&gt; trying<br>&gt; &gt; &gt; to<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; view games&quot; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; controller.stub!(:logged_in?).and_return(true)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; render &quot;/games/index.rhtml&quot;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; response.should_not have_tag(&#39;div.signup_propaganda&#39; )<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; leading to this code:
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &lt;% if logged_in? %&gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; &lt;div class=&#39;signup_propoganda&#39;/&gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &lt;% end %&gt;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; At some point down the line I might decide to extract the div to<br>&gt; a<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; partial. At *that* point, I should be able to do so without
<br>&gt; changing<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; the example. Once the partial has been extracted, then comes the<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; question about what to do with the example, and the answer will
<br>&gt; &gt; &gt; depend<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; on a few things.<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; If the partial is only ever used in this one template, and<br>&gt; requires
<br>&gt; &gt; &gt; no<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; additional setup, and the only reason I extracted it was to<br>&gt; clean up<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; the template, I might leave things as/is.<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Most of the time, however, I&#39;d change the examples to expect<br>&gt; that<br>&gt; &gt; &gt; the<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; partial gets rendered. First, I&#39;d create a new example for the
<br>&gt; &gt; &gt; partial<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; itself and move anything from the old example that was specific<br>&gt; to<br>&gt; &gt; &gt; the<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; content inside that partial. Only after that&#39;s done and all
<br>&gt; examples<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; are passing, I&#39;d change the original examples to look like this:<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; it &quot;should render signup propaganda for annon users trying to
<br>&gt; view<br>&gt; &gt; &gt; &gt; &gt; games&quot; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; controller.stub!(:logged_in?).and_return(false)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; template.expect_render(:partial =&gt; &#39;signup_propoganda&#39;)
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; render &quot;/games/index.rhtml&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; it &quot;should NOT render signup propaganda for logged in users
<br>&gt; trying<br>&gt; &gt; &gt; to<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; view games&quot; do<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; controller.stub!(:logged_in?).and_return(true)<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; 
template.expect_render (:partial =&gt; &#39;signup_propoganda&#39;).never<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp; render &quot;/games/index.rhtml&quot;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; end<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; HTH,<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; David<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; _______________________________________________
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; rspec-users mailing list<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;
<br>&gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________
<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; rspec-users mailing list<br>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; 
<a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; _______________________________________________<br>&gt; &gt; &gt; &gt; &gt; rspec-users mailing list<br>&gt; &gt; &gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">
rspec-users@rubyforge.org</a><br>&gt; &gt; &gt; &gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; _______________________________________________
<br>&gt; &gt; &gt; &gt; rspec-users mailing list<br>&gt; &gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; &gt; &gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">
http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; _______________________________________________<br>&gt; &gt; &gt; rspec-users mailing list
<br>&gt; &gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; &gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a>
<br>&gt; &gt; &gt;<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rspec-users mailing list<br>&gt; &gt; <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>&gt; &gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">
http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt; &gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; rspec-users mailing list<br>&gt; <a href="mailto:rspec-users@rubyforge.org">
rspec-users@rubyforge.org</a><br>&gt; <a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>&gt;<br>_______________________________________________<br>rspec-users mailing list
<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br>