Permalink
Browse files

Update spec suite to use new helper to check for rails3

  • Loading branch information...
1 parent 32e8aa1 commit ae3d5bcb04cabd5caad5f16550135dfde8483017 @yabawock yabawock committed May 24, 2010
View
@@ -22,22 +22,22 @@
end
it 'should render a fieldset inside the form, with a class of "inputs"' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form fieldset.buttons")
end
it 'should render an ol inside the fieldset' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form fieldset.buttons ol")
end
it 'should render the contents of the block inside the ol' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form fieldset.buttons ol", /hello/)
end
it 'should not render a legend inside the fieldset' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should_not have_tag("form fieldset.buttons legend")
end
end
@@ -52,7 +52,7 @@
end
end
it 'should render a fieldset inside the form' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form fieldset legend", /#{@legend_text}/)
end
end
@@ -68,7 +68,7 @@
end
end
it 'should pass the options into the fieldset tag as attributes' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag("form fieldset##{@id_option}")
output_buffer.should have_tag("form fieldset.#{@class_option}")
end
@@ -87,32 +87,32 @@
end
it 'should render a form' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form')
end
it 'should render a buttons fieldset inside the form' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form fieldset.buttons')
end
it 'should not render a legend in the fieldset' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should_not have_tag('form fieldset.buttons legend')
end
it 'should render an ol in the fieldset' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form fieldset.buttons ol')
end
it 'should render a list item in the ol for each default button' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form fieldset.buttons ol li', :count => 1)
end
it 'should render a commit list item for the commit button' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form fieldset.buttons ol li.commit')
end
@@ -127,7 +127,7 @@
end
it 'should render a form with a fieldset containing a list item for each button arg' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form > fieldset.buttons > ol > li', :count => 1)
output_buffer.should have_tag('form > fieldset.buttons > ol > li.commit')
end
@@ -143,18 +143,18 @@
end
it 'should render a form with a fieldset containing a list item for each button arg' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form > fieldset.buttons > ol > li', :count => 1)
output_buffer.should have_tag('form > fieldset.buttons > ol > li.commit', :count => 1)
end
it 'should pass the options down to the fieldset' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form > fieldset#my-id.buttons')
end
it 'should use the special :name option as a text for the legend tag' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('form > fieldset#my-id.buttons > legend', /Now click a button/)
end
@@ -20,17 +20,17 @@
end
it 'should render a commit li' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit')
end
it 'should render an input with a type attribute of "submit"' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@type="submit"]')
end
it 'should render an input with a name attribute of "commit"' do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@name="commit"]')
end
@@ -40,7 +40,7 @@
concat(builder.commit_button('text', :button_html => {:class => 'my_class', :id => 'my_id'}))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input#my_id')
output_buffer.should have_tag('li.commit input.my_class')
end
@@ -61,7 +61,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button('text', :button_html => {}))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@accesskey="s"]')
end
end
@@ -72,7 +72,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button('text', :accesskey => 'o'))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should_not have_tag('li.commit input[@accesskey="s"]')
output_buffer.should have_tag('li.commit input[@accesskey="o"]')
end
@@ -84,7 +84,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button('text', :accesskey => 'o', :button_html => {:accesskey => 't'}))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should_not have_tag('li.commit input[@accesskey="s"]')
output_buffer.should_not have_tag('li.commit input[@accesskey="o"]')
output_buffer.should have_tag('li.commit input[@accesskey="t"]')
@@ -103,12 +103,12 @@
end
it "should render the string as the value of the button" do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li input[@value="a string"]')
end
it "should deal with the options hash" do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li input.pretty')
end
@@ -124,7 +124,7 @@
end
it "should deal with the options hash" do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li input.pretty')
end
@@ -139,7 +139,7 @@
form = semantic_form_for(:post, :url => 'http://example.com') do |builder|
concat(builder.commit_button("Click!"))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Click!"][@class~="submit"]')
end
end
@@ -158,7 +158,7 @@
form = semantic_form_for(:post, :url => 'http://example.com') do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Submit Post"][@class~="submit"]')
end
end
@@ -190,15 +190,15 @@
form = semantic_form_for(:post, :url => 'http://example.com') do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Submit Post"][@class~="submit"]})
end
it 'should render an input with anoptional localized label (I18n) - if first is not set' do
form = semantic_form_for(:post, :url => 'http://example.com') do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Submit"][@class~="submit"]})
end
@@ -217,7 +217,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button("Click!"))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Click!"][@class~="create"]')
end
end
@@ -236,7 +236,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Create Post"][@class~="create"]')
end
end
@@ -268,15 +268,15 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Create Post"][@class~="create"]})
end
it 'should render an input with anoptional localized label (I18n) - if first is not set' do
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Create"][@class~="create"]})
end
@@ -295,7 +295,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button("Click!"))
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Click!"][@class~="update"]')
end
end
@@ -314,7 +314,7 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li.commit input[@value="Save Post"][@class~="update"]')
end
end
@@ -347,15 +347,15 @@
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Save Post"][@class~="update"]})
end
it 'should render an input with anoptional localized label (I18n) - if first is not set' do
form = semantic_form_for(@new_post) do |builder|
concat(builder.commit_button)
end
- output_buffer.concat(form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(form) if Formtastic::Util.rails3?
output_buffer.should have_tag(%Q{li.commit input[@value="Custom Save"][@class~="update"]})
::I18n.backend.store_translations :en, :formtastic => {}
end
@@ -392,7 +392,7 @@ def self.human_name
end
it "should render the string as the value of the button" do
- output_buffer.concat(@form) if defined?(ActiveSupport::SafeBuffer)
+ output_buffer.concat(@form) if Formtastic::Util.rails3?
output_buffer.should have_tag('li input[@value="Create User post"]')
end
Oops, something went wrong.

0 comments on commit ae3d5bc

Please sign in to comment.