mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 07:26:22 +02:00
Removed date_from attribute
This commit is contained in:
parent
0ca07a50fb
commit
7db8b5d970
5 changed files with 78 additions and 200 deletions
8
test/fixtures/files/domain_versions.csv
vendored
8
test/fixtures/files/domain_versions.csv
vendored
|
@ -1,8 +1,12 @@
|
|||
Name,Registrant,Registrar,Action,Created at
|
||||
,John,,destroy,2023-12-04 22:00:00
|
||||
shop.test,John,Best Names,update,2023-12-04 22:00:00
|
||||
hospital.test,John,Good Names,create,2023-12-04 22:00:00
|
||||
library.test,Acme Ltd,Best Names,create,2023-12-04 22:00:00
|
||||
metro.test,Jack,Good Names,create,2023-09-04 21:00:00
|
||||
shop.test,John,Best Names,update,2023-12-04 22:00:00
|
||||
invalid.test,any,Best Names,create,2023-12-04 22:00:00
|
||||
airport.test,John,Best Names,create,2023-12-04 22:00:00
|
||||
shop.test,John,Good Names,create,2023-10-04 21:00:00
|
||||
cinema.test,John,Good Names,create,2023-09-04 21:00:00
|
||||
metro.test,Jack,Good Names,create,2023-09-04 21:00:00
|
||||
,test_code,Best Names,update,2018-04-23 15:50:48
|
||||
,John,,update,2010-07-04 21:00:00
|
||||
|
|
|
46
test/fixtures/log_domains.yml
vendored
46
test/fixtures/log_domains.yml
vendored
|
@ -7,6 +7,46 @@ one:
|
|||
updated_at: <%= Time.zone.parse('2010-07-05') %>
|
||||
created_at: <%= Time.zone.parse('2010-07-05') %>
|
||||
|
||||
create_one:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:shop) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
object_changes:
|
||||
name: [null, 'shop.test']
|
||||
registrar_id: [null, <%= ActiveRecord::FixtureSet.identify(:goodnames) %>]
|
||||
registrant_id: [null, <%= ActiveRecord::FixtureSet.identify(:john) %>]
|
||||
created_at: <%= Time.zone.parse('2023-10-05') %>
|
||||
|
||||
create_two:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:airport) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
object_changes:
|
||||
name: [null, 'airport.test']
|
||||
registrar_id: [null, <%= ActiveRecord::FixtureSet.identify(:bestnames) %>]
|
||||
registrant_id: [null, <%= ActiveRecord::FixtureSet.identify(:john) %>]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
create_three:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:hospital) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
object_changes:
|
||||
name: [null, 'hospital.test']
|
||||
registrar_id: [null, <%= ActiveRecord::FixtureSet.identify(:goodnames) %>]
|
||||
registrant_id: [null, <%= ActiveRecord::FixtureSet.identify(:john) %>]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
create_four:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:invalid) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
object_changes:
|
||||
name: [null, 'invalid.test']
|
||||
registrar_id: [null, <%= ActiveRecord::FixtureSet.identify(:bestnames) %>]
|
||||
registrant_id: [null, <%= ActiveRecord::FixtureSet.identify(:invalid) %>]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
transfer_one:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:shop) %>
|
||||
item_type: Domain
|
||||
|
@ -18,7 +58,7 @@ transfer_one:
|
|||
registrar_id: [<%= ActiveRecord::FixtureSet.identify(:goodnames) %>, <%= ActiveRecord::FixtureSet.identify(:bestnames) %>]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
create_one:
|
||||
create_five:
|
||||
item_id: 1111111
|
||||
item_type: Domain
|
||||
event: create
|
||||
|
@ -39,7 +79,7 @@ destroy_one:
|
|||
registrar_id: [<%= ActiveRecord::FixtureSet.identify(:goodnames) %>, null]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
create_two:
|
||||
create_six:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:library) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
|
@ -49,7 +89,7 @@ create_two:
|
|||
registrant_id: [null, <%= ActiveRecord::FixtureSet.identify(:acme_ltd) %>]
|
||||
created_at: <%= Time.zone.parse('2023-12-05') %>
|
||||
|
||||
create_three:
|
||||
create_seven:
|
||||
item_id: <%= ActiveRecord::FixtureSet.identify(:metro) %>
|
||||
item_type: Domain
|
||||
event: create
|
||||
|
|
|
@ -19,8 +19,8 @@ class ReppV1StatsMarketShareTest < ActionDispatch::IntegrationTest
|
|||
assert_equal 1000, json[:code]
|
||||
assert_equal 'Command completed successfully', json[:message]
|
||||
|
||||
assert_equal json[:data], [{ name: @user.registrar.name, y: 4, sliced: true, selected: true },
|
||||
{ name: 'Good Names', y: 2 }]
|
||||
assert_equal json[:data], [{ name: 'Good Names', y: 2 },
|
||||
{ name: @user.registrar.name, y: 4, sliced: true, selected: true }]
|
||||
end
|
||||
|
||||
def test_shows_market_share_growth_rate_data
|
||||
|
@ -35,10 +35,10 @@ class ReppV1StatsMarketShareTest < ActionDispatch::IntegrationTest
|
|||
assert_equal 'Command completed successfully', json[:message]
|
||||
|
||||
assert_equal json[:data], prev_data: { name: prev_date,
|
||||
domains: [['Best Names', 1], ['Good Names', 2]],
|
||||
market_share: [['Best Names', 33.3], ['Good Names', 66.7]] },
|
||||
domains: [['Good Names', 3], ['Best Names', 0]],
|
||||
market_share: [['Good Names', 100.0], ['Best Names', 0.0]] },
|
||||
data: { name: @today,
|
||||
domains: [['Best Names', 4], ['Good Names', 2]],
|
||||
market_share: [['Best Names', 66.7], ['Good Names', 33.3]] }
|
||||
domains: [['Good Names', 2], ['Best Names', 4]],
|
||||
market_share: [['Good Names', 33.3], ['Best Names', 66.7]] }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,13 +24,14 @@ class PaperTrailLearningTest < ActiveSupport::TestCase
|
|||
|
||||
def test_returns_version_count_on_domains
|
||||
@domain = domains(:airport)
|
||||
@domain.save
|
||||
|
||||
assert_equal 1, @domain.versions.count
|
||||
assert_difference -> { @domain.versions.count }, 1 do
|
||||
@domain.save
|
||||
end
|
||||
|
||||
@domain.name = 'domain.test'
|
||||
@domain.save!
|
||||
assert_equal 2, @domain.versions.count
|
||||
assert_difference -> { @domain.versions.count }, 1 do
|
||||
@domain.save!
|
||||
end
|
||||
end
|
||||
|
||||
def test_returns_version_count_on_users
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue