class PrototypeHelperTest

Public Instance Methods

_evaluate_assigns_and_ivars() click to toggle source
# File test/template/prototype_helper_test.rb, line 80
def _evaluate_assigns_and_ivars() end
setup() click to toggle source
# File test/template/prototype_helper_test.rb, line 82
def setup
  @record = @author = Author.new
  @article = Article.new
  super
end
test_remote_function() click to toggle source
# File test/template/prototype_helper_test.rb, line 107
def test_remote_function
  res = remote_function(:url => authors_path, :with => "'author[name]='+$F('author_name')+'&author[dob]='+$F('author_dob')")
  assert_equal "new Ajax.Request('/authors', {asynchronous:true, evalScripts:true, parameters:'author[name]='+$F('author_name')+'&author[dob]='+$F('author_dob')})", res
  assert res.html_safe?
end
test_update_page() click to toggle source
# File test/template/prototype_helper_test.rb, line 88
def test_update_page
  old_output_buffer = output_buffer

  block = Proc.new { |page| page.replace_html('foo', 'bar') }
  assert_equal create_generator(&block).to_s, update_page(&block)

  assert_equal old_output_buffer, output_buffer
end
test_update_page_tag() click to toggle source
# File test/template/prototype_helper_test.rb, line 97
def test_update_page_tag
  block = Proc.new { |page| page.replace_html('foo', 'bar') }
  assert_equal javascript_tag(create_generator(&block).to_s), update_page_tag(&block)
end
test_update_page_tag_with_html_options() click to toggle source
# File test/template/prototype_helper_test.rb, line 102
def test_update_page_tag_with_html_options
  block = Proc.new { |page| page.replace_html('foo', 'bar') }
  assert_equal javascript_tag(create_generator(&block).to_s, {:defer => 'true'}), update_page_tag({:defer => 'true'}, &block)
end

Protected Instance Methods

author_article_path(author, article) click to toggle source
# File test/template/prototype_helper_test.rb, line 126
def author_article_path(author, article)
  "/authors/#{author.id}/articles/#{article.id}"
end
author_articles_path(author) click to toggle source
# File test/template/prototype_helper_test.rb, line 122
def author_articles_path(author)
  "/authors/#{author.id}/articles"
end
author_path(record) click to toggle source
# File test/template/prototype_helper_test.rb, line 114
def author_path(record)
  "/authors/#{record.id}"
end
authors_path() click to toggle source
# File test/template/prototype_helper_test.rb, line 118
def authors_path
  "/authors"
end