aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/change_email_validator.rb2
-rw-r--r--app/views/request/show_response.rhtml2
-rw-r--r--lib/tnef.rb2
-rw-r--r--spec/controllers/user_controller_spec.rb12
4 files changed, 15 insertions, 3 deletions
diff --git a/app/models/change_email_validator.rb b/app/models/change_email_validator.rb
index a796489f7..ff7f2f931 100644
--- a/app/models/change_email_validator.rb
+++ b/app/models/change_email_validator.rb
@@ -25,7 +25,7 @@ class ChangeEmailValidator < ActiveRecord::BaseWithoutTable
end
if !errors[:old_email]
- if self.old_email != self.logged_in_user.email
+ if self.old_email.downcase != self.logged_in_user.email.downcase
errors.add(:old_email, "address isn't the same as the address of the account you are logged in with")
elsif !self.logged_in_user.has_this_password?(self.password)
if !errors[:password]
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml
index 1d841c3a8..ed32a1b67 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.rhtml
@@ -10,7 +10,7 @@
<% if @gone_postal %>
<div class="gone_postal_help">
- <h1>What exactly is happening?</h1>
+ <h1>Which of these is happening?</h1>
<dl>
diff --git a/lib/tnef.rb b/lib/tnef.rb
index 7b7ce965f..2f200e3eb 100644
--- a/lib/tnef.rb
+++ b/lib/tnef.rb
@@ -9,7 +9,7 @@ class TNEF
main = TMail::Mail.new
main.set_content_type 'multipart', 'mixed', { 'boundary' => TMail.new_boundary }
Dir.mktmpdir do |dir|
- IO.popen("tnef -K -C #{dir}", "w") do |f|
+ IO.popen("/usr/bin/tnef -K -C #{dir}", "w") do |f|
f.write(content)
f.close
if $?.signaled?
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 2bfb35240..193cf476c 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -346,6 +346,18 @@ describe UserController, "when changing email address" do
deliveries.size.should == 0
end
+ it "should work even if the old email had a case difference" do
+ @user = users(:bob_smith_user)
+ session[:user_id] = @user.id
+
+ post :signchangeemail, { :signchangeemail => { :old_email => 'BOB@localhost',
+ :password => 'jonespassword', :new_email => 'newbob@localhost' },
+ :submitted_signchangeemail_do => 1
+ }
+
+ response.should render_template('signchangeemail_confirm')
+ end
+
it "should send confirmation email if you get all the details right" do
@user = users(:bob_smith_user)
session[:user_id] = @user.id