escape queries for string in activities_controller test

pull/1186/head
Jens Ulferts 12 years ago
parent 99bc0daaf9
commit 117417c71d
  1. 8
      test/functional/activities_controller_test.rb
  2. 18
      test/functional/issues_controller_test.rb

@ -29,7 +29,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /(#{IssueStatus.find(2).name})/,
:content => /#{ERB::Util.html_escape(IssueStatus.find(2).name)}/
}
}
}
@ -47,7 +47,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.html_escape(Issue.find(1).subject)}/
}
}
}
@ -65,7 +65,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.html_escape(Issue.find(1).subject)}/
}
}
}
@ -83,7 +83,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.html_escape(Issue.find(1).subject)}/
}
}
}

@ -57,7 +57,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_tag :tag => 'a', :content => /Subproject issue/
# private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
@ -73,7 +73,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_no_tag :tag => 'a', :content => /Can't print recipes/
assert_no_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_tag :tag => 'a', :content => /Subproject issue/
end
@ -84,7 +84,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_no_tag :tag => 'a', :content => /Can't print recipes/
assert_no_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_tag :tag => 'a', :content => /Subproject issue/
end
@ -94,7 +94,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_no_tag :tag => 'a', :content => /Subproject issue/
end
@ -104,7 +104,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_tag :tag => 'a', :content => /Subproject issue/
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
end
@ -116,7 +116,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => ERB::Util.html_escape("Can't print recipes")
assert_tag :tag => 'a', :content => /Subproject issue/
assert_tag :tag => 'a', :content => /Issue of a private subproject/
end
@ -1037,7 +1037,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'edit'
assert_error_tag :descendant => {:content => /Activity can't be blank/}
assert_error_tag :descendant => {:content => ERB::Util.html_escape("Activity can't be blank")}
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => "2z" }
end
@ -1055,8 +1055,8 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'edit'
assert_error_tag :descendant => {:content => /Activity can't be blank/}
assert_error_tag :descendant => {:content => /Hours can't be blank/}
assert_error_tag :descendant => {:content => ERB::Util.html_escape("Activity can't be blank")}
assert_error_tag :descendant => {:content => ERB::Util.html_escape("Hours can't be blank")}
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => "this is my comment" }
end

Loading…
Cancel
Save