Browse files

Use HTML safe strings in tests

  • Loading branch information...
1 parent 731b792 commit fe63045235f706f61cf22065746b5dab3e313dbe @yabawock yabawock committed May 24, 2010
Showing with 6 additions and 5 deletions.
  1. +5 −5 spec/inputs/country_input_spec.rb
  2. +1 −0 spec/spec_helper.rb
View
10 spec/inputs/country_input_spec.rb
@@ -26,7 +26,7 @@
before do
semantic_form_for(@new_post) do |builder|
- builder.stub!(:country_select).and_return("<select><option>...</option></select>")
+ builder.stub!(:country_select).and_return(Formtastic::Util.html_safe("<select><option>...</option></select>"))
concat(builder.input(:country, :as => :country))
end
end
@@ -54,8 +54,8 @@
it "should be passed down to the country_select helper when provided" do
priority_countries = ["Foo", "Bah"]
semantic_form_for(@new_post) do |builder|
- builder.stub!(:country_select).and_return("<select><option>...</option></select>")
- builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return("<select><option>...</option></select>")
+ builder.stub!(:country_select).and_return(Formtastic::Util.html_safe("<select><option>...</option></select>"))
+ builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return(Formtastic::Util.html_safe("<select><option>...</option></select>"))
concat(builder.input(:country, :as => :country, :priority_countries => priority_countries))
end
@@ -68,7 +68,7 @@
semantic_form_for(@new_post) do |builder|
builder.stub!(:country_select).and_return("<select><option>...</option></select>")
- builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return("<select><option>...</option></select>")
+ builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return(Formtastic::Util.html_safe("<select><option>...</option></select>"))
concat(builder.input(:country, :as => :country))
end
@@ -82,7 +82,7 @@
before do
semantic_form_for(@new_post) do |builder|
- builder.stub!(:country_select).and_return("<select><option>...</option></select>")
+ builder.stub!(:country_select).and_return(Formtastic::Util.html_safe("<select><option>...</option></select>"))
concat(builder.input(:country))
end
end
View
1 spec/spec_helper.rb
@@ -22,6 +22,7 @@
end
require File.expand_path(File.join(File.dirname(__FILE__), '../lib/formtastic'))
+require File.expand_path(File.join(File.dirname(__FILE__), '../lib/formtastic/util'))
require File.expand_path(File.join(File.dirname(__FILE__), '../lib/formtastic/layout_helper'))

0 comments on commit fe63045

Please sign in to comment.