picky 4.12.7 → 4.12.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module Picky
11
11
  #
12
12
  # Note: 200 returns no data yet.
13
13
  #
14
- base.post '/' do
14
+ base.put '/' do
15
15
  index_name = params['index']
16
16
  begin
17
17
  index = Picky::Indexes[index_name.to_sym]
@@ -48,4 +48,4 @@ module Picky
48
48
  end
49
49
 
50
50
  end
51
- end
51
+ end
@@ -36,28 +36,28 @@ describe 'Sinatra Index Actions' do
36
36
  context 'return values' do
37
37
  describe 'update' do
38
38
  it 'returns a correct code after updating without problems' do
39
- result = request.post('/', params: {
39
+ result = request.put('/', params: {
40
40
  index: 'some_index',
41
41
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
42
42
  })
43
43
  result.status.should == 200
44
44
  end
45
45
  it 'returns a correct code after updating with just the id' do
46
- result = request.post('/', params: {
46
+ result = request.put('/', params: {
47
47
  index: 'some_index',
48
48
  data: %Q{{ "id":"1" }}
49
49
  })
50
50
  result.status.should == 200
51
51
  end
52
52
  it 'returns a correct code after updating without id' do
53
- result = request.post('/', params: {
53
+ result = request.put('/', params: {
54
54
  index: 'some_index',
55
55
  data: %Q{{ "name":"Florian", "surname":"Hanke" }}
56
56
  })
57
57
  result.status.should == 400
58
58
  end
59
59
  it 'returns a correct code after updating with the wrong index' do
60
- result = request.post('/', params: {
60
+ result = request.put('/', params: {
61
61
  index: 'some_wrong_index',
62
62
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
63
63
  })
@@ -107,7 +107,7 @@ describe 'Sinatra Index Actions' do
107
107
  end
108
108
  context '' do
109
109
  it 'updates the index correctly' do
110
- request.post('/', params: {
110
+ request.put('/', params: {
111
111
  index: 'some_index',
112
112
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
113
113
  })
@@ -115,7 +115,7 @@ describe 'Sinatra Index Actions' do
115
115
  results = MultiJson.decode request.get('/people', params: { query: 'florian' }).body
116
116
  results['total'].should == 1
117
117
 
118
- request.post('/', params: {
118
+ request.put('/', params: {
119
119
  index: 'some_index',
120
120
  data: %Q{{ "id":"2", "name":"Florian", "surname":"Meier" }}
121
121
  })
@@ -124,7 +124,7 @@ describe 'Sinatra Index Actions' do
124
124
  results['total'].should == 2
125
125
  end
126
126
  it 'updates the index correctly' do
127
- request.post('/', params: {
127
+ request.put('/', params: {
128
128
  index: 'some_index',
129
129
  data: %Q{{ "id":"1", "name":"Flarian", "surname":"Hanke" }}
130
130
  })
@@ -137,7 +137,7 @@ describe 'Sinatra Index Actions' do
137
137
 
138
138
  # Whoops, typo. Let's fix it.
139
139
  #
140
- request.post('/', params: {
140
+ request.put('/', params: {
141
141
  index: 'some_index',
142
142
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
143
143
  })
@@ -152,11 +152,11 @@ describe 'Sinatra Index Actions' do
152
152
  results['total'].should == 1
153
153
  end
154
154
  it 'deletes entries from the index correctly' do
155
- request.post('/', params: {
155
+ request.put('/', params: {
156
156
  index: 'some_index',
157
157
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
158
158
  })
159
- request.post('/', params: {
159
+ request.put('/', params: {
160
160
  index: 'some_index',
161
161
  data: %Q{{ "id":"2", "name":"Florian", "surname":"Meier" }}
162
162
  })
@@ -184,7 +184,7 @@ describe 'Sinatra Index Actions' do
184
184
  it 'works with the (test) client' do
185
185
  client = Picky::TestClient.new MyIndexActionsPickyServer, :path => '/people'
186
186
 
187
- request.post('/', params: {
187
+ request.put('/', params: {
188
188
  index: 'some_index',
189
189
  data: %Q{{ "id":"1", "name":"Florian", "surname":"Hanke" }}
190
190
  })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picky
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.7
4
+ version: 4.12.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 4.12.7
37
+ version: 4.12.8
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 4.12.7
45
+ version: 4.12.8
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: text
48
48
  requirement: !ruby/object:Gem::Requirement