Whenever I use a matcher like response.should have_text in an integration test I receive the following error: undefined method `has'' for #<ActionController::Integration::Session: 0x7fe07d184038> Any idea why that is and how to fix it? Thanks!
Nicolás Sanguinetti
2010-Feb-21 23:30 UTC
[rspec-users] undefined method `has'' in integration test
On Sun, Feb 21, 2010 at 9:25 PM, drewB <dbatshaw at gmail.com> wrote:> Whenever I use a matcher like response.should have_text in an > integration test I receive the following error: > > undefined method `has'' for #<ActionController::Integration::Session: > 0x7fe07d184038> > > Any idea why that is and how to fix it?I think?not sure?those matchers are provided by webrat, so probably you''re not requiring it?> Thanks! > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2010-Feb-21 23:50 UTC
[rspec-users] undefined method `has'' in integration test
On Sun, Feb 21, 2010 at 5:25 PM, drewB <dbatshaw at gmail.com> wrote:> Whenever I use a matcher like response.should have_text in an > integration test I receive the following error: > > undefined method `has'' for #<ActionController::Integration::Session: > 0x7fe07d184038> > > Any idea why that is and how to fix it?What versions of rails, rspec, and ruby are you using? Also, where is the file in question and how are you running it?
I require webrat in spec_helper (Spork.prefork). versions: rails 2.1.2 rspec 1.3.0 rspec-rails 1.3.2 ruby 1.8.7 The file is located at ''spec/integration/landing_page/ Ianding_page_spec.rb''. I am running ''spec spec/integration/ landing_page/landing_page_spec.rb'' I am also using the rspec-integration plugin (http://github.com/ tricycle/rspec-integration). While investigating further, I found that removing the plugin causes other matchers to stop working (e.g. response.should be_success). I am guessing that no matchers are available by default when using rspec for integration testing (outside of cucumber) at least the way I have it set up. On Feb 21, 3:50?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Sun, Feb 21, 2010 at 5:25 PM, drewB <dbats... at gmail.com> wrote: > > Whenever I use a matcher like response.should have_text in an > > integration test I receive the following error: > > > undefined method `has'' for #<ActionController::Integration::Session: > > 0x7fe07d184038> > > > Any idea why that is and how to fix it? > > What versions of rails, rspec, and ruby are you using? Also, where is > the file in question and how are you running it? > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Any thoughts on how to get the matchers included? On Feb 21, 4:23?pm, drewB <dbats... at gmail.com> wrote:> I require webrat in spec_helper (Spork.prefork). > > versions: > > rails 2.1.2 > rspec 1.3.0 > rspec-rails 1.3.2 > ruby 1.8.7 > > The file is located at ''spec/integration/landing_page/ > Ianding_page_spec.rb''. I am running ''spec spec/integration/ > landing_page/landing_page_spec.rb'' > > I am also using the rspec-integration plugin (http://github.com/ > tricycle/rspec-integration). ?While investigating further, I found > that removing the plugin causes other matchers to stop working (e.g. > response.should be_success). ?I am guessing that no matchers are > available by default when using rspec for integration testing (outside > of cucumber) at least the way I have it set up. > > On Feb 21, 3:50?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Sun, Feb 21, 2010 at 5:25 PM, drewB <dbats... at gmail.com> wrote: > > > Whenever I use a matcher like response.should have_text in an > > > integration test I receive the following error: > > > > undefined method `has'' for #<ActionController::Integration::Session: > > > 0x7fe07d184038> > > > > Any idea why that is and how to fix it? > > > What versions of rails, rspec, and ruby are you using? Also, where is > > the file in question and how are you running it? > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users