File: zone_tests.rb

package info (click to toggle)
ruby-fog-openstack 1.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,784 kB
  • sloc: ruby: 47,937; makefile: 5; sh: 4
file content (50 lines) | stat: -rw-r--r-- 1,342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require "test_helper"
require "helpers/dns_v2_helper"

describe "Fog::OpenStack::DNS::V2 | zone requests" do
  before do
    @dns, @zone, @zone_id = set_dns_data

    @zone_format = {
      "id"             => String,
      "pool_id"        => String,
      "project_id"     => String,
      "name"           => String,
      "email"          => String,
      "ttl"            => Integer,
      "serial"         => Integer,
      "status"         => String,
      "action"         => String,
      "description"    => String,
      "masters"        => Array,
      "type"           => String,
      "transferred_at" => String,
      "version"        => Integer,
      "created_at"     => String,
      "updated_at"     => String,
      "links"          => Hash
    }
  end

  describe "success" do
    it "#list_zones" do
      @dns.list_zones.body.must_match_schema("zones" => [@zone_format])
    end

    it "#create_zone" do
      @zone.body.must_match_schema(@zone_format)
    end

    it "#get_zone" do
      @dns.get_zone(@zone_id).body.must_match_schema(@zone_format)
    end

    it "#update_zone" do
      @dns.update_zone(@zone_id, "email" => 'new_hostmaster@example.org').body.must_match_schema(@zone_format)
    end

    it "#delete_zone" do
      @dns.delete_zone(@zone_id).body.must_match_schema(@zone_format)
    end
  end
end