Skip to content

Commit

Permalink
[BUGFIX] Support input match content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jun 21, 2013
1 parent 9a8e49b commit cef5198
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/punchblock/component/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class Complete
class Match < Event::Complete::Reason
register :match, :input_complete

attribute :content_type, String, default: 'application/nlsml+xml'

attribute :nlsml
def nlsml=(other)
doc = case other
Expand Down
4 changes: 3 additions & 1 deletion spec/punchblock/component/input_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def grxml_doc(mode = :dtmf)
let :stanza do
<<-MESSAGE
<complete xmlns='urn:xmpp:rayo:ext:1'>
<match xmlns="urn:xmpp:rayo:input:complete:1">
<match xmlns="urn:xmpp:rayo:input:complete:1" content-type="application/nlsml+xml">
#{nlsml_string}
</match>
</complete>
Expand All @@ -270,6 +270,7 @@ def grxml_doc(mode = :dtmf)
it { should be_instance_of Input::Complete::Match }

its(:name) { should be == :match }
its(:content_type) { should be == 'application/nlsml+xml' }
its(:nlsml) { should be == expected_nlsml }
its(:mode) { should be == :voice }
its(:confidence) { should be == 0.6 }
Expand All @@ -281,6 +282,7 @@ def grxml_doc(mode = :dtmf)
Input::Complete::Match.new :nlsml => expected_nlsml
end

its(:content_type) { should be == 'application/nlsml+xml' }
its(:nlsml) { should be == expected_nlsml }
its(:mode) { should be == :voice }
its(:confidence) { should be == 0.6 }
Expand Down

0 comments on commit cef5198

Please sign in to comment.