Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-08 Thread Frank J. Mattia
> Here's a stripped down excerpt from my controller spec. I know how > Order.should_receive(:method) works, but how do I translate that to an > instance variable? I've tried assigns(:order).should_receive to no > avail. Also, where do I put it? Above the post line won't work because > @order doesn'

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-08 Thread Frank J. Mattia
> > My controller does something like this for create > > @object = Object.new(params[:object]) > > @object.created_by = current_user > > if @object.save... yadda yadda yadda... > > > I have my model spec testing for the presence of created_by but I feel > > compelled to test that my controller is

Re: [rspec-users] rspec-rails how to selectively turn on csrf protection for controller specs?

2010-07-08 Thread Phillip Koebbe
On 2010-07-08 12:15 PM, Wincent Colaiuta wrote: El 08/07/2010, a las 18:36, nruth escribió: I'm setting up a Paypal IPN listener and need the create action to not use rails' default CSRF protection. I've got that working fine& test it actually works with cucumber (where I've turned CSRF back

Re: [rspec-users] RSpec TM bundle question

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 2:37 PM, Jay McGaffigan wrote: > a little more investigation shows that the bundle is really having > trouble loading the 'spec/autorun' file in mate.rb > > it appears that rubygems is not loaded (I'm not using bundler on this > project (yet)). > > If I mod mate.rb to require

Re: [rspec-users] RSpec TM bundle question

2010-07-08 Thread Jay McGaffigan
a little more investigation shows that the bundle is really having trouble loading the 'spec/autorun' file in mate.rb it appears that rubygems is not loaded (I'm not using bundler on this project (yet)). If I mod mate.rb to require rubygems before requiring spec/autorun things seem to work... No

[rspec-users] RSpec TM bundle question

2010-07-08 Thread Jay
does the RSpec TM bundle require that one have the RSpec 2 prerelease version installed? When I try to use the latest TMBundle I get a can't find rspec/core error ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listin

[rspec-users] RSpec.tmbundle failure after removing at_exit hook

2010-07-08 Thread David Chelimsky
Hey all, Following up on the problem with textmate after removing the at_exit hook (see http://groups.google.com/group/rspec/browse_thread/thread/37bbe78aa52682b0): The problem is that the file(s) do(es) not get loaded by the rspec runner. They appear to be required by TextMate prior to invokin

[rspec-users] experimental branch with no at_exit hook

2010-07-08 Thread David Chelimsky
Hey all, I've got an experimental branch of rspec-core-2 that removes the at_exit hook: http://github.com/rspec/rspec-core/tree/no-at-exit. It works just fine with the rake and rspec commands, as well as spork. You can use it with the ruby command if you include "-S rspec" (avoiding this was on

Re: [rspec-users] rspec-rails how to selectively turn on csrf protection for controller specs?

2010-07-08 Thread Wincent Colaiuta
El 08/07/2010, a las 18:36, nruth escribió: > I'm setting up a Paypal IPN listener and need the create action to not > use rails' default CSRF protection. > > I've got that working fine & test it actually works with cucumber > (where I've turned CSRF back on, since it's full-stack testing) but >

Re: [rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-08 Thread Wincent Colaiuta
El 08/07/2010, a las 18:17, Frank J. Mattia escribió: > My controller does something like this for create > @object = Object.new(params[:object]) > @object.created_by = current_user > if @object.save... yadda yadda yadda... > > I have my model spec testing for the presence of created_by but I fee

[rspec-users] rspec-rails how to selectively turn on csrf protection for controller specs?

2010-07-08 Thread nruth
I'm setting up a Paypal IPN listener and need the create action to not use rails' default CSRF protection. I've got that working fine & test it actually works with cucumber (where I've turned CSRF back on, since it's full-stack testing) but would like my controller spec to mention the need for pro

[rspec-users] (rspec2/rails3) spec'ing the details of a controller that is not purely *skinny* by design.

2010-07-08 Thread Frank J. Mattia
Looks like I didn't read the instructions before posting... I'm hoping that the "moderator" is /dev/null - otherwise this might come up as a repost. Anyway. I want my controller to set certain attributes on #create and #update (mostly created_by, updated_by... etc.) -- implementing this is easy. T

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread Andrew Premdas
On 8 July 2010 11:46, David Chelimsky wrote: > On Jul 8, 2010, at 4:24 AM, Andrew Premdas wrote: > > On 8 July 2010 01:01, David Chelimsky wrote: > >> On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: >> >> > Hi there. >> > >> > My understanding (which is limited) is that rspec uses at_exit to r

Re: [rspec-users] Accessing view helpers to spec cell views, Rails3, RSpec2

2010-07-08 Thread doug livesey
Perfect, thankyou! :) On 8 July 2010 11:58, David Chelimsky wrote: > On Jul 8, 2010, at 4:29 AM, doug livesey wrote: > > Hi -- I'm trying to use the excellent Cells gem > in a Rails 3 project with RSpec 2. > I've got the 'controller' bit of the cells specced okay, b

Re: [rspec-users] Testing equality

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 5:04 AM, Juanma Cervera wrote: > Hello > How can I test equality with two objects when they include some > attribute that is BigDecimal? > > if I make something like this: > > it "should ...whatever" do > obj = Factory.create(:my_object) > ... > MyObject.first.should == obj

Re: [rspec-users] Accessing view helpers to spec cell views, Rails3, RSpec2

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 4:29 AM, doug livesey wrote: > Hi -- I'm trying to use the excellent Cells gem in a Rails 3 project with > RSpec 2. > I've got the 'controller' bit of the cells specced okay, but I'm struggling > with the 'view' bit. > What I want to do is to use RSpec's view helper methods to

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 4:24 AM, Andrew Premdas wrote: > On 8 July 2010 01:01, David Chelimsky wrote: > On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: > > > Hi there. > > > > My understanding (which is limited) is that rspec uses at_exit to run its > > specs. I don't really know why - could somoen

Re: [rspec-users] How to test an app with multiple databases?

2010-07-08 Thread David Chelimsky
On Jul 8, 2010, at 2:27 AM, Juanma Cervera wrote: > Ben Mabey wrote: >> Spec::Runner.configure do |c| >> c.before(:each) do >>ActiveRecord::Base::establish_connection :secondary_db >>DatabaseCleaner.start >>ActiveRecord::Base::establish_connection :primary_db >> end >> >> c.after(

[rspec-users] Testing equality

2010-07-08 Thread Juanma Cervera
Hello How can I test equality with two objects when they include some attribute that is BigDecimal? if I make something like this: it "should ...whatever" do obj = Factory.create(:my_object) ... MyObject.first.should == obj end. FAILS This fails because the object expected is different fr

[rspec-users] Accessing view helpers to spec cell views, Rails3, RSpec2

2010-07-08 Thread doug livesey
Hi -- I'm trying to use the excellent Cells gem in a Rails 3 project with RSpec 2. I've got the 'controller' bit of the cells specced okay, but I'm struggling with the 'view' bit. What I want to do is to use RSpec's view helper methods to render the views, but don't kn

Re: [rspec-users] RSpec uses at_exit - forks and stuff

2010-07-08 Thread Andrew Premdas
On 8 July 2010 01:01, David Chelimsky wrote: > On Jul 7, 2010, at 8:22 AM, Andrew Premdas wrote: > > > Hi there. > > > > My understanding (which is limited) is that rspec uses at_exit to run its > specs. I don't really know why - could somoene explain? > > The initial motivation was that it makes

Re: [rspec-users] rspec rake tasks fail inside active record

2010-07-08 Thread andreyr
Hi David, it would be difficult to do as I would need to post something like 15 files that are used in the spec file, otherwise the code would make no sense. However, I have solved the problem. While trying to make a meaningful example for you, I narrowed the problem down to the single line of c

Re: [rspec-users] How to test an app with multiple databases?

2010-07-08 Thread Juanma Cervera
Ben Mabey wrote: > Spec::Runner.configure do |c| > c.before(:each) do > ActiveRecord::Base::establish_connection :secondary_db > DatabaseCleaner.start > ActiveRecord::Base::establish_connection :primary_db > end > > c.after(:each) do > ActiveRecord::Base::establish_connection