Skip to content

Commit

Permalink
fixed test issue
Browse files Browse the repository at this point in the history
git-svn-id: svn://rubyforge.org//var/svn/fckeditorp/trunk/fckeditor@29 13c73f65-831a-0410-84ff-c4c9c9a2e73e
  • Loading branch information
srutherford committed Sep 11, 2006
1 parent 6a7c808 commit af4d761
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions init.rb
Expand Up @@ -15,16 +15,35 @@
# require the controller
require 'fckeditor_controller'

# # add a route for spellcheck
# class ActionController::Routing::RouteSet
# alias draw_without_spelling draw
# def draw_with_spelling
# draw_without_spelling do |map|
# map.connect 'fckeditor/check_spelling', :controller => 'fckeditor', :action => 'check_spelling'
# map.connect 'fckeditor/command', :controller => 'fckeditor', :action => 'command'
# map.connect 'fckeditor/upload', :controller => 'fckeditor', :action => 'upload'
# yield map
# end
# end
# alias draw draw_with_spelling
# end

# add a route for spellcheck
class ActionController::Routing::RouteSet
alias draw_without_spelling draw
def draw_with_spelling
draw_without_spelling do |map|
map.connect 'fckeditor/check_spelling', :controller => 'fckeditor', :action => 'check_spelling'
map.connect 'fckeditor/command', :controller => 'fckeditor', :action => 'command'
map.connect 'fckeditor/upload', :controller => 'fckeditor', :action => 'upload'
yield map
end
unless (RAILS_ENV.match('test'))
class_eval <<-"end_eval", __FILE__, __LINE__
alias draw_without_fckeditor draw
def draw_with_fckeditor
draw_without_fckeditor do |map|
map.connect 'fckeditor/check_spelling', :controller => 'fckeditor', :action => 'check_spelling'
map.connect 'fckeditor/command', :controller => 'fckeditor', :action => 'command'
map.connect 'fckeditor/upload', :controller => 'fckeditor', :action => 'upload'
yield map
end
end
alias draw draw_with_fckeditor
end_eval
end
alias draw draw_with_spelling
end

0 comments on commit af4d761

Please sign in to comment.