Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create auction on domain release if already exists #2017

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/dns/domain_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def to_s
attr_reader :name

def not_auctionable?
blocked? || reserved? || disputed?
blocked? || reserved? || disputed? || pending_auction.present?
end

def zone_with_same_origin?
Expand Down
15 changes: 15 additions & 0 deletions test/models/domain/releasable/auctionable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ def test_skips_auction_when_domains_is_blocked
assert_not @domain.domain_name.at_auction?
end

def test_skips_auction_when_auction_present
assert_equal 'shop.test', @domain.name
Auction.create!(domain: @domain.name, status: Auction.statuses[:started])

assert_difference '@domain.registrar.notifications.count', 1 do
assert_no_difference 'Auction.count' do
@domain.release
end
end

assert_raises ActiveRecord::RecordNotFound do
@domain.reload
end
end

def test_skips_auction_when_domains_is_reserved
assert_equal 'shop.test', @domain.name
reserved_domains(:one).update!(name: 'shop.test')
Expand Down