Revision c6c217d4 src/oca/ruby/test/UserPool_spec.rb

View differences:

src/oca/ruby/test/UserPool_spec.rb
23 23
                user.class.to_s.should eql("OpenNebula::User")
24 24
                if user.id == 0
25 25
                    user.name.should eql('oneadmin')
26
                    user['PASSWORD'].should eql('f13a1234833436f71ab846572d251c0d40391e72')
27
                    user['ENABLED'].should eql('True')
26 28
                elsif user.id == 1
27 29
                    user.name.should eql('dan')
30
                    user['PASSWORD'].should eql('d22a12348334v33f71ba846572d25250d40701e72')
31
                    user['ENABLED'].should eql('False')
28 32
                end
29 33
            }
30 34
        end
31
        
32
        it "should get a hash representation of the USER_POOL" do
33
            user_hash = @user_pool.to_hash
34
            user_hash['USER_POOL']['USER'][0]['ID'].should eql('0')
35
            user_hash['USER_POOL']['USER'][0]['NAME'].should eql('oneadmin')
36
            user_hash['USER_POOL']['USER'][0]['PASSWORD'].should eql('f13a1234833436f71ab846572d251c0d40391e72')
37
            user_hash['USER_POOL']['USER'][0]['ENABLED'].should eql('True')
38
            user_hash['USER_POOL']['USER'][1]['ID'].should eql('1')
39
            user_hash['USER_POOL']['USER'][1]['NAME'].should eql('dan')
40
            user_hash['USER_POOL']['USER'][1]['PASSWORD'].should eql('d22a12348334v33f71ba846572d25250d40701e72')
41
            user_hash['USER_POOL']['USER'][1]['ENABLED'].should eql('False')
42
        end
43 35
    end
44 36
    
45 37
    describe "User using REXML" do
......
60 52
                user.class.to_s.should eql("OpenNebula::User")
61 53
                if user.id == 0
62 54
                    user.name.should eql('oneadmin')
55
                    user['PASSWORD'].should eql('f13a1234833436f71ab846572d251c0d40391e72')
56
                    user['ENABLED'].should eql('True')
63 57
                elsif user.id == 1
64 58
                    user.name.should eql('dan')
59
                    user['PASSWORD'].should eql('d22a12348334v33f71ba846572d25250d40701e72')
60
                    user['ENABLED'].should eql('False')
65 61
                end
66 62
            }
67 63
        end
68
        
69
        it "should get a hash representation of the USER_POOL" do
70
            user_hash = @user_pool.to_hash
71
            user_hash['USER_POOL']['USER'][0]['ID'].should eql('0')
72
            user_hash['USER_POOL']['USER'][0]['NAME'].should eql('oneadmin')
73
            user_hash['USER_POOL']['USER'][0]['PASSWORD'].should eql('f13a1234833436f71ab846572d251c0d40391e72')
74
            user_hash['USER_POOL']['USER'][0]['ENABLED'].should eql('True')
75
            user_hash['USER_POOL']['USER'][1]['ID'].should eql('1')
76
            user_hash['USER_POOL']['USER'][1]['NAME'].should eql('dan')
77
            user_hash['USER_POOL']['USER'][1]['PASSWORD'].should eql('d22a12348334v33f71ba846572d25250d40701e72')
78
            user_hash['USER_POOL']['USER'][1]['ENABLED'].should eql('False')
79
        end
80 64
    end
81 65
end

Also available in: Unified diff