Skip to content

Commit bf825bd

Browse files
committed
get input types from print services
1 parent 6ec976f commit bf825bd

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

app/models/print_host.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ class NotReady < RuntimeError
1313
def service
1414
PROTOCOLS[protocol].new(print_host: self)
1515
end
16+
17+
def input_types
18+
PROTOCOLS[protocol]::INPUT_TYPES
19+
end
1620
end

spec/models/print_host_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@
2424
expect(described_class.create(attributes.merge(protocol: :nope))).not_to be_valid
2525
end
2626
end
27+
28+
context "with a valid print host" do
29+
let(:print_host) { create(:print_host) }
30+
31+
it "can list input types" do
32+
expect(print_host.input_types.map(&:to_s)).to eq ["text/x-gcode"]
33+
end
34+
end
2735
end

0 commit comments

Comments
 (0)