Sha256: 0b3a2d4565276073f3bd30ea8f25536e0ac568308b5d8c16775afabcebdb7646

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

# bootstrap
require 'rubygems'
require 'test/unit'
require 'mocha'

# load the test app, which will load gems
ENV['RAILS_ENV'] = 'test'
require File.join(File.dirname(__FILE__), 'r3', 'config', 'environment.rb')
require 'rails/test_help'
Rails.backtrace_cleaner.remove_silencers!

# a way to customize syntax for our tests
class Presenting::Test < Test::Unit::TestCase
  # TODO: create a shoulda-like context/setup/should syntax
  def default_test; end # to quiet Test::Unit
end

# inheriting tests should target rendering behavior given certain configurations
class Presentation::RenderTest < Presenting::Test
  include ActionDispatch::Assertions::SelectorAssertions

  protected
  
  def render
    @render ||= @presentation.render
  end
  
  def response_from_page_or_rjs
    html_document.root
  end
  
  def html_document
    HTML::Document.new(render)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
presenting-2.0.1 test/test_helper.rb
presenting-2.0.0 test/test_helper.rb