spec/adhearsion/call_controller/utility_spec.rb in adhearsion-2.5.4 vs spec/adhearsion/call_controller/utility_spec.rb in adhearsion-2.6.0
- old
+ new
@@ -20,11 +20,11 @@
end
end
}
it 'generates the correct GRXML grammar' do
- subject.grammar_digits(2).to_s.should be == grxml.to_s
+ expect(subject.grammar_digits(2).to_s).to eq(grxml.to_s)
end
end # describe #grammar_digits
describe "#grammar_accept" do
@@ -38,51 +38,51 @@
end
end
}
it 'generates the correct GRXML grammar' do
- subject.grammar_accept('35').to_s.should be == grxml.to_s
+ expect(subject.grammar_accept('35').to_s).to eq(grxml.to_s)
end
it 'filters meaningless characters out' do
- subject.grammar_accept('3+5').to_s.should be == grxml.to_s
+ expect(subject.grammar_accept('3+5').to_s).to eq(grxml.to_s)
end
end # grammar_accept
describe "#parse_dtmf" do
context "with a single digit" do
it "correctly returns the parsed input" do
- subject.parse_dtmf("dtmf-3").should be == '3'
+ expect(subject.parse_dtmf("dtmf-3")).to eq('3')
end
it "correctly returns star as *" do
- subject.parse_dtmf("dtmf-star").should be == '*'
+ expect(subject.parse_dtmf("dtmf-star")).to eq('*')
end
it "correctly returns * as *" do
- subject.parse_dtmf("*").should be == '*'
+ expect(subject.parse_dtmf("*")).to eq('*')
end
it "correctly returns pound as #" do
- subject.parse_dtmf("dtmf-pound").should be == '#'
+ expect(subject.parse_dtmf("dtmf-pound")).to eq('#')
end
it "correctly returns # as #" do
- subject.parse_dtmf("#").should be == '#'
+ expect(subject.parse_dtmf("#")).to eq('#')
end
it "correctly parses digits without the dtmf- prefix" do
- subject.parse_dtmf('1').should be == '1'
+ expect(subject.parse_dtmf('1')).to eq('1')
end
it "correctly returns nil when input is nil" do
- subject.parse_dtmf(nil).should be == nil
+ expect(subject.parse_dtmf(nil)).to eq(nil)
end
end
context "with multiple digits separated by spaces" do
it "returns the digits without space separation" do
- subject.parse_dtmf('1 dtmf-5 dtmf-star # 2').should be == '15*#2'
+ expect(subject.parse_dtmf('1 dtmf-5 dtmf-star # 2')).to eq('15*#2')
end
end
end # describe #grammar_accept
end
end