<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -70,15 +70,20 @@ module Streamlined::Helpers::WindowLinkHelper
 
   def link_to_next_page
     link_to_function image_tag('streamlined/control-forward_16.png', 
-        {:id =&gt; 'next_page', :alt =&gt; 'Next Page', :style =&gt; @streamlined_item_pages != [] &amp;&amp; @streamlined_item_pages.current.next ? &quot;&quot; : &quot;display: none;&quot;, :title =&gt; 'Next Page', :border =&gt; '0'}),
+        {:id =&gt; 'next_page', :alt =&gt; 'Next Page', :style =&gt; page_link_style, :title =&gt; 'Next Page', :border =&gt; '0'}),
         &quot;Streamlined.PageOptions.nextPage()&quot;
   end
 
   def link_to_previous_page
     link_to_function image_tag('streamlined/control-reverse_16.png', 
-        {:id =&gt; 'previous_page', :alt =&gt; 'Previous Page', :style =&gt; @streamlined_item_pages != [] &amp;&amp; @streamlined_item_pages.current.previous ? &quot;&quot; : &quot;display: none;&quot;, :title =&gt; 'Previous Page', :border =&gt; '0'}),
+        {:id =&gt; 'previous_page', :alt =&gt; 'Previous Page', :style =&gt; page_link_style, :title =&gt; 'Previous Page', :border =&gt; '0'}),
         &quot;Streamlined.PageOptions.previousPage()&quot;
   end
+  
+  private
+  def page_link_style
+    !@streamlined_item_pages.empty? &amp;&amp; @streamlined_item_pages.current.previous ? &quot;&quot; : &quot;display: none;&quot;
+  end
 end
 
 </diff>
      <filename>lib/streamlined/helpers/window_link_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@ begin
       tasks/relevance_extensions_tasks.rake
       lib/streamlined/integration_tests.rb
       lib/relevance/integration_test_support.rb
+      lib/relevance/controller_test_support.rb
     }.join(',')
   
     desc &quot;Delete aggregate coverage data.&quot;</diff>
      <filename>tasks/rcov.rake</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,10 @@ class Streamlined::Helpers::LinkHelperTest &lt; Test::Unit::TestCase
   
   # TODO: make link JavaScript unobtrusive!
   def test_link_to_new_model
-    assert_equal &quot;&lt;a href=\&quot;/people/new\&quot;&gt;&lt;img alt=\&quot;New Person\&quot; border=\&quot;0\&quot; src=\&quot;/images/streamlined/add_16.png\&quot; title=\&quot;New Person\&quot; /&gt;&lt;/a&gt;&quot;, @view.link_to_new_model
+    result = @view.link_to_new_model
+    assert_select root_node(result), &quot;a[href=/people/new]&quot; do
+      assert_select &quot;img[alt=New Person][border=0][src=/images/streamlined/add_16.png][title=New Person]&quot;
+    end
   end
   
   def test_link_to_new_model_when_quick_new_button_is_false
@@ -27,12 +30,30 @@ class Streamlined::Helpers::LinkHelperTest &lt; Test::Unit::TestCase
   end
 
   def test_link_to_edit_model
-    assert_equal &quot;&lt;a href=\&quot;/people/edit/1\&quot;&gt;&lt;img alt=\&quot;Edit Person\&quot; border=\&quot;0\&quot; src=\&quot;/images/streamlined/edit_16.png\&quot; title=\&quot;Edit Person\&quot; /&gt;&lt;/a&gt;&quot;, @view.link_to_edit_model(people(:justin))
+    result = @view.link_to_edit_model(people(:justin))
+    assert_select root_node(result), &quot;a[href=/people/edit/1]&quot; do
+      assert_select &quot;img[alt=Edit Person][border=0][src=/images/streamlined/edit_16.png][title=Edit Person]&quot;
+    end
   end
   
   def test_wrap_with_link
-    assert_equal '&lt;a href=&quot;/people/show/1&quot;&gt;foo&lt;/a&gt;', 
-                 @view.wrap_with_link(:action=&gt;&quot;show&quot;, :id=&gt;@item.id) {&quot;foo&quot;}
+    result = @view.wrap_with_link(&quot;show&quot;) {&quot;foo&quot;}
+    assert_select root_node(result), &quot;a[href=show]&quot;, &quot;foo&quot;
+  end
+  
+  def test_wrap_with_link_with_empty_block
+    result = @view.wrap_with_link(&quot;show&quot;) {}
+    assert_select root_node(result), &quot;a[href=show]&quot;, &quot;show&quot;
+  end
+  
+  def test_wrap_with_link_with_array
+    result = @view.wrap_with_link([&quot;foo&quot;, {:action =&gt; &quot;show&quot;, :id =&gt; &quot;1&quot;}]) {&quot;bar&quot;}
+    assert_select root_node(result), &quot;a[href=foo][action=show][id=1]&quot;, &quot;bar&quot;
+  end
+  
+  def test_wrap_with_link_with_array_and_empty_block
+    result = @view.wrap_with_link([&quot;foo&quot;, {:action =&gt; &quot;show&quot;, :id =&gt; &quot;1&quot;}]) {}
+    assert_select root_node(result), &quot;a[href=foo][action=show][id=1]&quot;, &quot;foo&quot;
   end
   
   def test_link_toggle_element
@@ -102,5 +123,4 @@ class Streamlined::Helpers::LinkHelperTest &lt; Test::Unit::TestCase
       assert_false @view.send(&quot;show_columns_to_export&quot;)
     end
   end
-
 end</diff>
      <filename>test/functional/streamlined/helpers/link_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,23 +27,22 @@ class Streamlined::WindowLinkHelperTest &lt; Test::Unit::TestCase
   end
   
   def test_guess_show_link_for
-    assert_equal &quot;(multiple)&quot;, guess_show_link_for([])
-    assert_equal &quot;(unassigned)&quot;, guess_show_link_for(nil)
-    assert_equal &quot;(unknown)&quot;, guess_show_link_for(1)
-    assert_equal &quot;&lt;a href=\&quot;//people/show/1\&quot;&gt;1&lt;/a&gt;&quot;, guess_show_link_for(people(:justin))
-    assert_equal &quot;&lt;a href=\&quot;//phone_numbers/show/1\&quot;&gt;1&lt;/a&gt;&quot;, guess_show_link_for(phone_numbers(:number1))
+    with_default_route do
+      assert_equal &quot;(multiple)&quot;, guess_show_link_for([])
+      assert_equal &quot;(unassigned)&quot;, guess_show_link_for(nil)
+      assert_equal &quot;(unknown)&quot;, guess_show_link_for(1)
+      assert_equal &quot;&lt;a href=\&quot;//people/show/1\&quot;&gt;1&lt;/a&gt;&quot;, guess_show_link_for(people(:justin))
+      assert_equal &quot;&lt;a href=\&quot;//phone_numbers/show/1\&quot;&gt;1&lt;/a&gt;&quot;, guess_show_link_for(phone_numbers(:number1))
+    end
   end
   
   def test_link_to_new_model
     @model_ui = flexmock(:read_only =&gt; false, :quick_new_button =&gt; true)
     @model_name = &quot;Foo&quot;
-    with_routing do |set|
-      set.draw do |map|
-        map.connect ':controller/:action/:id'
-        assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
-                     &quot;('New', '//foobar/new', null); return false;\&quot;&gt;&lt;img alt=\&quot;New Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
-                     &quot;src=\&quot;//images/streamlined/add_16.png\&quot; title=\&quot;New Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_new_model
-      end
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
+                   &quot;('New', '//foobar/new', null); return false;\&quot;&gt;&lt;img alt=\&quot;New Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
+                   &quot;src=\&quot;//images/streamlined/add_16.png\&quot; title=\&quot;New Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_new_model
     end
   end
   
@@ -51,13 +50,10 @@ class Streamlined::WindowLinkHelperTest &lt; Test::Unit::TestCase
     @model_ui = flexmock(:read_only =&gt; false, :quick_new_button =&gt; true)
     @model_name = &quot;Foo&quot;
     item = flexmock(:id =&gt; 123)
-    with_routing do |set|
-      set.draw do |map|
-        map.connect ':controller/:action/:id'
-        assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
-                     &quot;('Show', '//foobar/show/123', null); return false;\&quot;&gt;&lt;img alt=\&quot;Show Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
-                     &quot;src=\&quot;//images/streamlined/search_16.png\&quot; title=\&quot;Show Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_show_model(item)
-      end
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
+                   &quot;('Show', '//foobar/show/123', null); return false;\&quot;&gt;&lt;img alt=\&quot;Show Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
+                   &quot;src=\&quot;//images/streamlined/search_16.png\&quot; title=\&quot;Show Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_show_model(item)
     end
   end
   
@@ -65,16 +61,62 @@ class Streamlined::WindowLinkHelperTest &lt; Test::Unit::TestCase
     @model_ui = flexmock(:read_only =&gt; false, :quick_new_button =&gt; true)
     @model_name = &quot;Foo&quot;
     item = flexmock(:id =&gt; 123)
-    with_routing do |set|
-      set.draw do |map|
-        map.connect ':controller/:action/:id'
-        assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
-                     &quot;('Edit', '//foobar/edit/123', null); return false;\&quot;&gt;&lt;img alt=\&quot;Edit Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
-                     &quot;src=\&quot;//images/streamlined/edit_16.png\&quot; title=\&quot;Edit Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_edit_model(item)
-      end
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.Windows.open_local_window_from_url&quot; &lt;&lt;
+                   &quot;('Edit', '//foobar/edit/123', null); return false;\&quot;&gt;&lt;img alt=\&quot;Edit Foo\&quot; border=\&quot;0\&quot; &quot; &lt;&lt;
+                   &quot;src=\&quot;//images/streamlined/edit_16.png\&quot; title=\&quot;Edit Foo\&quot; /&gt;&lt;/a&gt;&quot;, link_to_edit_model(item)
+    end
+  end
+  
+  def test_link_to_delete_model
+    item = flexmock(:id =&gt; 123)
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;//foobar/destroy/123\&quot; onclick=\&quot;if (confirm('Are you sure?')) { &quot; &lt;&lt;
+                   &quot;var f = document.createElement('form'); f.style.display = 'none'; &quot; &lt;&lt;
+                   &quot;this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;&quot; &lt;&lt;
+                   &quot;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); &quot; &lt;&lt;
+                   &quot;m.setAttribute('name', '_method'); m.setAttribute('value', 'post'); &quot; &lt;&lt;
+                   &quot;f.appendChild(m);f.submit(); };return false;\&quot;&gt;&lt;img alt=\&quot;Destroy\&quot; &quot; &lt;&lt;
+                   &quot;border=\&quot;0\&quot; src=\&quot;//images/streamlined/delete_16.png\&quot; &quot; &lt;&lt;
+                   &quot;title=\&quot;Destroy\&quot; /&gt;&lt;/a&gt;&quot;, link_to_delete_model(item)
+    end
+  end
+  
+  def test_link_to_next_page
+    flexmock(self).should_receive(:page_link_style).and_return(&quot;&quot;).once
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.PageOptions.nextPage(); return false;\&quot;&gt;&quot; &lt;&lt;
+                   &quot;&lt;img alt=\&quot;Next Page\&quot; border=\&quot;0\&quot; id=\&quot;next_page\&quot; &quot; &lt;&lt;
+                   &quot;src=\&quot;//images/streamlined/control-forward_16.png\&quot; style=\&quot;\&quot; &quot; &lt;&lt;
+                   &quot;title=\&quot;Next Page\&quot; /&gt;&lt;/a&gt;&quot;, link_to_next_page
+    end
+  end
+  
+  def test_link_to_previous_page
+    flexmock(self).should_receive(:page_link_style).and_return(&quot;&quot;).once
+    with_default_route do
+      assert_equal &quot;&lt;a href=\&quot;#\&quot; onclick=\&quot;Streamlined.PageOptions.previousPage(); return false;\&quot;&gt;&quot; &lt;&lt;
+                   &quot;&lt;img alt=\&quot;Previous Page\&quot; border=\&quot;0\&quot; id=\&quot;previous_page\&quot; &quot; &lt;&lt;
+                   &quot;src=\&quot;//images/streamlined/control-reverse_16.png\&quot; style=\&quot;\&quot; &quot; &lt;&lt;
+                   &quot;title=\&quot;Previous Page\&quot; /&gt;&lt;/a&gt;&quot;, link_to_previous_page
     end
   end
   
+  def test_page_link_style_without_pages
+    @streamlined_item_pages = []
+    assert_equal &quot;display: none;&quot;, page_link_style
+  end
+  
+  def test_page_link_style_with_previous_page
+    @streamlined_item_pages = flexmock(:empty? =&gt; false, :current =&gt; flexmock(:previous =&gt; true))
+    assert_equal &quot;&quot;, page_link_style
+  end
+  
+  def test_page_link_style_without_previous_page
+    @streamlined_item_pages = flexmock(:empty? =&gt; false, :current =&gt; flexmock(:previous =&gt; false))
+    assert_equal &quot;display: none;&quot;, page_link_style
+  end
+  
   def test_link_to_new_model_when_quick_new_button_is_false
     @model_ui = flexmock(:read_only =&gt; false, :quick_new_button =&gt; false)
     assert_nil link_to_new_model
@@ -99,4 +141,14 @@ class Streamlined::WindowLinkHelperTest &lt; Test::Unit::TestCase
     result = wrap_with_link([&quot;foo&quot;, {:action =&gt; &quot;bar&quot;}]) {}
     assert_select root_node(result), &quot;a[href=foo][action=bar]&quot;, &quot;foo&quot;
   end
+  
+  private
+  def with_default_route
+    with_routing do |set|
+      set.draw do |map|
+        map.connect ':controller/:action/:id'
+        yield
+      end
+    end
+  end
 end</diff>
      <filename>test/functional/streamlined/helpers/window_link_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -155,6 +155,7 @@ class Streamlined::Column::AssociationTest &lt; Test::Unit::TestCase
     assert_equal &quot;select&quot;, @association.render_td_edit(view, item)
   end
   
+  private
   def view_and_item_mocks(view_attrs={})
     view = flexmock(:render =&gt; 'render', :controller_path =&gt; 'controller_path', :link_to_function =&gt; 'link')
     item = flexmock(:id =&gt; 123)</diff>
      <filename>test/unit/streamlined/column/association_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,48 +4,38 @@ require 'streamlined/view/render_methods'
 class Streamlined::View::RenderMethodsTest &lt; Test::Unit::TestCase
   include Streamlined::View::RenderMethods
   
-  # begin stub methods
-  def controller_name
-    &quot;people&quot;
-  end
-
-  def controller_path
-    &quot;people&quot;
-  end
-  
-  def managed_views_include?(action)
-    true
-  end
-
-  def managed_partials_include?(action)
-    true
-  end
-  # end stub methods
-  
-  def pretend_template_exists(exists)
-    flexstub(self) do |stub|
-      stub.should_receive(:specific_template_exists?).and_return(exists)
-    end
+  def test_controller_name
+    flexmock(self).should_receive(:controller =&gt; flexmock(:controller_name =&gt; &quot;foo&quot;)).once
+    assert_equal &quot;foo&quot;, controller_name
   end
   
   def test_convert_partial_options_for_generic
-    pretend_template_exists(false)
+    setup_mocks(false)
     options = {:partial=&gt;&quot;list&quot;, :other=&gt;&quot;1&quot;}
     convert_partial_options(options)
     assert_equal({:layout=&gt;false, :file=&gt;generic_view(&quot;_list&quot;), :other=&gt;&quot;1&quot;}, options)
   end
 
   def test_convert_partial_options_and_layout_for_generic
-    pretend_template_exists(false)
+    setup_mocks(false)
     options = {:partial=&gt;&quot;list&quot;, :other=&gt;&quot;1&quot;, :layout=&gt;true}
     convert_partial_options(options)
     assert_equal({:layout=&gt;true, :file=&gt;generic_view(&quot;_list&quot;), :other=&gt;&quot;1&quot;}, options)
   end
 
   def test_convert_partial_options_for_specific
-    pretend_template_exists(true)
+    setup_mocks(true)
     options = {:partial=&gt;&quot;list&quot;, :other=&gt;&quot;1&quot;}
     convert_partial_options(options)
     assert_equal({:partial=&gt;&quot;list&quot;, :other=&gt;&quot;1&quot;}, options)
   end
+  
+  private
+  def setup_mocks(template_exists)
+    flexstub(self) do |s|
+      s.should_receive(:specific_template_exists?).and_return(template_exists)
+      s.should_receive(:controller_path).and_return(&quot;people&quot;)
+      s.should_receive(:managed_partials_include?).and_return(true)
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>test/unit/streamlined/view/render_methods_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/unit/streamlined/helpers/link_helper_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>30adb7e4349b1a870224712915a41476a388d53a</id>
    </parent>
  </parents>
  <author>
    <name>matthew</name>
    <email>matthew@4f249914-c612-0410-8deb-f4485a9d85ab</email>
  </author>
  <url>http://github.com/relevance/streamlined/commit/cde823cf77eb030834944f896fdf017e02181ad4</url>
  <id>cde823cf77eb030834944f896fdf017e02181ad4</id>
  <committed-date>2007-11-04T12:05:28-08:00</committed-date>
  <authored-date>2007-11-04T12:05:28-08:00</authored-date>
  <message>added more tests to boost coverage to 96.4%</message>
  <tree>792571d0525d04391ba6567cc2d6ad9172237019</tree>
  <committer>
    <name>matthew</name>
    <email>matthew@4f249914-c612-0410-8deb-f4485a9d85ab</email>
  </committer>
</commit>
