Permalink
Browse files

set body_classes for failed records

  • Loading branch information...
1 parent ab4870f commit e2d65779807008d50d80bed569389735f3547e21 @saturnflyer saturnflyer committed Feb 15, 2010
Showing with 20 additions and 1 deletion.
  1. +1 −1 app/controllers/application_controller.rb
  2. +19 −0 spec/controllers/admin/pages_controller_spec.rb
@@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
before_filter :set_current_user
before_filter :set_timezone
before_filter :set_javascripts_and_stylesheets
- before_filter :set_standard_body_style, :only => [:new, :edit]
+ before_filter :set_standard_body_style, :only => [:new, :edit, :update, :create]
attr_accessor :config, :cache
@@ -223,6 +223,25 @@
put :update, :id => page_id(:home), :page => {:breadcrumb => 'Homepage'}
end
+ describe "@body_classes" do
+ it "should return 'reversed' when the action_name is 'new'" do
+ get :new
+ assigns[:body_classes].should == ['reversed']
+ end
+ it "should return 'reversed' when the action_name is 'edit'" do
+ get :edit, :id => 1
+ assigns[:body_classes].should == ['reversed']
+ end
+ it "should return 'reversed' when the action_name is 'create'" do
+ post :create
+ assigns[:body_classes].should == ['reversed']
+ end
+ it "should return 'reversed' when the action_name is 'update'" do
+ put :update, :id => 1
+ assigns[:body_classes].should == ['reversed']
+ end
+ end
+
protected
def assert_rendered_nodes_where(&block)

0 comments on commit e2d6577

Please sign in to comment.