Sha256: 04ab49402771f348e9931f261abc72193412780c57e93e33ad1e9390e1abbea5

Contents?: true

Size: 849 Bytes

Versions: 2

Compression:

Stored size: 849 Bytes

Contents

# 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'
require 'mocha'

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.3 test/test_helper.rb
presenting-2.0.2 test/test_helper.rb