Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Kick tests back to life.

  • Loading branch information...
commit 888a624593ec648ec92069f642db55221dca1bc1 1 parent 918fb0a
José Valim josevalim authored
Showing with 18 additions and 18 deletions.
  1. +12 −12 test/builder_test.rb
  2. +6 −6 test/helper_test.rb
24 test/builder_test.rb
View
@@ -3,27 +3,27 @@
class BuilderTest < ActionView::TestCase
def with_attribute_for(object, attribute, options={}, &block)
- show_for object do |o|
- concat(o.attribute(attribute, options, &block))
- end
+ concat(show_for(object) do |o|
+ o.attribute(attribute, options, &block)
+ end)
end
def with_association_for(object, association, options={}, &block)
- show_for object do |o|
- concat(o.association(association, options, &block))
- end
+ concat(show_for(object) do |o|
+ o.association(association, options, &block)
+ end)
end
def with_label_for(object, attribute, options={})
- show_for object do |o|
- concat o.label attribute, options
- end
+ concat(show_for(object) do |o|
+ o.label attribute, options
+ end)
end
def with_content_for(object, value, options={})
- show_for object do |o|
- concat o.content value, options
- end
+ concat(show_for(object) do |o|
+ o.content value, options
+ end)
end
# WRAPPER
12 test/helper_test.rb
View
@@ -2,29 +2,29 @@
class HelperTest < ActionView::TestCase
test "show for yields an instance of ShowFor::Builder" do
- show_for @user do |f|
+ concat(show_for(@user) do |f|
assert f.instance_of?(ShowFor::Builder)
- end
+ end)
end
test "show for should add default class to form" do
- show_for @user do |f| end
+ concat(show_for(@user) do |f| end)
assert_select "div.show_for"
end
test "show for should add object class name as css class to form" do
- show_for @user do |f| end
+ concat(show_for(@user) do |f| end)
assert_select "div.show_for.user"
end
test "show for should pass options" do
- show_for @user, :id => "my_div", :class => "common" do |f| end
+ concat(show_for(@user, :id => "my_div", :class => "common") do |f| end)
assert_select "div#my_div.show_for.user.common"
end
test "show for tag should be configurable" do
swap ShowFor, :show_for_tag => :p do
- show_for @user do |f| end
+ concat(show_for(@user) do |f| end)
assert_select "p.show_for"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.