Sha256: 9c5df2bf181dda19c3c8b71e944486848743a12a126428dd0880a972c1322437

Contents?: true

Size: 1004 Bytes

Versions: 1

Compression:

Stored size: 1004 Bytes

Contents

# frozen_string_literal: true

require File.expand_path('../test_helper', File.dirname(__FILE__))
require 'aws-sdk-s3'
require File.expand_path('../../lib/coverband/reporters/web', File.dirname(__FILE__))
require 'rack/test'

ENV['RACK_ENV'] = 'test'

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0')
  module Coverband
    class WebTest < Minitest::Test
      include Rack::Test::Methods

      def app
        Coverband::Reporters::Web.new
      end

      def teardown
        super
        Coverband.configuration.s3_bucket = nil
      end

      # TODO: add tests for all endpoints
      test 'renders index content' do
        get '/'
        assert last_response.ok?
        assert_match 'Coverband Admin', last_response.body
      end

      test 'renders show content' do
        Coverband::Reporters::HTMLReport.expects(:report).returns('content')
        get '/show'
        assert last_response.ok?
        assert_equal 'content', last_response.body
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coverband-4.0.1 test/unit/reports_web_test.rb