assert_not_nil assigns(:entries)
assert_equal ['delete.png'], assigns(:entries).collect(&:name)
end
-
+
+ def test_show_directory_sql_escape_percent
+ get :show, :id => 3, :path => ['sql_escape', 'percent%dir'], :rev => 13
+ assert_response :success
+ assert_template 'show'
+
+ assert_not_nil assigns(:entries)
+ assert_equal ['percent%file1.txt', 'percentfile1.txt'], assigns(:entries).collect(&:name)
+ changesets = assigns(:changesets)
+
+ ## This is not yet implemented.
+ # assert_not_nil changesets
+ # assert_equal %w(13 11 10 9), changesets.collect(&:revision)
+ end
+
def test_changes
get :changes, :id => 3, :path => ['images', 'edit.png']
assert_response :success
assert c0.revision.to_i > c1.revision.to_i
assert c0.committed_on < c1.committed_on
end
+
+ def test_latest_changesets
+ @repository.fetch_changesets
+ @repository.reload
+
+ # with_limit
+ changesets = @repository.latest_changesets('', nil, 2)
+ assert_equal @repository.latest_changesets('', nil)[0, 2], changesets
+
+ # with_filepath
+ changesets = @repository.latest_changesets('/sql_escape/percent%dir/percent%file1.txt', nil)
+ assert_equal %w|11 10 9|, changesets.collect(&:revision)
+
+ changesets = @repository.latest_changesets('/sql_escape/underscore_dir/understrike_file.txt', nil)
+ assert_equal %w|12 9|, changesets.collect(&:revision)
+ end
else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end