Skip to content

Commit

Permalink
fix shoulda macros
Browse files Browse the repository at this point in the history
(cherry picked from commit 41669f2)
  • Loading branch information
scambra committed Aug 3, 2011
1 parent 610775e commit b03c5da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shoulda_macros/macros.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit b03c5da

Please sign in to comment.