Sha256: 59f917f8f34715de2dc9363fb16b7268e0415568c97f1ebe356eb9b607251351

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

if defined?(::Rails)
require 'action_controller'
describe Rack::DevMark::ActionControllerHelpers do
  let(:controller_klass) do
    Class.new(ActionController::Base) do
      skip_rack_dev_mark

      def disabled_action
        puts 'test'
        render inline: '<html><head></head><body></body></html>'
      end

      def enabled_action
        render inline: '<html><head></head><body></body></html>'
      end
    end
  end
  let(:controller) { controller_klass.new }

  include_context 'forked spec'

  before do
    @app = Class.new(::Rails::Application)
    @app.config.active_support.deprecation = :stderr
    @app.config.eager_load = false
    @app.config.rack_dev_mark.enable = true
    @app.initialize!
  end

  describe "#disable_rack_dev_mark" do
    it "sets Rack::DevMark.tmp_disabled true" do
      expect(Rack::DevMark).to receive(:tmp_disabled=).with(true)
      controller.disable_rack_dev_mark
    end
  end
  describe "#enable_rack_dev_mark" do
    it "sets Rack::DevMark.tmp_disabled false" do
      expect(Rack::DevMark).to receive(:tmp_disabled=).with(false)
      controller.enable_rack_dev_mark
    end
  end

  describe "::skip_rack_dev_mark" do
    it "does not add dev mark" do
      skip "need a spec test"
    end
  end
end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rack-dev-mark-0.8.0 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.11 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.10 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.9 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.8 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.7 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.6 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.5 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.4 spec/rack/dev-mark/action_controller_helpers_spec.rb
rack-dev-mark-0.7.3 spec/rack/dev-mark/action_controller_helpers_spec.rb