mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
parent
640faaadb9
commit
42e8f86dae
51 changed files with 1619 additions and 53 deletions
26
test/integration/api/v1/auctions/details_test.rb
Normal file
26
test/integration/api/v1/auctions/details_test.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ApiV1AuctionDetailsTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@auction = auctions(:one)
|
||||
ENV['auction_api_allowed_ips'] = '127.0.0.1'
|
||||
end
|
||||
|
||||
teardown do
|
||||
ENV['auction_api_allowed_ips'] = ''
|
||||
end
|
||||
|
||||
def test_returns_auction_details
|
||||
assert_equal '1b3ee442-e8fe-4922-9492-8fcb9dccc69c', @auction.uuid
|
||||
assert_equal 'auction.test', @auction.domain
|
||||
assert_equal Auction.statuses[:no_bids], @auction.status
|
||||
|
||||
get api_v1_auction_path(@auction.uuid), nil, 'Content-Type' => Mime::JSON.to_s
|
||||
|
||||
assert_response :ok
|
||||
assert_equal ({ 'id' => '1b3ee442-e8fe-4922-9492-8fcb9dccc69c',
|
||||
'domain' => 'auction.test',
|
||||
'status' => Auction.statuses[:no_bids] }), ActiveSupport::JSON
|
||||
.decode(response.body)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue