[rspec-users] issues with the trunk of rspec-rails

Pat Nakajima patnakajima at gmail.com
Tue Feb 10 17:45:22 EST 2009


>
> (3) with_tag is completely broken, as it tries to use the outer class as
> the subject of 'with_tag', rather than the have_tag matcher that it lives
> inside.
>

If you're testing markup (view tests or whatever), take a look at my
elementor project[1]. I've found that it makes view testing a lot more
expressive, a lot less brittle, and a lot more fun! (Ok, maybe not the last
bit). It also uses Nokogiri, so it's much faster than have_tag.

1. http://github.com/nakajima/elementor/tree/master

Pat

On Tue, Feb 10, 2009 at 3:02 PM, Nathan Wilmes <nathan at pivotallabs.com>wrote:

> Hi folks,
>
> I'm currently in the process of upgrading an old Rails project to the Rails
> 2.2.2 and the trunk of RSpec, and ran into several issues with rspec-rails.
> I've come up with workarounds for all of them, but I wanted to report them
> to hopefully get them into better shape for other folks.
>
> (1) config.include doesn't work on controller, helper, or view specs if no
> :type parameter is required.
>
> config.include sends an include to RailsExampleGroup.  Unfortunately, these
> specs no longer extend RailsExampleGroup.  Here's my monkey patch:
> module Spec
>   module Runner
>     class Configuration
>       def get_type_from_options(options)
>         options[:type] || options[:behaviour_type] || [:controller, :model,
> :view, :helper, nil]
>       end
>     end
>   end
> end
>
> (2) The render override for RSpec controllers only takes one argument.
> This means that any controller using two argument forms will fail.
>
> Our biggest use case for the two-argument controller form is this:  render
> :update, :status => 404 do {}
> This case is still allowable and not deprecated in Rails 2.2.2.
>
> (3) with_tag is completely broken, as it tries to use the outer class as
> the subject of 'with_tag', rather than the have_tag matcher that it lives
> inside.
>
> (4) assigns(:xxx) will give really bad errors if your class doesn't happen
> to define == in such a way that it can equate to FalseClass.
>
> Let me know if you'd like examples or extra explanation.
> =N
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090210/133f951e/attachment-0001.html>


More information about the rspec-users mailing list