The main problem I see with this solution is that not so many plugins out there have RSpec tests and so it can be boring to have to run autotest and rspec_autotest in parralel to be sure both RSpec and Test::Unit tests passes.

I’m waiting for your comments on notifier/observer specs, I didn’t see any examples of them in rspec and I’m not sure of the best way to spec them. For example, UserNotifier is an ActionMailer and resides in models directory, but it acts more like a controller (render views), well you see the point.

Yurii,
thanks for you comments, I noticed that when I switched to UTC.

By Jason
27/01/2007 at 01h47

Hi
New to RSpec. Have a clean implementation of restful_authentication. Cannot get “should_not_be_activated” to pass.
What method is this testing? The activation_key and activated_at attributes are both nil in the test output. Bit confused.

Jason,
it seems your user is not created because of duplicate user login in database, hence the before_create callback is not called in User model and the activation code is not generated and stored in activation_key.

About the !!, it’s not a particular syntax. I don’t really understand the need to double-negate a statement… so I assume the author has his reason :)

By Jason
31/01/2007 at 13h56

I’ve asked on the Newcastle ruby mail list and considered opinion is that double-bang is a double negative (try it out in irb), and therefore probably unnecessary.

I also think checking activation using activation_key attribute is wrong and activated_at attribute should be used.

Still can’t get tests to pass on this method (spec can’t find the method), but I’ve found that adding

teardown do
end

has helped fix the “already been taken” errors.

By Scott Brown
13/02/2007 at 21h04

This sounds great, but I’m getting a 404 on all of the download links.

David : I thinks one step is to check your observer is observing the right class first, this could be done with : ActiveRecord::Observer#observed_class class method.
To test the other way around, the ActiveRecord::observers class methods (mixed-in from ActiveRecord::Observing) should do it.