Rails 2.3.5
Upgrade to Rails 2.3.5. Also work around this bug: https://rails.lighthouseapp.com/projects/8994/tickets/3524 created by the aforementioned Rails release.
This commit is contained in:
parent
a6429f8c22
commit
e3832c6f79
187 changed files with 2316 additions and 891 deletions
53
vendor/rails/actionpack/test/controller/dom_assertions_test.rb
vendored
Normal file
53
vendor/rails/actionpack/test/controller/dom_assertions_test.rb
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
class DomAssertionsTest < ActionView::TestCase
|
||||
def setup
|
||||
super
|
||||
@html_only = '<ul><li>foo</li><li>bar</li></ul>'
|
||||
@html_with_meaningless_whitespace = %{
|
||||
<ul>
|
||||
<li>\tfoo </li>
|
||||
<li>
|
||||
bar
|
||||
</li>
|
||||
</ul>
|
||||
}
|
||||
@more_html_with_meaningless_whitespace = %{<ul>
|
||||
|
||||
<li>foo</li>
|
||||
|
||||
<li>bar</li></ul>}
|
||||
end
|
||||
|
||||
test "assert_dom_equal strips meaningless whitespace from expected string" do
|
||||
assert_dom_equal @html_with_meaningless_whitespace, @html_only
|
||||
end
|
||||
|
||||
test "assert_dom_equal strips meaningless whitespace from actual string" do
|
||||
assert_dom_equal @html_only, @html_with_meaningless_whitespace
|
||||
end
|
||||
|
||||
test "assert_dom_equal strips meaningless whitespace from both expected and actual strings" do
|
||||
assert_dom_equal @more_html_with_meaningless_whitespace, @html_with_meaningless_whitespace
|
||||
end
|
||||
|
||||
test "assert_dom_not_equal strips meaningless whitespace from expected string" do
|
||||
assert_assertion_fails { assert_dom_not_equal @html_with_meaningless_whitespace, @html_only }
|
||||
end
|
||||
|
||||
test "assert_dom_not_equal strips meaningless whitespace from actual string" do
|
||||
assert_assertion_fails { assert_dom_not_equal @html_only, @html_with_meaningless_whitespace }
|
||||
end
|
||||
|
||||
test "assert_dom_not_equal strips meaningless whitespace from both expected and actual strings" do
|
||||
assert_assertion_fails do
|
||||
assert_dom_not_equal @more_html_with_meaningless_whitespace, @html_with_meaningless_whitespace
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_assertion_fails
|
||||
assert_raise(ActiveSupport::TestCase::Assertion) { yield }
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue