renuo-cms-rails 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/renuo_cms_rails/api/contents.rb +2 -0
- data/lib/renuo_cms_rails/version.rb +1 -1
- data/spec/renuo_cms_rails/api/contents_spec.rb +37 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 649de88572b0326d72a66b2515c2c92f4919b79d
|
4
|
+
data.tar.gz: 5bbdd15df8a0bb4c04ae2072f1a049bdd0347a0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b81b18e9e08eb931bc64710377fa1b1d2fc57998a917e44278587bf4056cb5c11d4a3e825fdf7b2c5c59b345a4ad98a816281c0fcd6b5568642862c3305fe9
|
7
|
+
data.tar.gz: 8fb1e314377242087cfaaa4e5c8a8454985646e9f86a9c82f0d267fca8a4bdf7aa905b35d5591640644950ea4510c231147cf90367cb231a3157e98562b0bdd6
|
data/CHANGELOG.md
CHANGED
@@ -71,7 +71,7 @@ describe RenuoCmsRails::API::Contents do
|
|
71
71
|
|
72
72
|
it 'returns an empty hash if the JSON is invalid' do
|
73
73
|
config = RenuoCmsRails::Config.new
|
74
|
-
config.api_host = '
|
74
|
+
config.api_host = 'example.com'
|
75
75
|
config.api_key = 'somekey'
|
76
76
|
config.private_api_key = 'pk'
|
77
77
|
contents_api = RenuoCmsRails::API::Contents.new(config)
|
@@ -80,7 +80,7 @@ describe RenuoCmsRails::API::Contents do
|
|
80
80
|
|
81
81
|
it 'returns an empty hash if the JSON is not complete' do
|
82
82
|
config = RenuoCmsRails::Config.new
|
83
|
-
config.api_host = '
|
83
|
+
config.api_host = 'example.com'
|
84
84
|
config.api_key = 'somekey'
|
85
85
|
config.private_api_key = 'pk'
|
86
86
|
contents_api = RenuoCmsRails::API::Contents.new(config)
|
@@ -89,7 +89,7 @@ describe RenuoCmsRails::API::Contents do
|
|
89
89
|
|
90
90
|
it 'returns an empty hash if the API request was not successful' do
|
91
91
|
config = RenuoCmsRails::Config.new
|
92
|
-
config.api_host = '
|
92
|
+
config.api_host = 'example.com'
|
93
93
|
config.api_key = 'somekey'
|
94
94
|
config.private_api_key = 'pk'
|
95
95
|
contents_api = RenuoCmsRails::API::Contents.new(config)
|
@@ -101,6 +101,40 @@ describe RenuoCmsRails::API::Contents do
|
|
101
101
|
expect(contents_api.fetch).to eq({})
|
102
102
|
end
|
103
103
|
end
|
104
|
+
|
105
|
+
it 'returns an empty hash if the API request connection was not successful' do
|
106
|
+
config = RenuoCmsRails::Config.new
|
107
|
+
config.api_host = 'local-not-existing.renuo:3044'
|
108
|
+
config.api_key = 'somekey'
|
109
|
+
config.private_api_key = 'pk'
|
110
|
+
contents_api = RenuoCmsRails::API::Contents.new(config)
|
111
|
+
|
112
|
+
Timecop.freeze(Time.at(123).utc) do
|
113
|
+
begin
|
114
|
+
WebMock.allow_net_connect!
|
115
|
+
expect(contents_api.fetch).to eq({})
|
116
|
+
ensure
|
117
|
+
WebMock.disable_net_connect!
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'returns an empty hash if the API the api host is invalid' do
|
123
|
+
config = RenuoCmsRails::Config.new
|
124
|
+
config.api_host = 'local-not-existing.renuo'
|
125
|
+
config.api_key = '<somekey>'
|
126
|
+
config.private_api_key = 'pk'
|
127
|
+
contents_api = RenuoCmsRails::API::Contents.new(config)
|
128
|
+
|
129
|
+
Timecop.freeze(Time.at(123).utc) do
|
130
|
+
begin
|
131
|
+
WebMock.allow_net_connect!
|
132
|
+
expect(contents_api.fetch).to eq({})
|
133
|
+
ensure
|
134
|
+
WebMock.disable_net_connect!
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
104
138
|
end
|
105
139
|
end
|
106
140
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renuo-cms-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Elmer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|