Skip to content

Commit

Permalink
Implement a default finish key of hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Gilbraith committed Mar 13, 2013
1 parent daa3bb7 commit 4dfc114
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/twilio-test-toolkit/call_scope.rb
Expand Up @@ -86,7 +86,7 @@ def gather_method


def gather_finish_on_key def gather_finish_on_key
raise "Not a gather" unless gather? raise "Not a gather" unless gather?
return @xml["finishOnKey"] return @xml["finishOnKey"] || '#' # '#' is the default finish key if not specified
end end


def press(digits) def press(digits)
Expand Down
7 changes: 7 additions & 0 deletions spec/requests/call_scope_spec.rb
Expand Up @@ -246,6 +246,13 @@
# We should still be on the same page # We should still be on the same page
@call.current_path.should == test_start_twilio_index_path @call.current_path.should == test_start_twilio_index_path
end end

it "should respond to the default finish key of hash" do
@call.within_gather do |gather|
gather.press "98765#"
end
@call.should have_say "You entered 98765."
end
end end


describe "with finishOnKey specified" do describe "with finishOnKey specified" do
Expand Down

0 comments on commit 4dfc114

Please sign in to comment.