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.17.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.16.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.15.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.14.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.13.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.12.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.12.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.11.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.10.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.9.0 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.9 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.8 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.7 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.6 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.5 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.4 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.3 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.2 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.1 test/controllers/api/base_controller_test.rb
shipit-engine-0.8.0 test/controllers/api/base_controller_test.rb