We are working towards combining business logic in web and api endpoints. For that purpose, we will introduce helper classes that will be shared between the two routes. This is the base class for those helper classes. The base class is quite simple at the moment. It only includes an initializer and few helper methods to easily access app object's fields. What this and following commits provide is mostly a refactor and deduplication. There are almost no changes in the actual behavior of the app. In the few cases where there are changes, they are made on the side of web endpoints and caller part of the code is also updated respectively.
9 lines
304 B
Ruby
9 lines
304 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../spec_helper"
|
|
|
|
RSpec.describe Clover, "base" do
|
|
it "raises exception for unexpected class" do
|
|
expect { Routes::Common::Base.new(app: Object.new, request: nil, user: nil, location: nil, resource: nil) }.to raise_error("Unknown app mode")
|
|
end
|
|
end
|