Sha256: 78bd0d272e097c13c0b706b523232564a45ab289263714caf0a3f0cfe14a8de0

Contents?: true

Size: 870 Bytes

Versions: 7

Compression:

Stored size: 870 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe "exposure", :type => :controller do
  setup = lambda {
    class ShipTypesController < ActionController::Base
      expose_many(:ship_types)
    end
  }
  setup.call
  controller_name :ship_types
  Object.remove_class(ShipTypesController)
  
  ActionController::Routing::Routes.draw do |map| 
    map.resources :ship_types
  end
  
  before(:each) do
    setup.call
    @controller = ShipTypesController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end
  
  after(:each) do
    Object.remove_class(ShipTypesController)
  end
  
  describe "parent models" do
    it "should constantize resource name" do
      ShipTypesController.resources_name.should == "ship_types"
      ShipTypesController.parent_model.should == ShipType
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
exposure-0.2.1 spec/exposure_spec.rb
exposure-0.2.0 spec/exposure_spec.rb
exposure-0.1.3 spec/exposure_spec.rb
exposure-0.1.2 spec/exposure_spec.rb
exposure-0.1.1 spec/exposure_spec.rb
exposure-0.1.0 spec/exposure_spec.rb
exposure-0.0.7 spec/exposure_spec.rb