github.com/go-chef/chef@v0.30.1/test_chef_server/test/integration/default/inspec/group_spec.rb (about)

     1  # Inspec tests for the group chef api go module
     2  #
     3  
     4  describe command('/go/src/github.com/go-chef/chef/testapi/bin/group') do
     5    its('stderr') { should match(%r{^Issue recreating group1. POST https://testhost/organizations/test/groups: 409}) }
     6    its('stderr') { should match(/^Issue recreating group1. 409/) }
     7    its('stderr') { should_not match(/error|no such file|cannot find|not used|undefined/) }
     8    its('stdout') do
     9      should match(%r{^List initial groups map\[(?=.*admins:https://testhost/organizations/test/groups/admins)(?=.*billing-admins:https://testhost/organizations/test/groups/billing-admins)(?=.*clients:https://testhost/organizations/test/groups/clients)(?=.*users:https://testhost/organizations/test/groups/users)(?=.*public_key_read_access:https://testhost/organizations/test/groups/public_key_read_access).*\]EndInitialList})
    10    end
    11    its('stdout') { should match(%r{^Added group1 &\{https://testhost/organizations/test/groups/group1\}}) }
    12    its('stdout') do
    13      should match(%r{^List groups after adding group1 map\[(?=.*group1:https://testhost/organizations/test/groups/group1)(?=.*admins:https://testhost/organizations/test/groups/admins)(?=.*billing-admins:https://testhost/organizations/test/groups/billing-admins)(?=.*clients:https://testhost/organizations/test/groups/clients)(?=.*users:https://testhost/organizations/test/groups/users)(?=.*public_key_read_access:https://testhost/organizations/test/groups/public_key_read_access).*\]EndAddList})
    14    end
    15    its('stdout') do
    16      should match(/^Get group1 \{Name:group1 GroupName:group1 OrgName:test Actors:\[\] Clients:\[\] Groups:\[\] Users:\[\]\}/)
    17    end
    18    its('stdout') do
    19      should match(/^Update group1 \{Name:group1 GroupName:group1 Actors:\{Clients:\[\] Groups:\[\] Users:\[pivotal\]\}\}/)
    20    end
    21    its('stdout') do
    22      should match(/^Get group1 after update \{Name:group1 GroupName:group1 OrgName:test Actors:\[pivotal\] Clients:\[\] Groups:\[\] Users:\[pivotal\]\}/)
    23    end
    24    its('stdout') do
    25      should match(/^Update group1 \{Name:group1 GroupName:group1-new Actors:\{Clients:\[\] Groups:\[admins\] Users:\[\]\}\}/)
    26    end
    27    its('stdout') do
    28      should match(/^Get group1-new after update \{Name:group1-new GroupName:group1-new OrgName:test Actors:\[\] Clients:\[\] Groups:\[admins\] Users:\[\]\}/)
    29    end
    30    its('stdout') { should match(/^Delete group1 <nil>/) }
    31    its('stdout') do
    32      should match(%r{^List groups after cleanup map\[(?=.*admins:https://testhost/organizations/test/groups/admins)(?=.*billing-admins:https://testhost/organizations/test/groups/billing-admins)(?=.*clients:https://testhost/organizations/test/groups/clients)(?=.*users:https://testhost/organizations/test/groups/users)(?=.*public_key_read_access:https://testhost/organizations/test/groups/public_key_read_access).*\]EndFinalList})
    33    end
    34  end