Permalink
Browse files

fix shoulda macros

  • Loading branch information...
1 parent 34d2a1c commit 41669f2f8b06b3297697318e76467692b27769f4 scambra committed Jun 15, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 shoulda_macros/macros.rb
View
8 shoulda_macros/macros.rb
@@ -26,7 +26,7 @@ def self.should_not_include_columns_in(action, *columns)
def self.should_render_as_form_ui(column_name, form_ui)
should "render column #{column_name} as #{form_ui} form_ui", :before => lambda{
@rendered_columns = []
- ActionView::Base.any_instance.expects(:"active_scaffold_input_#{form_ui}").at_least_once.with {|column, options|
+ @controller.view_context_class.any_instance.expects(:"active_scaffold_input_#{form_ui}").at_least_once.with {|column, options|
@rendered_columns << column.name
true
}
@@ -60,7 +60,7 @@ def self.should_render_as_form_partial_override(column_name)
def self.should_render_as_form_hidden(column_name)
should "render column #{column_name} as form hidden", :before => lambda{
@rendered_columns = []
- ActionView::Base.any_instance.expects(:"hidden_field").at_least_once.with {|object, method, options|
+ @controller.view_context_class.any_instance.expects(:"hidden_field").at_least_once.with {|object, method, options|
@rendered_columns << method
true
}
@@ -73,7 +73,7 @@ def self.should_render_as_form_hidden(column_name)
def self.should_render_as_list_ui(column_name, list_ui)
should "render column #{column_name} as #{list_ui} list_ui", :before => lambda{
@rendered_columns = []
- ActionView::Base.any_instance.expects(:"active_scaffold_column_#{list_ui}").at_least_once.with {|column, options|
+ @controller.view_context_class.any_instance.expects(:"active_scaffold_column_#{list_ui}").at_least_once.with {|column, options|
@rendered_columns << column.name
true
}
@@ -102,7 +102,7 @@ def self.should_render_as_inplace_edit(column_name)
@column = @controller.active_scaffold_config.columns[column_name]
@rendered_columns = []
method = @column.list_ui == :checkbox ? :format_column_checkbox : :active_scaffold_inplace_edit
- ActionView::Base.any_instance.expects(method).at_least_once.with {|model, column, options|
+ @controller.view_context_class.any_instance.expects(method).at_least_once.with {|model, column, options|
@rendered_columns << column.name
true
}

0 comments on commit 41669f2

Please sign in to comment.