16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/call_center/test/dsl.rb', line 16
def self.included(base)
if ActionPack::VERSION::MAJOR == 2
base.send(:include, ActionController::Assertions::SelectorAssertions)
else
base.send(:include, ActionDispatch::Assertions::SelectorAssertions)
end
base.extend(ClassMethods)
base.class_eval do
def html_document
HTML::Document.new(CGI.unescapeHTML(@body))
end
if ActionPack::VERSION::STRING < "3.2.0"
def response_from_page_or_rjs_with_body
html_document.root
end
alias_method_chain :response_from_page_or_rjs, :body
end
end
end
|