Sha256: 582a22463bfa77a6cbe3ee46121cafaece7b7c7312da703b80efdd18fcaaeaae

Contents?: true

Size: 803 Bytes

Versions: 2

Compression:

Stored size: 803 Bytes

Contents

require 'spec_helper'
require 'draper/test/view_context'

describe Draper::ViewContext do
  let(:app_controller) { ApplicationController }
  let(:app_controller_instance) { app_controller.new }

  it "implements #set_current_view_context" do
    app_controller_instance.should respond_to(:set_current_view_context)
  end

  it "calls #before_filter with #set_current_view_context" do
    app_controller.before_filters.should include(:set_current_view_context)
  end

  it "raises an exception if the view_context is fetched without being set" do
    Draper::ViewContext.current = nil
    expect {app_controller.current_view_context}.should raise_exception(Exception)
  end

  it "provides a method to create a view context while testing" do
    Draper::ViewContext.should respond_to(:infect!)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
draper-0.15.0 spec/draper/view_context_spec.rb
draper-0.15.0rc1 spec/draper/view_context_spec.rb