Commits

Kaspar Schiess committed 0d9375d

Links up with target

Comments (0)

Files changed (2)

       context.lus.
         each { |lu| 
           lu.views.each { |view| 
-            if my_groups.include?(view.group) 
+            if my_groups.include?(view.target_group) 
               views << view
             end } }
             

spec/lib/iscsi/context_spec.rb

     /^stmfadm list-target/ => fixture('target_list.txt'), 
     /^stmfadm list-tg/     => fixture('target_groups.txt'), 
     /^stmfadm list-lu/     => fixture('lus.txt'), 
-    /^stmfadm list-view -l 600144F085698100000050CB43400009/ => fixture('lu_view0.txt')) }
+    /^stmfadm list-view -l 600144F085698100000050CB43400009/ => fixture('lu_view0.txt'), 
+    /^stmfadm list-view -l 600144F085698100000050CB47E2000A/ => fixture('lu_view1.txt')) }
   before(:each) { 
     flexmock(ctx, runner: fake_runner) }
   
       it "should have the correct target groups" do
         target.groups.map(&:name).should == %w(tg2 tg3)
       end 
+      it "should have the correct views" do
+        target.views.map(&:lu).map(&:name).should == %w()
+      end 
     end
   end
   describe '#lus' do