mirror of
https://github.com/usetrmnl/trmnl-api.git
synced 2026-04-29 13:35:13 -07:00
Added RSpec shared endpoint examples
Necessary to a define shared example for all endpoints to reduce duplication. This'll soon be used in all endpoint specs. Milestone: minor
This commit is contained in:
@@ -23,6 +23,7 @@ SPEC_ROOT = Pathname(__dir__).realpath.freeze
|
||||
using Refinements::Pathname
|
||||
|
||||
Pathname.require_tree SPEC_ROOT.join("support/shared_contexts")
|
||||
Pathname.require_tree SPEC_ROOT.join("support/shared_examples")
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.color = true
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.shared_examples "an inspectable endpoint" do |target|
|
||||
it "answers contract class" do
|
||||
expect(target.inspect).to include("@contract=Dry::Schema::JSON, ")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user