Sha256: 996198fbda765095369ea3d7ad64c693f03f62952ce78ed898f3263818bc04e6

Contents?: true

Size: 989 Bytes

Versions: 1

Compression:

Stored size: 989 Bytes

Contents

# load the test app, which will load gems
ENV['RAILS_ENV'] = 'test'

if ENV['RAILS_VERSION'] = '4'
  require File.join(File.dirname(__FILE__), 'r4', 'config', 'environment.rb')
else
  require File.join(File.dirname(__FILE__), 'r3', 'config', 'environment.rb')
end

require 'test/unit/testcase'
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

1 entries across 1 versions & 1 rubygems

Version Path
presenting-2.1.0 test/test_helper.rb