Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes Rails 3.2 ActiveSupport::Concern deprecation warning

  • Loading branch information...
commit 91df3017222c3f19c34c8defcc3bdad17da1b82f 1 parent 43295db
@Nerian Nerian authored
Showing with 38 additions and 40 deletions.
  1. +38 −40 lib/apotomo/test_case.rb
View
78 lib/apotomo/test_case.rb
@@ -34,54 +34,52 @@ class TestCase < Cell::TestCase # TODO: re-arrange modules in Cell::TestCase and
module TestMethods
extend ActiveSupport::Concern
- module InstanceMethods
- include Cell::TestCase::CommonTestMethods
+ include Cell::TestCase::CommonTestMethods
+
+ attr_reader :view_assigns
+
+ def setup
+ super # defined in Cell::TestCase::CommonTestMethods.
- attr_reader :view_assigns
-
- def setup
- super # defined in Cell::TestCase::CommonTestMethods.
-
- @controller.instance_eval do
- def controller_path
- 'barn'
- end
+ @controller.instance_eval do
+ def controller_path
+ 'barn'
end
- @controller.extend Apotomo::Rails::ControllerMethods
end
-
- # Renders the widget +name+.
- def render_widget(*args)
- @view_assigns = extract_state_ivars_for(root[args.first]) do
- @last_invoke = root.render_widget(*args)
- end
-
- @last_invoke
+ @controller.extend Apotomo::Rails::ControllerMethods
+ end
+
+ # Renders the widget +name+.
+ def render_widget(*args)
+ @view_assigns = extract_state_ivars_for(root[args.first]) do
+ @last_invoke = root.render_widget(*args)
end
+
+ @last_invoke
+ end
- # Triggers an event of +type+. You have to pass the +source+ as second options.
- #
- # Example:
- #
- # trigger :submit, :comments
- def trigger(type, source, options={})
- source = root.find_widget(source)
- source.fire(type, options)
- root.page_updates
- end
+ # Triggers an event of +type+. You have to pass the +source+ as second options.
+ #
+ # Example:
+ #
+ # trigger :submit, :comments
+ def trigger(type, source, options={})
+ source = root.find_widget(source)
+ source.fire(type, options)
+ root.page_updates
+ end
- # Returns the widget tree from TestCase.has_widgets.
- def root
- blk = self.class.has_widgets_blocks or raise "Please setup a widget tree using has_widgets()"
- @root ||= Apotomo::Widget.new(parent_controller, "root").tap do |root|
- self.instance_exec(root, &blk)
- end
- end
-
- def parent_controller
- @controller
+ # Returns the widget tree from TestCase.has_widgets.
+ def root
+ blk = self.class.has_widgets_blocks or raise "Please setup a widget tree using has_widgets()"
+ @root ||= Apotomo::Widget.new(parent_controller, "root").tap do |root|
+ self.instance_exec(root, &blk)
end
end
+
+ def parent_controller
+ @controller
+ end
module ClassMethods
def has_widgets_blocks
Please sign in to comment.
Something went wrong with that request. Please try again.