mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
added tests
This commit is contained in:
parent
e74cf2bc7f
commit
d6824bf46c
5 changed files with 94 additions and 5 deletions
|
@ -18,6 +18,7 @@ class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
|||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_response :ok
|
||||
assert_emails 2
|
||||
assert_equal json[:data][:user][:username], @user.username
|
||||
assert_equal json[:data][:result], "true"
|
||||
assert_equal json[:data][:message], "Accreditation info successfully added"
|
||||
|
@ -31,6 +32,7 @@ class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
|||
|
||||
assert_response :unauthorized
|
||||
|
||||
assert_emails 0
|
||||
assert_equal json[:code], 2202
|
||||
assert_equal json[:message], 'Invalid authorization information'
|
||||
end
|
||||
|
@ -43,6 +45,7 @@ class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
|||
|
||||
assert_response :ok
|
||||
|
||||
assert_emails 0
|
||||
assert_equal json[:code], 2303
|
||||
assert_equal json[:message], "Object 'chungachanga' does not exist"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue