kucaahbe/rspec2-rails-views-matchers — Issue #10: The tag contents isn't always a string (no method `gsub')
Author: cimm
Created: 2011-10-19 21:24:12+00:00
State: open

The `rspec2-rails-views-matchers` expect a string while it's not always the case. Take the following example where I want to show a simple integer:

it "shows the price of the item" do
price = 100
render
rendered.should have_tag("#price", :text => price)
end

Returns the following error:

Failure/Error: rendered.should have_tag(".total_amount", :text => price)
NoMethodError:
undefined method `gsub' for 100:Fixnum

This makes it impossible to use integers (or mocks or any other object) with the gem.