Changeset 259

Show
Ignore:
Timestamp:
09/30/08 15:44:25 (3 months ago)
Author:
pwh
Message:

Moved device unit tests in to a story.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/spec/models/devices_spec.rb

    r256 r259  
    6464 
    6565    device.site.description.should eql('example site') 
     66 
    6667  end 
    6768   
     
    131132    device.snmp_version = "foobar" 
    132133    device.should_not be_valid 
    133      
    134134  end 
    135135   
     
    152152    device.snmpv3_auth_protocol = "" 
    153153    device.should_not be_valid 
    154      
    155154  end 
    156155   
     
    198197  end 
    199198   
    200   #it "should respond to has_inventory? when it has even a partial inventory" 
    201    
    202   #it "should respond to a request to get an SNMP table" 
     199  it "should respond to has_inventory? when it has even a partial inventory" do 
     200    device = Device.new 
     201    device.hostname = "foobar" 
     202    device.ipv4_address = "127.0.0.1" 
     203    device.snmp_version = 2 
     204    device.snmp_community = "public" 
     205    device.save 
     206  end 
     207   
     208  it "should respond to a request to get an SNMP table" do 
     209    device = Device.new 
     210    device.hostname = "foobar" 
     211    device.ipv4_address = "127.0.0.1" 
     212    device.snmp_version = 2 
     213    device.snmp_community = "public" 
     214    device.save 
     215     
     216    iftable = device.get_table('IF-MIB::ifTable') 
     217  end 
    203218   
    204219  it "should respond to a request to get an SNMP OID" do 
     
    217232    sysname_formatted['sysName'].should_not be_blank 
    218233    sysname_formatted['sysName'].should_not be_nil 
    219  
    220234  end 
    221235