<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -65,14 +65,14 @@ class BlogArticlesControllerTest &lt; ActionController::TestCase
         has_tag 'div.meta a', :text =&gt; /\d comment[s]?/, :count =&gt; 0
       end
 
-      has_tag 'div[id=footer]' do
+      has_tag 'div[id=footer]', :if =&gt; :default_theme do
         has_tag 'ul[id=categories_list]'
         has_tag 'ul[id=archives]'
         # has_tag 'ul[id=tags-list]' # FIXME currently tags are not displayed
       end
     end
 
-    with :'blog_feed_paths' do
+    with :blog_feed_paths do
       it_assigns :section, :articles
       it_renders :template, :index, :format =&gt; :atom
     end</diff>
      <filename>engines/adva_blog/test/functional/blog_articles_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ class CalendarEventsControllerTest &lt; ActionController::TestCase
 
   view :index do
     shows :common
-    has_tag 'form[id=calendar_search]'
+    has_tag 'form[id=calendar_search]', :if =&gt; :default_theme
     has_tag 'div[id=calendar]'
     has_tag 'div[id=events]' do |events_tag|
       assigns['events'].each do |event|</diff>
      <filename>engines/adva_calendar/test/functional/calendar_events_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,10 @@ class Test::Unit::TestCase
     before { rescue_action_in_public! }
   end
 
+  share_condition :default_theme do
+    assigns(:site).themes.active.empty?
+  end
+
   # FIXME abstract these
   share :multi_sites_enabled do
     before do</diff>
      <filename>engines/adva_cms/test/contexts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,30 +3,36 @@ module With
 
   class Call
     include Implementation
-    
+
     attr_reader :name, :block
-  
+
     def initialize(name, conditions = {}, &amp;block)
       raise &quot;need to provide a block&quot; unless block
-      
+
       @name = name
       @conditions = conditions
       @block = block
+
+      @conditions[:if] = With.condition(@conditions[:if]) if @conditions[:if].is_a?(Symbol)
     end
-    
+
     def applies?(context)
       names = context.parents.map(&amp;:name) &lt;&lt; context.name
       With.applies?(names, @conditions)
     end
-    
+
     def to_proc
-      name, block = self.name, self.block
+      name, block, conditions = self.name, self.block, @conditions
       Proc.new {
         @_with_current_context = name
-        instance_eval &amp;block
+        if conditions[:if]
+          instance_eval(&amp;block) if instance_eval(&amp;conditions[:if])
+        else
+          instance_eval(&amp;block)
+        end
       }
     end
-    
+
     def call
       to_proc.call
     end</diff>
      <filename>test/with/lib/with/call.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,8 +46,8 @@ module With
 
       def method_missing(method_name, *args, &amp;block)
         options = {}
-        if args.last.is_a?(Hash) and [:in, :not_in].select{|key| args.last.has_key?(key) }
-          [:with, :in, :not_in].each { |key| options[key] = args.last.delete(key) }
+        if args.last.is_a?(Hash) # and [:in, :not_in].select{|key| args.last.has_key?(key) }
+          [:with, :in, :not_in, :if].each { |key| options[key] = args.last.delete(key) }
           args.pop if args.last.empty?
         end
 </diff>
      <filename>test/with/lib/with/context.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ module With
       self.shared[group] ||= []
       self.shared[group] &lt;&lt; context
     end
-
+    
     def shared(name = nil)
       @@shared ||= {}
       name.nil? ? @@shared : begin
@@ -15,5 +15,15 @@ module With
         @@shared[name].map {|context| context.clone }
       end
     end
+
+    def share_condition(name, &amp;block)
+      @@conditions ||= {}
+      @@conditions[name] = block
+    end
+    
+    def condition(name)
+      @@conditions ||= {}
+      @@conditions[name]
+    end
   end
 end
\ No newline at end of file</diff>
      <filename>test/with/lib/with/sharing.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e99757758710c7f9527f9d2c9e0a32fb9eba28b1</id>
    </parent>
  </parents>
  <author>
    <name>Clemens Kofler and Sven Fuchs</name>
    <email>dev+clemens+svenfuchs@adva-cms.org</email>
  </author>
  <url>http://github.com/svenfuchs/adva_cms/commit/964783f09d56d88a2a6314fbc79d4f8b2ae31118</url>
  <id>964783f09d56d88a2a6314fbc79d4f8b2ae31118</id>
  <committed-date>2009-08-25T03:35:52-07:00</committed-date>
  <authored-date>2009-08-25T03:05:58-07:00</authored-date>
  <message>expand with so it allows to specify an :if =&gt; :condition option for assertions. use that in functional tests to exclude assertions from custom themes</message>
  <tree>817c2e94c8cc22e0602028db7ff3d321fc95496e</tree>
  <committer>
    <name>Clemens Kofler and Sven Fuchs</name>
    <email>dev+clemens+svenfuchs@adva-cms.org</email>
  </committer>
</commit>
