Skip to content

Commit

Permalink
Document published controller integration tests
Browse files Browse the repository at this point in the history
Explain what is being tested and if it is a FRONTEND, BACKEND or
INTEGRATION test.

Co-authored-by: Moisés Déniz Alemán <mdeniz@suse.com>
Co-authored-by: Adrian Schröter <adrian@suse.de>
  • Loading branch information
3 people authored and coolo committed Nov 14, 2018
1 parent ca236f7 commit 3d295dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/api/test/functional/published_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def setup
reset_auth
end

# FRONTEND: Test published api
def test_index
get '/published'
assert_response 401
Expand Down Expand Up @@ -156,8 +157,11 @@ def test_rpm_md_formats
end

def test_suse_format
# Ensure that it doesn't fail in non SUSE platforms TODO: Move this to a method
return unless File.exist?('/var/adm/fillup-templates') || File.exist?('/usr/share/fillup-templates/')
login_adrian

# BACKEND: Test that tooling used in the backend produce correct content via the api in the frontend
get '/published/BaseDistro3/BaseDistro3_repo/content'
assert_response :success
assert_match(/PRODUCT Open Build Service BaseDistro3 BaseDistro3_repo\n/, @response.body)
Expand All @@ -170,6 +174,9 @@ def test_suse_format
assert_match(/\nDEFAULTBASE i586\n/, @response.body)
assert_match(/\nDESCRDIR descr\n/, @response.body)
assert_match(/\nDATADIR .\n/, @response.body)

# BACKEND: Test that the content generated by the backend tooling is creating some subdirectory in a concrete way
# FRONTEND: Test that the subdirectories created by the backend can be accessed thought the API in the frontend
get '/published/BaseDistro3/BaseDistro3_repo/media.1/directory.yast'
assert_response :success
get '/published/BaseDistro3/BaseDistro3_repo/media.1/media'
Expand Down

0 comments on commit 3d295dd

Please sign in to comment.