aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/outgoing_message_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-09-19 15:59:10 +0100
committerLouise Crow <louise.crow@gmail.com>2013-09-19 15:59:10 +0100
commita971331328c4608941c3e7c1336d027802c1cdcc (patch)
tree28de4adf112bfeee1fc22603e46ec17434f37958 /spec/models/outgoing_message_spec.rb
parent93a81f161083f313d14bcc334c19c8871b4e54ca (diff)
Handle salutations with regexp special characters.
Fixes #1104.
Diffstat (limited to 'spec/models/outgoing_message_spec.rb')
-rw-r--r--spec/models/outgoing_message_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/outgoing_message_spec.rb b/spec/models/outgoing_message_spec.rb
index 1e05e09f1..20f07e8fe 100644
--- a/spec/models/outgoing_message_spec.rb
+++ b/spec/models/outgoing_message_spec.rb
@@ -163,3 +163,13 @@ describe IncomingMessage, " when censoring data" do
@om.body.should match(/fancy cat/)
end
end
+
+describe OutgoingMessage, "when validating the format of the message body", :focus => true do
+
+ it 'should handle a salutation with a bracket in it' do
+ outgoing_message = FactoryGirl.build(:initial_request)
+ outgoing_message.stub!(:get_salutation).and_return("Dear Bob (Robert,")
+ lambda{ outgoing_message.valid? }.should_not raise_error(RegexpError)
+ end
+
+end