Module: AssertSelectSpecHelpers

Defined in:
lib/vendor/plugins/rspec-rails/spec/spec/rails/matchers/assert_select_spec.rb

Instance Method Summary collapse

Instance Method Details

#first_non_rspec_line_in_backtrace_of(error) ⇒ Object



63
64
65
66
67
68
# File 'lib/vendor/plugins/rspec-rails/spec/spec/rails/matchers/assert_select_spec.rb', line 63

def first_non_rspec_line_in_backtrace_of(error)
  rlocation = File.join('rspec', 'lib', 'spec')
  error.backtrace.reject { |line|
    line =~ /#{rlocation}/
  }.first
end

#render_html(html) ⇒ Object



47
48
49
50
# File 'lib/vendor/plugins/rspec-rails/spec/spec/rails/matchers/assert_select_spec.rb', line 47

def render_html(html)
  @controller.response = html
  get :html
end

#render_rjs(&block) ⇒ Object



52
53
54
55
56
# File 'lib/vendor/plugins/rspec-rails/spec/spec/rails/matchers/assert_select_spec.rb', line 52

def render_rjs(&block)
  clear_response
  @controller.response &block
  get :rjs
end

#render_xml(xml) ⇒ Object



58
59
60
61
# File 'lib/vendor/plugins/rspec-rails/spec/spec/rails/matchers/assert_select_spec.rb', line 58

def render_xml(xml)
  @controller.response = xml
  get :xml
end