lib/spec/rails/example/helper_example_group.rb in dchelimsky-rspec-rails-1.1.12 vs lib/spec/rails/example/helper_example_group.rb in dchelimsky-rspec-rails-1.1.99.1
- old
+ new
@@ -1,8 +1,12 @@
module Spec
module Rails
module Example
+ class HelperExampleGroupController < ApplicationController #:nodoc:
+ attr_accessor :request, :url
+ end
+
# Helper Specs live in $RAILS_ROOT/spec/helpers/.
#
# Helper Specs use Spec::Rails::Example::HelperExampleGroup, which allows you to
# include your Helper directly in the context and write specs directly
# against its methods.
@@ -10,11 +14,11 @@
# HelperExampleGroup also includes the standard lot of ActionView::Helpers in case your
# helpers rely on any of those.
#
# == Example
#
- # class ThingHelper
+ # module ThingHelper
# def number_of_things
# Thing.count
# end
# end
#
@@ -24,10 +28,11 @@
# Thing.should_receive(:count).and_return(37)
# number_of_things.should == 37
# end
# end
class HelperExampleGroup < FunctionalExampleGroup
+ tests HelperExampleGroupController
attr_accessor :output_buffer
class HelperObject < ActionView::Base
def protect_against_forgery?
false
@@ -107,14 +112,10 @@
# are also loaded last.
ActionView::Base.included_modules.reverse.each do |mod|
include mod if mod.parents.include?(ActionView::Helpers)
end
- before(:all) do
- @controller_class_name = 'Spec::Rails::Example::HelperExampleGroupController'
- end
-
before(:each) do
@controller.request = @request
@controller.url = ActionController::UrlRewriter.new @request, {} # url_for
@flash = ActionController::Flash::FlashHash.new
@@ -159,13 +160,9 @@
@_assigns_hash_proxy ||= AssignsHashProxy.new self do
helper
end
end
- end
-
- class HelperExampleGroupController < ApplicationController #:nodoc:
- attr_accessor :request, :url
end
end
end
end