Skip to content

Commit

Permalink
Fixes #12597: remove extraneous method definition in the DNS API tests
Browse files Browse the repository at this point in the history
And removed redundant validation in dns api 'delete' call
  • Loading branch information
sodabrew authored and dmitri-d committed Nov 26, 2015
1 parent 42b9581 commit bef9bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion modules/dns/dns_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Api < ::Sinatra::Base
end

delete "/:value" do
log_halt(400, "'remove' requires value parameter") if params[:value].nil?
type = params[:value].match(/\.(in-addr|ip6)\.arpa$/) ? "PTR" : "A"

begin
Expand Down
8 changes: 3 additions & 5 deletions test/dns/dns_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ def test_delete_ptr_record
end

def test_delete_returns_error_if_value_is_missing
def test_create_returns_error_if_type_is_missing
delete '/'
assert_equal 400, last_response.status
end
delete '/'
assert_equal 404, last_response.status
end
end
end

0 comments on commit bef9bee

Please sign in to comment.