Permalink
Browse files

Make flush tests a little more simple and explicit.

  • Loading branch information...
1 parent 5ca56a2 commit 29344d2aca204e3ce76dd3e8ce793ed6b6967c69 @oggy committed Apr 17, 2011
Showing with 9 additions and 19 deletions.
  1. +9 −19 spec/template_streaming_spec.rb
@@ -40,30 +40,20 @@
end
describe "when not rendering progressively" do
- before do
- action do
- render :progressive => false, :layout => 'layout'
- end
+ it "should not affect the output" do
+ view "a<% flush %>b"
+ action { render :progressive => false, :layout => nil }
+ run
+ received.should == 'ab'
end
- it "should do nothing" do
- view <<-'EOS'.gsub(/^ *\|/, '')
- |a
- |<% data.order << :view -%>
- EOS
-
- layout <<-'EOS'.gsub(/^ *\|/, '')
- |1
- |<% data.order << :layout1 -%>
- |<%= yield -%>
- |2
- |<% data.order << :layout2 -%>
- EOS
-
+ it "should not invert the layout rendering order" do
+ view "<% data.order << :view -%>"
+ layout "<% data.order << :layout1 -%><%= yield -%><% data.order << :layout2 -%>"
+ action { render :progressive => false, :layout => 'layout' }
data.order = []
run
data.order.should == [:view, :layout1, :layout2]
- received.should == "1\na\n2\n"
end
end
end

0 comments on commit 29344d2

Please sign in to comment.