Skip to content

Instantly share code, notes, and snippets.

@iosadchiy
Created June 2, 2011 11:50
Show Gist options
  • Save iosadchiy/1004292 to your computer and use it in GitHub Desktop.
Save iosadchiy/1004292 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe ApplicationController do
controller(ApplicationController) do
def index
render :nothing => true
end
end
it "loads categories for side menu" do
get :index
should assign_to :root_category
should assign_to :menu_categories
end
end
class ApplicationController < ActionController::Base
include InheritedResources::DSL
protect_from_forgery
before_filter :categories_for_menu
private
def categories_for_menu
@root_category, @menu_categories = Category.arrange.first
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment