Created
June 2, 2011 11:50
-
-
Save iosadchiy/1004292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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