... 9 10 11 12 13 14 15 ... 29 30 31 32 33 34 35 36 37 38 39 ... 53 54 55 56 57 58 59 60 61 ... 74 75 76 77 78 79 80 81 82 ... 94 95 96 97 98 99 ... 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
... 9 10 11 12 13 14 15 ... 29 30 31 32 33 34 35 36 37 38 39 ... 53 54 55 56 57 58 59 60 61 ... 74 75 76 77 78 79 80 81 82 ... 94 95 96 97 98 99 100 101 102 103 ... 114 115 116 117 118 119 120 121 122 123 124 125 126 |
0 @@ -9,7 +9,7 @@ module Arts 0 def assert_rjs(action, *args, &block) 0 respond_to?("assert_rjs_#{action}") ? 0 send("assert_rjs_#{action}", *args) : 0 - assert (lined_response.include?(create_generator.send(action, *args, &block)), 0 + assert _response_contains(create_generator.send(action, *args, &block), 0 generic_error(action, args)) 0 @@ -29,11 +29,11 @@ module Arts 0 assert_match Regexp.new("new Insertion\.#{position.to_s.camelize}(.*#{item_id}.*,.*#{content.source}.*);"), 0 - assert lined_response.include?("new Insertion.#{position.to_s.camelize}(\"#{item_id}\", #{content});"), 0 + assert _response_contains("new Insertion.#{position.to_s.camelize}(\"#{item_id}\", #{content});", 0 "No insert_html call found for \n" + 0 " position: '#{position}' id: '#{item_id}' \ncontent: \n" + 0 - "in response:\n#{ lined_response}"0 + "in response:\n#{ @response.body}")0 raise "Invalid content type" 0 @@ -53,9 +53,9 @@ module Arts 0 assert_match Regexp.new("Element.update(.*#{div}.*,.*#{content.source}.*);"), 0 - assert lined_response.include?("Element.update(\"#{div}\", #{content});"), 0 + assert _response_contains("Element.update(\"#{div}\", #{content});", 0 "No replace_html call found on div: '#{div}' and content: \n#{content}\n" + 0 - "in response:\n#{ lined_response}"0 + "in response:\n#{ @response.body}")0 raise "Invalid content type" 0 @@ -74,9 +74,9 @@ module Arts 0 assert_match Regexp.new("Element.replace(.*#{div}.*,.*#{content.source}.*);"), 0 - assert lined_response.include?("Element.replace(\"#{div}\", #{content});"), 0 + assert _response_contains("Element.replace(\"#{div}\", #{content});", 0 "No replace call found on div: '#{div}' and content: \n#{content}\n" + 0 - "in response:\n#{ lined_response}"0 + "in response:\n#{ @response.body}")0 raise "Invalid content type" 0 @@ -94,6 +94,10 @@ module Arts 0 + def assert_response_contains(str, message) 0 + assert @response.body.to_s.index(str), message 0 def build_method_chain!(args) 0 content = create_generator.send(:[], args.shift) # start $('some_id').... 0 @@ -110,17 +114,13 @@ module Arts 0 - @response.body.split("\n") 0 block = Proc.new { |*args| yield *args if block_given? } 0 JavaScriptGenerator.new self, &block 0 def generic_error(action, args) 0 - "#{action} with args [#{args.join(" ")}] does not show up in response:\n#{ lined_response}" 0 + "#{action} with args [#{args.join(" ")}] does not show up in response:\n#{ @response.body}" 0 def extract_matchable_content(args)
|
Comments
No one has commented yet.