Sha256: 570d94f6b537a6886206444f80ee59858e8ac4eb4026c160df036853ca00f51c

Contents?: true

Size: 633 Bytes

Versions: 46

Compression:

Stored size: 633 Bytes

Contents

require 'test_helper'

module Shipit
  module Api
    class BaseControllerTest < ActionController::TestCase
      test "authentication is required" do
        get :index
        assert_response :unauthorized
        assert_equal({message: 'Bad credentials'}.to_json, response.body)
      end

      test "with proper credentials the request is processed" do
        authenticate!
        assert_response :ok
      end

      test "#index respond with a list of endpoints" do
        authenticate!
        get :index, format: :json
        assert_equal({stacks_url: api_stacks_url}.to_json, response.body)
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.30.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.29.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.28.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.28.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.27.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.27.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.26.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.25.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.25.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.24.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.23.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.23.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.22.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.21.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.20.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.20.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.19.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.18.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.18.0 test/controllers/api/base_controller_test.rb