I think that there is a lot of value to projects like shoulda-matchers
(which is separate from shoulda, the testing framework) and
remarkable. The idea is that you should not be testing the framework
(rails). That is, you should not be testing that defining a has_many
association creates a method on your model. You still need to test all
of your domain logic, which David's example shows.

Also, remarkable does work in rails 3. I am using it because it has a
matcher for accepts_nested_attributes_for, while shoulda-matchers does
not. Using this line in my Gemfile works:   gem
'remarkable_activerecord', '~> 4.0.0.alpha2'

Sam

On Thu, Jul 28, 2011 at 11:22 AM, Piter Fcbk <piter.f...@gmail.com> wrote:
> I was trying out RSpec framework in a project and got stopped doing the unit
> test of a model. In particular, doing the test for the associations and the
> ActiveRecord validations.
> I started writing the validations but my tests didn't look DRY at all.
> Before refactoring the tests checked out and look for other people
> solutions.
> I found out shoulda-matchers and Shoulda (which if I didn't get it wrong is
> another testing framework). Actually I found another one, remarkable, but it
> look it doesn't work with Rails 3.
> Does anyone have any advice, comments, suggestion on this matter?
> Right now I continue on using RSpec and shoulda-matchers. The last one
> mainly for testing the validations and associations of the models.
> Any advice and/or help will be appreciated.
> Thanks in advance.
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to