diff --git a/app/controllers/note_versions_controller.rb b/app/controllers/note_versions_controller.rb index 8a6fbd47c..be3ef428f 100644 --- a/app/controllers/note_versions_controller.rb +++ b/app/controllers/note_versions_controller.rb @@ -3,8 +3,7 @@ class NoteVersionsController < ApplicationController before_filter :member_only, :except => [:index, :show] def index - @search = NoteVersion.search(params[:search]) - @note_versions = @search.order("note_versions.id desc").paginate(params[:page]) + @note_versions = NoteVersion.search(params[:search]).order("note_versions.id desc").paginate(params[:page]) respond_with(@note_versions) do |format| format.xml do render :xml => @note_versions.to_xml(:root => "note-versions") diff --git a/test/unit/dtext_test.rb b/test/unit/dtext_test.rb index 98d49203c..e8bdb1b70 100644 --- a/test/unit/dtext_test.rb +++ b/test/unit/dtext_test.rb @@ -17,11 +17,11 @@ class DTextTest < ActiveSupport::TestCase end def test_spoilers - assert_equal("

this is

an inline spoiler

.

", p("this is [spoiler]an inline spoiler[/spoiler].")) - assert_equal("

this is

a block spoiler

.

", p("this is\n\n[spoiler]\na block spoiler\n[/spoiler].")) - assert_equal("
\n

this is a spoiler with no closing tag

\n

new text

\n
", p("[spoiler]this is a spoiler with no closing tag\n\nnew text")) - assert_equal("

this is a spoiler with no closing tag
new text

", p("[spoiler]this is a spoiler with no closing tag\nnew text")) - assert_equal("
\n

this is

\n

a nested

\n

spoiler

\n
", p("[spoiler]this is [spoiler]a nested[/spoiler] spoiler[/spoiler]")) + assert_equal("

this is an inline spoiler.

", p("this is [spoiler]an inline spoiler[/spoiler].")) + assert_equal("

this is


a block spoiler
.

", p("this is\n\n[spoiler]\na block spoiler\n[/spoiler].")) + assert_equal("

[spoiler]this is a spoiler with no closing tag

new text

", p("[spoiler]this is a spoiler with no closing tag\n\nnew text")) + assert_equal("

[spoiler]this is a spoiler with no closing tag
new text

", p("[spoiler]this is a spoiler with no closing tag\nnew text")) + assert_equal("

this is [spoiler]a nested spoiler[/spoiler]

", p("[spoiler]this is [spoiler]a nested[/spoiler] spoiler[/spoiler]")) end def test_paragraphs