|
49 | 49 | end |
50 | 50 |
|
51 | 51 | describe "#delete_series" do |
52 | | - let(:name) { "events" } |
53 | | - let(:query) { "DROP SERIES FROM #{name}" } |
| 52 | + describe "without a where clause" do |
| 53 | + let(:name) { "events" } |
| 54 | + let(:query) { "DROP SERIES FROM \"#{name}\"" } |
54 | 55 |
|
55 | | - before do |
56 | | - stub_request(:get, "http://influxdb.test:9999/query") |
57 | | - .with(query: { u: "username", p: "password", q: query, db: "database" }) |
| 56 | + before do |
| 57 | + stub_request(:get, "http://influxdb.test:9999/query") |
| 58 | + .with(query: { u: "username", p: "password", q: query, db: "database" }) |
| 59 | + end |
| 60 | + |
| 61 | + it "should GET to remove a database" do |
| 62 | + expect(subject.delete_series(name)).to be_a(Net::HTTPOK) |
| 63 | + end |
58 | 64 | end |
59 | 65 |
|
60 | | - it "should GET to remove a database" do |
61 | | - expect(subject.delete_series(name)).to be_a(Net::HTTPOK) |
| 66 | + describe "with a where clause" do |
| 67 | + let(:name) { "events" } |
| 68 | + let(:query) { "DROP SERIES FROM \"#{name}\" WHERE \"tag\"='value'" } |
| 69 | + |
| 70 | + before do |
| 71 | + stub_request(:get, "http://influxdb.test:9999/query") |
| 72 | + .with(query: { u: "username", p: "password", q: query, db: "database" }) |
| 73 | + end |
| 74 | + |
| 75 | + it "should GET to remove a database" do |
| 76 | + expect(subject.delete_series(name, where: "\"tag\"='value'")).to be_a(Net::HTTPOK) |
| 77 | + end |
62 | 78 | end |
63 | 79 | end |
64 | 80 | end |
0 commit comments