Skip to content

Commit

Permalink
Update 404 fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Jan 22, 2016
1 parent 26ba278 commit 4fff5e8
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 96 deletions.
166 changes: 83 additions & 83 deletions spec/dnsimple/client/zones_records_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@
expect(response.total_pages).to be_a(Fixnum)
end

# context "when the zone does not exist" do
# it "raises NotFoundError" do
# stub_request(:get, %r[/v2])
# .to_return(read_http_fixture("notfound-zone.http"))
#
# expect {
# subject.records(account_id, zone_id)
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end
context "when the zone does not exist" do
it "raises NotFoundError" do
stub_request(:get, %r[/v2])
.to_return(read_http_fixture("notfound-zone.http"))

expect {
subject.records(account_id, zone_id)
}.to raise_error(Dnsimple::NotFoundError)
end
end
end

describe "#all_records" do
Expand Down Expand Up @@ -106,16 +106,16 @@
expect(result.id).to eq(64784)
end

# context "when the zone does not exist" do
# it "raises NotFoundError" do
# stub_request(:post, %r[/v2])
# .to_return(read_http_fixture("notfound-zone.http"))
#
# expect {
# subject.create_zone(account_id, zone_id, attributes)
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end
context "when the zone does not exist" do
it "raises NotFoundError" do
stub_request(:post, %r[/v2])
.to_return(read_http_fixture("notfound-zone.http"))

expect {
subject.create_record(account_id, zone_id, attributes)
}.to raise_error(Dnsimple::NotFoundError)
end
end
end

describe "#record" do
Expand Down Expand Up @@ -153,27 +153,27 @@
expect(result.updated_at).to eq("2016-01-07T17:45:13.653Z")
end

# context "when the zone does not exist" do
# it "raises NotFoundError" do
# stub_request(:get, %r[/v2])
# .to_return(read_http_fixture("notfound-zone.http"))
#
# expect {
# subject.record(account_id, zone_id, "0")
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end

# context "when the record does not exist" do
# it "raises NotFoundError" do
# stub_request(:get, %r[/v2])
# .to_return(read_http_fixture("notfound-record.http"))
#
# expect {
# subject.record(account_id, zone_id, "0")
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end
context "when the zone does not exist" do
it "raises NotFoundError" do
stub_request(:get, %r[/v2])
.to_return(read_http_fixture("notfound-zone.http"))

expect {
subject.record(account_id, zone_id, "0")
}.to raise_error(Dnsimple::NotFoundError)
end
end

context "when the record does not exist" do
it "raises NotFoundError" do
stub_request(:get, %r[/v2])
.to_return(read_http_fixture("notfound-record.http"))

expect {
subject.record(account_id, zone_id, "0")
}.to raise_error(Dnsimple::NotFoundError)
end
end
end

describe "#update_record" do
Expand Down Expand Up @@ -204,27 +204,27 @@
expect(result.id).to eq(64784)
end

# context "when the zone does not exist" do
# it "raises NotFoundError" do
# stub_request(:patch, %r[/v2])
# .to_return(read_http_fixture("notfound-zone.http"))
#
# expect {
# subject.update_record(account_id, zone_id, "0", {})
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end

# context "when the record does not exist" do
# it "raises NotFoundError" do
# stub_request(:patch, %r[/v2])
# .to_return(read_http_fixture("notfound-record.http"))
#
# expect {
# subject.update_record(account_id, zone_id, "0", {})
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end
context "when the zone does not exist" do
it "raises NotFoundError" do
stub_request(:patch, %r[/v2])
.to_return(read_http_fixture("notfound-zone.http"))

expect {
subject.update_record(account_id, zone_id, "0", {})
}.to raise_error(Dnsimple::NotFoundError)
end
end

context "when the record does not exist" do
it "raises NotFoundError" do
stub_request(:patch, %r[/v2])
.to_return(read_http_fixture("notfound-record.http"))

expect {
subject.update_record(account_id, zone_id, "0", {})
}.to raise_error(Dnsimple::NotFoundError)
end
end
end

describe "#delete_record" do
Expand All @@ -251,27 +251,27 @@
expect(result).to be_nil
end

# context "when the zone does not exist" do
# it "raises NotFoundError" do
# stub_request(:delete, %r[/v2])
# .to_return(read_http_fixture("notfound-zone.http"))
#
# expect {
# subject.delete_record(account_id, zone_id, "0")
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end

# context "when the record does not exist" do
# it "raises NotFoundError" do
# stub_request(:delete, %r[/v2])
# .to_return(read_http_fixture("notfound-record.http"))
#
# expect {
# subject.delete_record(account_id, zone_id, "0")
# }.to raise_error(Dnsimple::NotFoundError)
# end
# end
context "when the zone does not exist" do
it "raises NotFoundError" do
stub_request(:delete, %r[/v2])
.to_return(read_http_fixture("notfound-zone.http"))

expect {
subject.delete_record(account_id, zone_id, "0")
}.to raise_error(Dnsimple::NotFoundError)
end
end

context "when the record does not exist" do
it "raises NotFoundError" do
stub_request(:delete, %r[/v2])
.to_return(read_http_fixture("notfound-record.http"))

expect {
subject.delete_record(account_id, zone_id, "0")
}.to raise_error(Dnsimple::NotFoundError)
end
end
end

end
2 changes: 1 addition & 1 deletion spec/fixtures.http/notfound-domain.http
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Cache-Control: no-cache
X-Request-Id: bc587ea7-bcd5-4c10-a940-a9b4c8339824
X-Runtime: 0.059966

{"message":"Domain `0' not found"}
{"message":"Domain `0` not found"}
12 changes: 6 additions & 6 deletions spec/fixtures.http/notfound-record.http
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
HTTP/1.1 500 Internal Server Error
HTTP/1.1 404 Not Found
Server: nginx
Date: Thu, 07 Jan 2016 17:06:11 GMT
Date: Fri, 22 Jan 2016 16:46:07 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 500 Internal Server Error
Status: 404 Not Found
Cache-Control: no-cache
X-Request-Id: 9ab528c2-affa-413b-8c6f-fc5a865c418f
X-Runtime: 0.037865
X-Request-Id: 35af0fd2-d020-4f70-861e-b6a42a190bf6
X-Runtime: 0.018847

{"message":"Internal Server Error"}
{"message":"Record `0` not found"}
12 changes: 6 additions & 6 deletions spec/fixtures.http/notfound-zone.http
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
HTTP/1.1 500 Internal Server Error
HTTP/1.1 404 Not Found
Server: nginx
Date: Thu, 07 Jan 2016 16:35:37 GMT
Date: Fri, 22 Jan 2016 16:46:02 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Status: 500 Internal Server Error
Status: 404 Not Found
Cache-Control: no-cache
X-Request-Id: 0de115b1-2143-44e5-b117-c7f9c51ea2ff
X-Runtime: 0.022304
X-Request-Id: 9c19bef5-6902-421c-9f91-dec3bae26102
X-Runtime: 0.014705

{"message":"Internal Server Error"}
{"message":"Zone `0` not found"}

0 comments on commit 4fff5e8

Please sign in to comment.