mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
added new tests
This commit is contained in:
parent
97876ab1c1
commit
4567e56457
5 changed files with 159 additions and 3 deletions
22
test/interactions/record_date_of_test_test.rb
Normal file
22
test/interactions/record_date_of_test_test.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RecordDateOfTestTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@api_bestname = users(:api_bestnames)
|
||||
@api_bestname.accreditation_date = Time.zone.now - 10.minutes
|
||||
@api_bestname.accreditation_expire_date = @api_bestname.accreditation_date + 1.year
|
||||
@api_bestname.save
|
||||
end
|
||||
|
||||
def test_should_record_data_to_apiuser
|
||||
api_goodname = users(:api_goodnames)
|
||||
|
||||
assert_nil api_goodname.accreditation_date
|
||||
assert_nil api_goodname.accreditation_expire_date
|
||||
|
||||
Actions::RecordDateOfTest.record_result_to_api_user(api_user: api_goodname, date: @api_bestname.accreditation_date)
|
||||
|
||||
assert_equal api_goodname.accreditation_date, @api_bestname.accreditation_date
|
||||
assert_equal api_goodname.accreditation_expire_date, @api_bestname.accreditation_expire_date
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue