|
4 | 4 | describe Contentstack do |
5 | 5 | let(:client) { create_client } |
6 | 6 | let(:eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {region: Contentstack::Region::EU}) } |
7 | | - let(:custom_host_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "https://custom-cdn.contentstack.com"}) } |
| 7 | + let(:azure_na_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {region: Contentstack::Region::AZURE_NA}) } |
| 8 | + let(:azure_eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {region: Contentstack::Region::AZURE_EU}) } |
| 9 | + let(:custom_host_eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::EU}) } |
| 10 | + let(:custom_host_azure_eu_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::AZURE_EU}) } |
| 11 | + let(:custom_host_azure_na_client) { create_client('DELIVERY_TOKEN_TOKEN', 'API_KEY', 'STACK_ENV', {host: "contentstack.com", region: Contentstack::Region::AZURE_NA}) } |
8 | 12 |
|
9 | 13 | it "has a version number" do |
10 | 14 | expect(Contentstack::VERSION).not_to be nil |
|
13 | 17 | it "has region data" do |
14 | 18 | expect(Contentstack::Region::EU).not_to be 'eu' |
15 | 19 | expect(Contentstack::Region::US).not_to be 'us' |
| 20 | + expect(Contentstack::Region::AZURE_NA).not_to be 'azure-na' |
| 21 | + expect(Contentstack::Region::AZURE_EU).not_to be 'azure-eu' |
16 | 22 | end |
17 | 23 |
|
18 | 24 | it "has default host and region" do |
|
25 | 31 | expect(eu_client.host).to eq 'https://eu-cdn.contentstack.com' |
26 | 32 | end |
27 | 33 |
|
28 | | - it "has custom host" do |
29 | | - expect(custom_host_client.host).to eq 'https://custom-cdn.contentstack.com' |
| 34 | + it "has custom region with region host" do |
| 35 | + expect(azure_na_client.region).to eq Contentstack::Region::AZURE_NA |
| 36 | + expect(azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com' |
| 37 | + end |
| 38 | + |
| 39 | + it "has custom region with region host" do |
| 40 | + expect(azure_eu_client.region).to eq Contentstack::Region::AZURE_EU |
| 41 | + expect(azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com' |
| 42 | + end |
| 43 | + |
| 44 | + it "has custom host and eu region" do |
| 45 | + expect(custom_host_eu_client.host).to eq 'https://eu-cdn.contentstack.com' |
30 | 46 | end |
31 | 47 |
|
| 48 | + it "has custom host and azure-eu region" do |
| 49 | + expect(custom_host_azure_eu_client.host).to eq 'https://azure-eu-cdn.contentstack.com' |
| 50 | + end |
| 51 | + |
| 52 | + it "has custom host and azure-na region" do |
| 53 | + expect(custom_host_azure_na_client.host).to eq 'https://azure-na-cdn.contentstack.com' |
| 54 | + end |
| 55 | + |
| 56 | + |
32 | 57 | it "JSON to HTML" do |
33 | 58 | expect(Contentstack::json_to_html({}, ContentstackUtils::Model::Options.new())).to eq '' |
34 | 59 | end |
|
0 commit comments