Sha256: e31860f1bed11cd802644e992603077bc7590c5e9c82890255496046d8882c4a

Contents?: true

Size: 1.4 KB

Versions: 10

Compression:

Stored size: 1.4 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

# Make a test class with no options
class SlimTinyMCEController < ApplicationController
  uses_tiny_mce
  include TinyMCEActions
end

# Lets make sure that if routes arn't the
# defaults, these tests will still work
ActionController::Routing::Routes.draw do |map|
  map.with_options :controller => 'slim_tiny_mce' do |tiny_mce|
    tiny_mce.connect '/slim_tiny_mce/new_page', :action => 'new_page'
    tiny_mce.connect '/slim_tiny_mce/edit_page', :action => 'edit_page'
    tiny_mce.connect '/slim_tiny_mce/show_page', :action => 'show_page'
    tiny_mce.connect '/slim_tiny_mce/spellchecker', :action => 'spellchecker'
  end
end

# Use non-default action names to get around possible authentication
# filters to ensure the tests work in most cases
class SlimTinyMCEControllerTest <  ActionController::TestCase

  test "all instance variables are properly set on all pages" do
    get :new_page
    assert_instance_vars_set
    get :edit_page
    assert_instance_vars_set
    get :show_page
    assert_instance_vars_set
  end

  private

  def assert_instance_vars_set
    assert_response :success
    assert (assigns(:uses_tiny_mce) &&
            assigns(:uses_tiny_mce) == true)
    assert (assigns(:tiny_mce_options) &&
            assigns(:tiny_mce_options).is_a?(Hash))
    assert (assigns(:raw_tiny_mce_options) &&
            assigns(:raw_tiny_mce_options) == '')
  end

end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
kete-tiny_mce-0.1.0 test/functional/slim_tiny_mce_controller_test.rb
krasivotokak-tiny_mce-0.0.1 test/functional/slim_tiny_mce_controller_test.rb
krasivotokak-tiny_mce-0.0.2 test/functional/slim_tiny_mce_controller_test.rb
krasivotokak-tiny_mce-0.0.4 test/functional/slim_tiny_mce_controller_test.rb
krasivotokak-tiny_mce-0.1.0 test/functional/slim_tiny_mce_controller_test.rb
tiny_mce-0.1.1 test/functional/slim_tiny_mce_controller_test.rb
tiny_mce-0.1.0 test/functional/slim_tiny_mce_controller_test.rb
tiny_mce-0.0.4 test/functional/slim_tiny_mce_controller_test.rb
tiny_mce-0.0.2 test/functional/slim_tiny_mce_controller_test.rb
tiny_mce-0.0.1 test/functional/slim_tiny_mce_controller_test.rb