Only filter regex matches

and a spec test for it.

Previously using the example shown in vmpooler.yaml.example was failing
to tag strings WITHOUT a '/' in them.
This commit is contained in:
Scott Schneider 2015-06-02 19:12:30 -07:00
parent ccede2780e
commit 1f62379be8
2 changed files with 12 additions and 1 deletions

View file

@ -347,6 +347,17 @@ describe Vmpooler::API::V1 do
expect(last_response.body).to eq(JSON.pretty_generate({'ok' => true}))
expect(last_response.status).to eq(200)
end
it 'doesn\'t eat tags not matching filter' do
expect(redis).to receive(:hset).with("vmpooler__vm__testhost", "tag:url", "foo.com")
put "#{prefix}/vm/testhost", '{"tags":{"url":"foo.com"}}'
expect(last_response).to be_ok
expect(last_response.header['Content-Type']).to eq('application/json')
expect(last_response.body).to eq(JSON.pretty_generate({'ok' => true}))
expect(last_response.status).to eq(200)
end
end
context '(auth not configured)' do