]> git.openstreetmap.org Git - rails.git/blob - test/helpers/changeset_helper_test.rb
Use node and old_node factories for redaction model tests.
[rails.git] / test / helpers / changeset_helper_test.rb
1 require "test_helper"
2
3 class ChangesetHelperTest < ActionView::TestCase
4   fixtures :changesets, :users
5
6   def test_changeset_user_link
7     assert_equal "<a href=\"/user/test2\">test2</a>", changeset_user_link(changesets(:public_user_first_change))
8     assert_equal "anonymous", changeset_user_link(changesets(:normal_user_first_change))
9     assert_equal "deleted", changeset_user_link(changesets(:deleted_user_first_change))
10   end
11
12   def test_changeset_details
13     assert_match %r{^Created <abbr title='Mon, 01 Jan 2007 00:00:00 \+0000'>.*</abbr> by anonymous$}, changeset_details(changesets(:normal_user_first_change))
14     assert_match %r{^Closed <abbr title='Created: Mon, 01 Jan 2007 00:00:00 \+0000&#10;Closed: Tue, 02 Jan 2007 00:00:00 \+0000'>.*</abbr> by <a href="/user/test2">test2</a>$}, changeset_details(changesets(:public_user_closed_change))
15   end
16 end