Permalink
Browse files

more, more, more

  • Loading branch information...
1 parent 4fca482 commit 7e2e7c5472f8c09c635e16ed5880e7ae0b548fc8 @dchelimsky committed Oct 13, 2009
View
BIN RSpecTips.key → BeyondBasics.key
Binary file not shown.
View
8 code/railsapp/spec/helpers/accounts_helper_spec.rb
@@ -2,6 +2,7 @@
Spec::Matchers.define :match_dom do |expected|
extend ActionController::TestCase::Assertions
+ extend Test::Unit::Assertions
match do |actual|
wrapped_assertion do
assert_dom_equal expected, actual
@@ -15,7 +16,12 @@
account = mock_model(Account, :id => "37", :name => "David")
assert_dom_equal %Q{<a href="/accounts/37">David's account</a>}, helper.link_to_account(account)
end
-
+
+ it "renders a link to the account" do
+ account = mock_model(Account, :id => "37", :name => "David")
+ helper.link_to_account(account).should match_dom(%Q{<a href="/accounts/37">David's account</a>})
+ end
+
it "does not render a link to another account" do
account = mock_model(Account, :id => "37", :name => "David")
helper.link_to_account(account).should_not match_dom(%Q{<a href="/accounts/38">David's account</a>})

0 comments on commit 7e2e7c5

Please sign in to comment.