Skip to content

Commit

Permalink
more, more, more
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 13, 2009
1 parent 4fca482 commit 7e2e7c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Binary file renamed RSpecTips.key → BeyondBasics.key
Binary file not shown.
8 changes: 7 additions & 1 deletion code/railsapp/spec/helpers/accounts_helper_spec.rb
Expand Up @@ -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
Expand All @@ -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>})
Expand Down

0 comments on commit 7e2e7c5

Please sign in to comment.