# # test_customers_controller.rb # # Created on 20/09/2007, 11:36:56 # require File.join(File.dirname(__FILE__), 'little_rails_app.rb') describe "Checking AutoRest's defaults for CustomersController" do it "Should have data in the managed controller " do CustomersController.ardata.should_not be_nil end f= [[:name, "Name"], [:is_distributor, "Is Distributor"], [:zone_id, "Zone"], [:sales_man_id, "Sales Man"]] b= Struct::ARBreadcrumbs.new(nil, nil, 'Customers ', 'Customer ', AutoRest::Labels.defaults[:breadcrumbs_newlabel], AutoRest::Labels.defaults[:breadcrumbs_separator]) parents= Set.new([Struct::ARResource.new("sales_man", "sales_men", SalesMan, "Sales_man", "sales_man_")]) parents<< Struct::ARResource.new("zone", "zones", Zone, "Zone", "zone_") parent_ids= Set.new(['zone_id', 'sales_man_id']) options= { :resource => Struct::ARResource.new('customer', 'customers', Customer, 'Customer', ""), :parent_resources => parents, :parent_ids => parent_ids, :foreing_models => { 'zone_id' => Zone, 'sales_man_id' => SalesMan }, :exclude_fields => Struct::ARFields.new(nil, nil, nil, nil), :fields => Struct::ARFields.new(f, f, f, f), :hidden_fields => Set.new, :breadcrumbs => b, :templates => CUSTOM_TEMPLATES, :labels => AutoRest::Labels.defaults.merge({:search_title => "

Busqueda Customers

"}), :exclude_methods => [], :only_methods => [], :methods => Set.new([:index, :show, :edit, :create, :update, :new, :destroy, :search]), :exclude_links => [], :only_links => [], :links => Set.new([:index, :show, :edit, :create, :update, :new, :destroy, :back, :search]), :index_finder => {}, :ferret => ferret_addon, :will_paginate => wp_addon } options.each do |key, value| it "Should have correct defaults for CustomersController.ardata.#{key}" do CustomersController.ardata.send(key).should == value end end end