Sha256: 9285073316bb30207c37b89305752634fca0840876930406667f601739176653

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

require 'test_helper'

def reload!
  ActionDispatch::Reloader.cleanup!
  ActionDispatch::Reloader.prepare!
end

class ReloadTest < ActiveSupport::TestCase
  test "reloading_keeps_triggers" do
    assert_equal 1, ReloadTestModel._save_callbacks.select {|cb| cb.kind == :after}.count
    reload!
    assert_equal 1, ReloadTestModel._save_callbacks.select {|cb| cb.kind == :after}.count
  end

  # #TODO: Test that reloading doesn't double register, don't know how to simulate full unload and reload of code
  # test "reloading_doesnt_double_register" do
  #   before = PushRoutes.active_routes
  #   reload!
  #   assert_equal before, PushRoutes.active_routes
  # end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_routes-0.0.8 test/reload_test.rb
push_routes-0.0.7 test/reload_test.rb
push_routes-0.0.6 test/reload_test.rb