Skip to content

Commit

Permalink
add obs_controller integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agraul committed Jun 5, 2018
1 parent 0c79506 commit 9dd4339
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/integration/obs_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require File.expand_path('../../test_helper', __FILE__)

class OBSControllerTest < ActionDispatch::IntegrationTest
def test_backend_connection
get '/explore'

assert_includes body, 'Search packages...'
assert_equal 200, status
end

def test_backend_error_handling
mock = Minitest::Mock.new
def mock.get
raise Error
end

ApiConnect.stub :get, mock do
get '/explore'
assert_includes body, 'Connection to OBS is unavailable.'
assert_equal 200, status
end
end
end

0 comments on commit 9dd4339

Please sign in to comment.