jrgifford/delayed_paperclip — pull request #80 by pluff (2014-03-25 13:13:43+00:00)
Title: Fixed issue with incorrect processing flag after second save

This PR fixes the problem described in #54 and potentially in #52.

However I need a little help from community with this PR. I have a problem with fixing integration tests for rspec. It seems like integration tests are not isolated from each other. E.g.
```
rspec spec/integration/resque_spec.rb
...
Failed examples:

rspec ./spec/integration/examples/base.rb:142 # Resque integration tests urls returns missing url until job is finished
rspec ./spec/integration/examples/base.rb:155 # Resque integration tests urls processing url returns processing url while processing
rspec ./spec/integration/examples/base.rb:173 # Resque integration tests urls same url if same file assigned falls to missing while processing
rspec ./spec/integration/examples/base.rb:193 # Resque integration tests callbacks paperclip callback observes after_image_post_process
rspec ./spec/integration/examples/base.rb:205 # Resque integration tests callbacks after_update callback hits after_update
rspec ./spec/integration/examples/base.rb:252 # Resque integration tests converts image formats observes the option
rspec ./spec/integration/examples/base.rb:270 # Resque integration tests reprocess_without_delay does not increase jobs count
rspec ./spec/integration/examples/base.rb:300 # Resque integration tests reprocessing_url interpolation of styles interpolates unporcessed image
rspec ./spec/integration/examples/base.rb:315 # Resque integration tests reprocessing_url proc for reprocessing_url calls it correctly
```
However if I comment out [this independent context block](https://github.com/jrgifford/delayed_paperclip/blob/master/spec/integration/examples/base.rb#L106-L118) there is much less failed tests:
```
Failed examples:

rspec ./spec/integration/examples/base.rb:252 # Resque integration tests converts image formats observes the option
rspec ./spec/integration/examples/base.rb:270 # Resque integration tests reprocess_without_delay does not increase jobs count
rspec ./spec/integration/examples/base.rb:300 # Resque integration tests reprocessing_url interpolation of styles interpolates unporcessed image
rspec ./spec/integration/examples/base.rb:315 # Resque integration tests reprocessing_url proc for reprocessing_url calls it correctly
```

The underlying problem of all failing test is that for some reason `Paperclip::Attachment` does respond to `process!` for the first test and does not repsond to `process!` in subsequent tests.

Did anyone faced similar problem before? The lib works fine in production, however I still can't get why testcase behaves so weird.