Created
April 10, 2010 18:22
-
-
Save albanpeignier/362213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Inspired from @iain_nl post : | |
| # http://iain.nl/2009/04/rspec-shoulda-and-custom-matchers/ | |
| module LinkToMatcher | |
| include Spec::Rails::Matchers | |
| def have_link_to(url) | |
| AssertSelect.new(:assert_select, self, "a[href=#{url}]") | |
| end | |
| end | |
| Spec::Runner.configure do |config| | |
| config.include LinkToMatcher, :type => :view | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment