Sha256: 3b469ba39f30d47f0a9e6db77644e03249c7edfa3475fd672639715b655c73bd

Contents?: true

Size: 1.48 KB

Versions: 22

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

require "spec_helper"

describe "Scoped routes" do
  before :all do
    Rails.application.routes.disable_clear_and_finalize = true

    Rails.application.routes.draw do
      use_doorkeeper scope: "scope"
    end
  end

  after :all do
    Rails.application.routes.clear!

    load File.expand_path("../dummy/config/routes.rb", __dir__)
  end

  it "GET /scope/authorize routes to authorizations controller" do
    expect(get("/scope/authorize")).to route_to("doorkeeper/authorizations#new")
  end

  it "POST /scope/authorize routes to authorizations controller" do
    expect(post("/scope/authorize")).to route_to("doorkeeper/authorizations#create")
  end

  it "DELETE /scope/authorize routes to authorizations controller" do
    expect(delete("/scope/authorize")).to route_to("doorkeeper/authorizations#destroy")
  end

  it "POST /scope/token routes to tokens controller" do
    expect(post("/scope/token")).to route_to("doorkeeper/tokens#create")
  end

  it "GET /scope/applications routes to applications controller" do
    expect(get("/scope/applications")).to route_to("doorkeeper/applications#index")
  end

  it "GET /scope/authorized_applications routes to authorized applications controller" do
    expect(get("/scope/authorized_applications")).to route_to("doorkeeper/authorized_applications#index")
  end

  it "GET /scope/token/info route to authorized TokenInfo controller" do
    expect(get("/scope/token/info")).to route_to("doorkeeper/token_info#show")
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
doorkeeper-5.1.2 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.6 spec/routing/scoped_routes_spec.rb
doorkeeper-5.3.3 spec/routing/scoped_routes_spec.rb
doorkeeper-5.1.1 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.5 spec/routing/scoped_routes_spec.rb
doorkeeper-5.3.2 spec/routing/scoped_routes_spec.rb
doorkeeper-5.4.0.rc1 spec/routing/scoped_routes_spec.rb
doorkeeper-mongodb-5.2.1 spec/routing/scoped_routes_spec.rb
doorkeeper-mongodb-5.2.0 spec/routing/scoped_routes_spec.rb
doorkeeper-sequel-2.2.0 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.4 spec/routing/scoped_routes_spec.rb
doorkeeper-5.3.1 spec/routing/scoped_routes_spec.rb
doorkeeper-5.3.0 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.3 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.2 spec/routing/scoped_routes_spec.rb
doorkeeper-sequel-2.1.0 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.1 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.0 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.0.rc3 spec/routing/scoped_routes_spec.rb
doorkeeper-5.2.0.rc2 spec/routing/scoped_routes_spec.rb