Sha256: e306a2f3e0b472a95742801bfecc0446c203a4a395b594f9edaa90ca0eb9a447

Contents?: true

Size: 541 Bytes

Versions: 3

Compression:

Stored size: 541 Bytes

Contents

module Ajax
  module Spec
    module Extension

      def integrate_ajax
        Ajax.enabled = true
      end

      def disable_ajax
        Ajax.enabled = false
      end
      
      def mock_ajax
        integrate_ajax
        Ajax.mocked = true
      end
      
      def unmock_ajax
        disable_ajax
        Ajax.mocked = false
      end      
    end
  end
end

module ActiveSupport
  class TestCase
    include Ajax::Spec::Extension

    before(:all) do
      ::Ajax.enabled = false
    end if method_defined?(:before)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ajax-0.1.4 lib/ajax/spec/extension.rb
ajax-0.1.3 lib/ajax/spec/extension.rb
ajax-0.1.2 lib/ajax/spec/extension.rb