Module: Rspec::Rails23::Helpers::InstanceMethods

Defined in:
lib/rspec/rails23/helpers.rb

Defined Under Namespace

Classes: HelperObject

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/rspec/rails23/helpers.rb', line 58

def method_missing(sym, *args)
  if helper.respond_to?(sym)
    helper.send(sym, *args)
  else
    super
  end
end

Instance Method Details

#flashObject



50
51
52
# File 'lib/rspec/rails23/helpers.rb', line 50

def flash
  response.flash
end

#helperObject



38
39
40
41
42
43
44
# File 'lib/rspec/rails23/helpers.rb', line 38

def helper
  @helper_object ||= returning HelperObject.new do |helper_object|
    if self.class.describes.class == Module
      helper_object.extend self.class.describes
    end
  end
end

#paramsObject



46
47
48
# File 'lib/rspec/rails23/helpers.rb', line 46

def params
  request.parameters
end

#sessionObject



54
55
56
# File 'lib/rspec/rails23/helpers.rb', line 54

def session
  response.session
end