It looks like your test database does not have the users table.<br><br>I think you need to migrate your test database. Rails will clone the test database from the development database.<br>I&#39;m not sure if Merb does this.
<br><br><div><span class="gmail_quote">On 5/9/07, <b class="gmail_sendername">Gregory O&#39;Connor</b> &lt;<a href="mailto:goconnor@plumtv.com">goconnor@plumtv.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;">
<div style=""><div>Hi Brian,</div><div>thank you for rspec on merb. hoping to follow your example, the starting point is simply merb and</div><div>mrblog at Revision 233 with the single change to spec_helper.rb for my local mrblog_test database
</div><div>the only spec is the checked out user_spec.rb&nbsp;</div><span class="q"><div><br></div><blockquote type="cite">Did you get any exceptions related to loading the fixtures?<br>Are you using the fixtures method in the Behaviour block?
</blockquote></span><div>there are no exceptions related to loading the fixtures the tables are not created&nbsp; (see below)</div><div>user_spec.rb does use the fixture method in the Behavior block.</div><div><br></div><div>output from a spec -b on this spec file is shown below with edits to reduce the length of this post.
</div><div>let me know if i&#39;ve missed something in my setup or if i can provide more information.</div><div>regards,</div><div>greg</div><div><br></div><div>$ pwd</div><div>~/Sites/mrblog/trunk</div><div><br></div><div>
$ spec -v</div><div>RSpec-0.9.3 (r1916) - BDD for Ruby</div><div><font color="#0000ee"><span style="text-decoration: underline;"><br></span></font></div><div>$ spec -b test/spec/models/user_spec.rb&nbsp; &nbsp; &nbsp; </div><div>merb init called
</div><div>ActiveRecord session mixed in</div><div>Rails session compatibilty on.</div><div>FFFFFFFF</div><div><br></div><div>1)</div><div>ActiveRecord::StatementInvalid in &#39;User being authenticated should create user&#39;
</div><div>Mysql::Error: Table &#39;mrblog_test.users&#39; doesn&#39;t exist: SHOW FIELDS FROM users</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:243:in `execute&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:348:in `columns&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:763:in `columns&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/calculations.rb:257:in `column_for&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/calculations.rb:116:in `calculate&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/calculations.rb:45:in `count&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/change.rb:28:in `send&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/change.rb:28:in `execute_change&#39;</div><div>
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/matchers/change.rb:20:in `matches?&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/expectations/handler.rb:14:in `handle_matcher&#39;</div><div>
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/expectations/extensions/object.rb:32:in `should&#39;</div><div>./test/spec/models/user_spec.rb:8:</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:73:in `instance_eval&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:73:in `run_example&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:23:in `run&#39;</div><div>/opt/local/lib/ruby/1.8/timeout.rb:48:in `timeout&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:21:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/behaviour.rb:70:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-
0.9.3/lib/spec/dsl/behaviour.rb:67:in `each&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/behaviour.rb:67:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:45:in `run_behaviours&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:44:in `each&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:44:in `run_behaviours&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:27:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/command_line.rb:17:in `run&#39;</div><div>
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/bin/spec:3:</div><div>/opt/local/bin/spec:16:in `load&#39;</div><div>/opt/local/bin/spec:16:</div><div><br></div><div>2)</div><div>ActiveRecord::StatementInvalid in &#39;User being authenticated should require login&#39;
</div><div>Mysql::Error: Table &#39;mrblog_test.users&#39; doesn&#39;t exist: SHOW FIELDS FROM users</div><div><br></div><div><br></div><div>3)</div><div>ActiveRecord::StatementInvalid in &#39;User being authenticated should require password&#39;
</div><div>Mysql::Error: Table &#39;mrblog_test.users&#39; doesn&#39;t exist: SHOW FIELDS FROM users</div><div><br></div><div><br></div><div>4)</div><div>ActiveRecord::StatementInvalid in &#39;User being authenticated should require password confirmation&#39;
</div><div>Mysql::Error: Table &#39;mrblog_test.users&#39; doesn&#39;t exist: SHOW FIELDS FROM users</div><div><br></div><div><br></div><div>5)</div><div>ActiveRecord::StatementInvalid in &#39;User being authenticated should require email&#39;
</div><div>Mysql::Error: Table &#39;mrblog_test.users&#39; doesn&#39;t exist: SHOW FIELDS FROM users</div><div><br></div><div><br></div><div>6)</div><div>NoMethodError in &#39;User being authenticated should reset password&#39;
</div><div>undefined method `[]&#39; for nil:NilClass</div><div>/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixtures.rb:498:in `users&#39;</div><div>./test/spec/models/user_spec.rb:32:</div><div>
/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:73:in `instance_eval&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:73:in `run_example&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-
0.9.3/lib/spec/dsl/example.rb:23:in `run&#39;</div><div>/opt/local/lib/ruby/1.8/timeout.rb:48:in `timeout&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/example.rb:21:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-
0.9.3/lib/spec/dsl/behaviour.rb:70:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/behaviour.rb:67:in `each&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/behaviour.rb:67:in `run&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:45:in `run_behaviours&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:44:in `each&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:44:in `run_behaviours&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/behaviour_runner.rb:27:in `run&#39;
</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/runner/command_line.rb:17:in `run&#39;</div><div>/opt/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/bin/spec:3:</div><div>/opt/local/bin/spec:16:in `load&#39;</div>
<div>/opt/local/bin/spec:16:</div><div><br></div><div>7)</div><div>NoMethodError in &#39;User being authenticated should not rehash password&#39;</div><div>undefined method `[]&#39; for nil:NilClass</div><div><br></div><div>
<br></div><div>8)</div><div>NoMethodError in &#39;User being authenticated should authenticate user&#39;</div><div>undefined method `[]&#39; for nil:NilClass</div><div><br></div><div>Finished in 0.14894 seconds</div><div>
<br></div><div>8 examples, 8 failures</div><div><span class="e" id="q_11270f37b3628318_3"><div><br></div><br><div><div>On May 9, 2007, at 3:26 AM, Brian Takita wrote:</div><br><blockquote type="cite">Grag,<br><br>Thanks for trying the Rspec on Merb plugin out.
<br><br>Did you get any exceptions related to loading the fixtures?<br>Are you using the fixtures method in the Behaviour block?<br><br>Maybe it would be easier post your spec at: <br><a href="http://pastie.caboo.se/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://pastie.caboo.se/</a><br>and reply with the link.<br><br>Thanks,<br>Brian<br><br><div><span class="gmail_quote">On 5/8/07, <b class="gmail_sendername">Gregory O&#39;Connor</b> &lt; <a href="mailto:goconnor@plumtv.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
goconnor@plumtv.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;">Hey Brian and Ezra, <br>thank you both for this very interesting code.
<br>it&#39;s exciting to easily upload a couple of 1.5G files at the same time.<br><br>rake specs<br>fails for me as the fixtures/users.yml is not loaded (after editing<br> the test/spec/spec_helper.rb for my database).<br>
<br>also looking at why the progress bar doesn&#39;t work for me out of the<br>box. of course the file upload ability is awesome.<br><br>regards,<br>gregory o&#39;connor<br> &gt; On 5/4/07, Ezra Zygmuntowicz &lt;ez at <a href="http://engineyard.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
engineyard.com</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On May 4, 2007, at 3:29 PM, Brian Takita wrote:<br>&gt; &gt;<br>&gt; &gt; &gt; A couple days ago I submitted a patch, that was committed by Ezra, <br>&gt; &gt; &gt; to the MrBlog project for the Rspec on Merb plugin.
<br>&gt; &gt; &gt; So far, it only works with ActiveRecord including fixtures.<br>&gt; &gt; &gt; Has any played with it? If so, did you get it to work? <br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I&#39;m going to be submitting a patch for Controller specs soon. It
<br>&gt; &gt; &gt; will be very bare bones, given my current lack of understanding of<br>&gt; &gt; &gt; Merb controller development. <br>&gt; &gt; &gt; View and Helper specs will follow.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I saw the question on IRC, but should ROM be folded into Merb
<br>&gt; &gt; &gt; itself, or act as a plugin? There are advantages and disadvantages <br>&gt; &gt; &gt; to both.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; A pull to integrate classes into Merb is that these classes can be<br>&gt; &gt; &gt; reused by Test::Unit tests and Rspec.
<br>&gt; &gt; &gt; A pull to keep classes in a plugin is It can change whenever Merb <br>&gt; &gt; &gt; or Rspec changes. Since both Merb and Rspec are rapidly evolving,<br>&gt; &gt; &gt; there may be a need for the plugin for a while.
<br>&gt; &gt; &gt; Since Test::Unit is fairly static, there may not be a need to make <br>&gt; &gt; &gt; the Test::Unit library a plugin.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; One flaw with Rails, that I hope does not get repeated in Merb, is
<br>&gt; &gt; &gt; the tight coupling with Test;:Unit (same with tight coupling with <br>&gt; &gt; &gt; Rspec). Of course Rspec did not exist when Rails was first<br>&gt; &gt; &gt; developed, so this should not be much of a problem as long as we
<br>&gt; &gt; &gt; are vigilant. :)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Brian <br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Hey Brian-<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I was able to get the user specs running in mrblog trunk. I
<br>&gt; &gt; commited<br>&gt; &gt; a rake task to run them as &#39;rake specs&#39;.&nbsp;&nbsp;The presence of a spec <br>&gt; &gt; harness makes the need for proper environments in merb urgent. I<br>&gt; will<br>&gt; &gt; hack up environments with different db settings this weekend so it
<br>&gt; &gt; will make testing and deving easier. <br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I think that we should keep it as a plugin for a little<br>&gt; while. I<br>&gt; &gt; don&#39;t want to go down the tightly coupled road in merb&#39;s testing
<br>&gt; &gt; capabilities. I think there are some core helper classes I need to <br>&gt; &gt; write that could go in the framework and be used by test/unit or<br>&gt; &gt; rspec or whatver. Like a helper for making requests thru the
<br>&gt; &gt; dispacther and controllers to test output without booting a <br>&gt; &gt; webserver, and some other stuff that will help with testing.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&#39;d like to see the test helpers that are merb specific
<br>&gt; made into<br>&gt; &gt; libraries within merb that you can use from test/unit, test/spec or <br>&gt; &gt; rspec.<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks for getting this started Brian, it&#39;s a nice<br>&gt; plugin. If you
<br>&gt; &gt; have any questions about merb internals please feel free to ask<br>&gt; and I <br>&gt; &gt; will help you grok it quickly.<br>&gt;<br>&gt;<br>&gt; Great. Thanks Ezra.<br>&gt;<br>&gt; I submitted a patch for a frist stab at controller specs.
<br>&gt; <a href="http://merb.devjavu.com/projects/merb/ticket/45" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://merb.devjavu.com/projects/merb/ticket/45</a><br>&gt;<br>&gt; Here are some things of consideration:
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- response.should redirect_to and response.should<br>&gt; render_template and<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;not implemented yet. <br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- The controller Description class has a controller_class<br>&gt; accessor. If<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;the first argument of describe is set to the controller class,<br>&gt; the examples<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;will know that the requests are for the controller. <br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- I couldn&#39;t figure out how to construct the correct uri given the
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;controller and the action.<br>&gt;<br>&gt;<br>&gt; Cheers-<br>&gt; &gt; -- Ezra Zygmuntowicz<br>&gt; &gt; -- Lead Rails Evangelist <br>&gt; &gt; -- ez at <a href="http://engineyard.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
engineyard.com</a><br>&gt; &gt; -- Engine Yard, Serious Rails Hosting<br>&gt; &gt; -- (866) 518-YARD (9273)<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br><br><br>_______________________________________________ <br>Merb-devel mailing list
<br><a href="mailto:Merb-devel@rubyforge.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Merb-devel@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/merb-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://rubyforge.org/mailman/listinfo/merb-devel</a><br></blockquote> </div><br></blockquote></div><br></span></div></div></blockquote></div><br>