Created
October 6, 2011 16:23
-
-
Save andrewpthorp/1267848 to your computer and use it in GitHub Desktop.
Preference for helper specs?
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
# Option 1: | |
# Use content to separate the helper from the spec | |
it "should have something" do | |
content = helper.some_helper_method | |
content.should have_tag('a', :text => 'foo') | |
end | |
# Option 2: | |
# Combine helper call and spec | |
it "should have something" do | |
helper.some_helper_method.should have_tag('a', :text => 'bar') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment