changing from cancel to stop

This commit is contained in:
Jared Cosulich 2017-04-05 12:01:12 -04:00
parent cc82f74525
commit 5c3ceb3687
4 changed files with 7 additions and 7 deletions

View file

@ -48,15 +48,15 @@ RSpec.describe AttemptsController, type: :controller do
it "sends back a message" do
post :twilio, params: twilio_attributes
expect(response.body).to eq """We\'ve registered your response of Option 0:1 C.
expect(response.body).to eq """We\'ve registered your response of \"Option 0:1 C\".
To see how others responded to the same question please visit
http://test.host/schools/school/categories/category"""
end
end
context 'with cancel params' do
context 'with stop params' do
let(:twilio_attributes) {
{'MessageSid' => 'ewuefhwieuhfweiuhfewiuhf','AccountSid' => 'wefiuwhefuwehfuwefinwefw','MessagingServiceSid' => 'efwneufhwuefhweiufhiuewhf','From' => '+11231231234','To' => '2223334444','Body' => 'cAnCel','NumMedia' => '0'}
{'MessageSid' => 'ewuefhwieuhfweiuhfewiuhf','AccountSid' => 'wefiuwhefuwehfuwefinwefw','MessagingServiceSid' => 'efwneufhwuefhweiufhiuewhf','From' => '+11231231234','To' => '2223334444','Body' => 'sToP','NumMedia' => '0'}
}
it "updates the last attempt by recipient phone number" do

View file

@ -94,7 +94,7 @@ RSpec.describe Attempt, type: :model do
it 'should contact the Twilio API' do
expect(FakeSMS.messages.length).to eq(2)
expect(FakeSMS.messages.first.body).to eq("Question 0:1")
expect(FakeSMS.messages.last.body).to eq("Option 0:1 A: Reply 1\n\rOption 0:1 B: Reply 2\n\rOption 0:1 C: Reply 3\n\rOption 0:1 D: Reply 4\n\rOption 0:1 E: Reply 5\n\rReply 'cancel' to stop these messages.")
expect(FakeSMS.messages.last.body).to eq("Option 0:1 A: Reply 1\n\rOption 0:1 B: Reply 2\n\rOption 0:1 C: Reply 3\n\rOption 0:1 D: Reply 4\n\rOption 0:1 E: Reply 5\n\rReply 'stop' to stop these messages.")
expect(FakeSMS.messages.first.to).to eq('1111111111')
end