rest_shifter 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c859be3899d8c25c59062d2fb4399ef35c53c74
4
- data.tar.gz: 6ebf6006ef0c888aebdf584d9a383ab0be394547
3
+ metadata.gz: 476662617503e739954280164153c4fd12fc770f
4
+ data.tar.gz: 5511050c68f823b7c7c1d8c5147fe4dd2ae95482
5
5
  SHA512:
6
- metadata.gz: e9f4505f9b6f8eea95f13a905f293f988d9493fa4c2697de424a030d8cf74c1a88ad8f76601f7bf98e5a8f75138df7803c2a174044f307d7e28ea5a3b6d1f10b
7
- data.tar.gz: 355021f9333d22a311fe96334f70b9e2ef3d0b237cc648a38b8b097ba60feb0f7d08372523e534343a4d26e1dc78871063ccf8db224927a917387685d02e8625
6
+ metadata.gz: d7867cbb9586432a1df44b8e816c59621ea9e8c36876d475cfe5ee5965475d44e2be552c74ee9e17c98286af149f5e503230d2b9126ff10d878115da7e735826
7
+ data.tar.gz: ecb4a3cb5976440f49824104a5bb24b6e4a17af5041954beee8c5e5836681068431088d46ecf195322e19b02f0767db10cb0317d5412fba7f689ecbdfb71d9af
data/CHANGES CHANGED
@@ -1,4 +1,8 @@
1
1
 
2
+ ** 0.0.19
3
+ - Bugfix
4
+ -- return 500 when content type response was not defined
5
+
2
6
  ** 0.0.18
3
7
  - Feature
4
8
  -- now the port for ssl service must be defined when starting the service
File without changes
File without changes
File without changes
@@ -50,10 +50,10 @@ class Shifter < Sinatra::Base
50
50
 
51
51
  build_services {
52
52
  |current, service|
53
- current.response['Location'] = service.response_location unless service.response_location.to_s.empty?
54
53
  sleep service.response_sleep
54
+ current.response['Location'] = service.response_location unless service.response_location.to_s.empty?
55
+ current.content_type service.response_content_type unless service.response_content_type.to_s.empty?
55
56
  current.status service.response_status
56
- current.content_type service.response_content_type
57
57
  service.response_body
58
58
  }
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module RestShifter
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -0,0 +1,9 @@
1
+ method_used = "get"
2
+ path = "/nocontenttype"
3
+ request_accept = ""
4
+ request_content_type = ""
5
+ response_sleep = 0
6
+ response_status = "202"
7
+ response_body = "no content type defined on response"
8
+ response_content_type = ""
9
+ response_location = ""
data/spec/service_spec.rb CHANGED
@@ -40,6 +40,14 @@ describe RestShifter do
40
40
  expect(last_response.headers['Content-Type']).to eq("application/json")
41
41
  end
42
42
 
43
+ it "GET: No content type defined on response" do
44
+ get '/nocontenttype'
45
+ expect(last_response.status).to eq(202)
46
+ expect(last_response.body).to eq("no content type defined on response")
47
+ expect(last_response.headers['Content-Type']).to eq("text/html;charset=utf-8")
48
+ end
49
+
50
+
43
51
  end
44
52
  describe "Post operations" do
45
53
  it "POST: Endpoint for post" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_shifter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codeclimate-test-reporter
@@ -182,19 +182,19 @@ files:
182
182
  - README.md
183
183
  - Rakefile
184
184
  - bin/rest_shifter
185
- - examples/200ok.flavor
186
- - examples/200sleep2sec.flavor
187
- - examples/201created.flavor
188
- - examples/202accepted.flavor
189
- - examples/203nonauthoritativeinformation.flavor
190
- - examples/204noconten.flavor
191
- - examples/301movedpermanently.flavor
192
- - examples/302found.flavor
193
- - examples/303seeother.flavor
194
- - examples/307temporaryredirect.flavor
195
- - examples/400badrequest.flavor
196
- - examples/404notfound.flavor
197
- - examples/500internalservererror.flavor
185
+ - examples/s200ok.flavor
186
+ - examples/s200sleep2sec.flavor
187
+ - examples/s201created.flavor
188
+ - examples/s202accepted.flavor
189
+ - examples/s203nonauthoritativeinformation.flavor
190
+ - examples/s204noconten.flavor
191
+ - examples/s301movedpermanently.flavor
192
+ - examples/s302found.flavor
193
+ - examples/s303seeother.flavor
194
+ - examples/s307temporaryredirect.flavor
195
+ - examples/s400badrequest.flavor
196
+ - examples/s404notfound.flavor
197
+ - examples/s500internalservererror.flavor
198
198
  - lib/rest_shifter.rb
199
199
  - lib/rest_shifter/commands.rb
200
200
  - lib/rest_shifter/commands/create.rb
@@ -208,6 +208,7 @@ files:
208
208
  - rest_shifter.gemspec
209
209
  - spec/flavors/location_get.flavor
210
210
  - spec/flavors/location_post.flavor
211
+ - spec/flavors/nocontenttype.flavor
211
212
  - spec/flavors/notfound_get.flavor
212
213
  - spec/flavors/notfound_get_accept.flavor
213
214
  - spec/flavors/notfound_post.flavor
@@ -247,6 +248,7 @@ summary: Simple Rest Mock service
247
248
  test_files:
248
249
  - spec/flavors/location_get.flavor
249
250
  - spec/flavors/location_post.flavor
251
+ - spec/flavors/nocontenttype.flavor
250
252
  - spec/flavors/notfound_get.flavor
251
253
  - spec/flavors/notfound_get_accept.flavor
252
254
  - spec/flavors/notfound_post.flavor