Skip to content

Commit

Permalink
+ delete
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Jan 5, 2012
1 parent 85d437e commit 5278f83
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/spec/integration/sinatra_index_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class MyPickyServer < Sinatra::Base
end

describe 'updating' do
before(:each) do
Picky::Indexes.clear
end
let(:request) { ::Rack::MockRequest.new MyPickyServer }
it 'should update the index correctly' do
request.post('/', params: { index: 'index', data: { id: "1", name: "Florian", surname: "Hanke" } })
Expand All @@ -47,6 +50,12 @@ class MyPickyServer < Sinatra::Base
results = Yajl::Parser.parse request.get('/people', params: { query: 'florian' }).body
results['total'].should == 1
end
it 'should have no problem with a superfluous delete' do
request.delete('/', params: { index: 'index', data: { id: "1" } })

results = Yajl::Parser.parse request.get('/people', params: { query: 'florian' }).body
results['total'].should == 0
end
end

end

0 comments on commit 5278f83

Please sign in to comment.