From 9a2f9beeca1cb304c51613e5bf3fdbfe1a94b1a0 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Tue, 1 Dec 2009 12:18:17 +0000 Subject: Test for PostgreSQL slash escaping bug http://blog.aradine.com/2009/09/rubys-marshal-and-activerecord-and.html https://rails.lighthouseapp.com/projects/8994/tickets/1063-binary-data-broken-with-postgresql-adapter --- spec/models/raw_email_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/models/raw_email_spec.rb (limited to 'spec/models') diff --git a/spec/models/raw_email_spec.rb b/spec/models/raw_email_spec.rb new file mode 100644 index 000000000..65780baed --- /dev/null +++ b/spec/models/raw_email_spec.rb @@ -0,0 +1,25 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe User, "manipulating a raw email" do + before do + @raw_email = RawEmail.new + end + + it 'putting data in comes back out' do + @raw_email.data = "Hello, world!" + @raw_email.save! + @raw_email.reload + @raw_email.data.should == "Hello, world!" + end + + it 'putting data in comes back out even if it has a backslash in it' do + @raw_email.data = "This \\ that" + @raw_email.save! + @raw_email.reload + STDERR.puts @raw_email.data + STDERR.puts "This \\ that" + @raw_email.data.should == "This \\ that" + end + +end + -- cgit v1.2.3