Re: [rspec-users] testing around_save

2012-02-24 Thread apneadiving
do document.status_progress document.status.should eq "in_progress" end end On Feb 24, 2:36 am, David Chelimsky wrote: > On Feb 23, 2012, at 3:36 PM, apneadiving wrote: > > > I've just upgraded to Rails 3.2.1 and I can't get

[rspec-users] testing around_save

2012-02-23 Thread apneadiving
I've just upgraded to Rails 3.2.1 and I can't get my specs checking whether or not around_save work anymore. I simply did something like: object.should_receive :around_filter_name object.save.should be_true (Actually, it was slightly more complex, it's part of a state machine) __

[rspec-users] rails memoize and reload class => error raised

2012-02-03 Thread apneadiving
Hi, That's a bit off topic but since I use Spork + Rspec... Well, my classes are reloaded between each test wave so Rails' "memoize" method raises an error (which is expected, see code: http://rubydoc.info/docs/rails/3.0.0/ActiveSupport/Memoizable:memoize) Anyone resolved this issue with an eleg

Re: [rspec-users] method calls count weirdness...

2012-01-27 Thread apneadiving
Sorry, the mistake came from the factory itself. Indeed, the Factory call I really make is slightly different and for a still unknown reason (asked on factory girl google's group), the build method actually created the object... On Jan 27, 5:14 pm, apneadiving wrote: > Hi, > >

[rspec-users] method calls count weirdness...

2012-01-27 Thread apneadiving
Hi, I see a really weird behavior there, the following test passes: it "test", :focus do doc = Factory.build(:document) doc.should_receive(:update_project!).exactly(2).times doc.save end But when I do: def update_project! binding.pry #some stuff end I enter the method 3 time

Re: [rspec-users] Testing an API I'm creating, need test server to be running

2012-01-17 Thread apneadiving
; > > On Jan 14, 2012, at 8:40 AM, apneadiving wrote: > > >> As I am writing a brand new API, I'd like to test it's response. > > > >> Basically, it would be great in my case to test if ActiveResource gets > >> the expected data but it me

[rspec-users] Testing an API I'm creating, need test server to be running

2012-01-14 Thread apneadiving
Hi, As I am writing a brand new API, I'd like to test it's response. Obviously, controller tests are great and work like a charm but as I expose data which are not really resources, I've to make some DIY to provide responses that ActiveResource can handle properly. Basically, it would be great i

Re: [rspec-users] why is 'get :index, :page => 2' different from 'get :index, :page => "2"'

2012-01-05 Thread apneadiving
On Jan 6, 12:55 am, David Chelimsky wrote: > On Thu, Jan 5, 2012 at 5:45 PM, apneadiving > wrote: > > Hi, > > > After coding my app and enjoying a green wave of tests, I had horrible > > feedback about some bugs. > > > Those bugs happened to some well test

[rspec-users] why is 'get :index, :page => 2' different from 'get :index, :page => "2"'

2012-01-05 Thread apneadiving
Hi, After coding my app and enjoying a green wave of tests, I had horrible feedback about some bugs. Those bugs happened to some well tested parts of my app. After some research, I found out that get :index, :page => 2, :per_page => 5 is different from: get :index, :page => "2", :per_page =>

[rspec-users] Rack application timed out during boot

2011-04-02 Thread apneadiving
Hi, I'm using Rspec + Capybara in Rails3. My integration tests went well today until I couldn't even access a page with simple requests such as: visit root_path With error: Rack application timed out during boot Any idea of what's going on? ___

[rspec-users] Rails Rspec Capybara Testing Javascript

2011-04-02 Thread apneadiving
I'm testing a Rails 3 app with Rspec and Capybara. For my integration tests, I need to test javascript. Of course, I watched http://railscasts.com/episodes/257-request-specs-and-capybara which presents the basics very well. Unfortunately an error is raised in the javascript as I can see using sav