Skip to content
Permalink
Browse files

Refactoring: Migrate user_mail_delivery_failed to RSpec

  • Loading branch information...
Ryan Lue authored and thorsteneckel committed Mar 14, 2019
1 parent 444e48e commit 17ed0a13f66f9d1f3b0ab0f10c6e5bf72c61a810
Showing with 23 additions and 40 deletions.
  1. +23 −0 spec/models/user_spec.rb
  2. +0 −40 test/unit/user_mail_delivery_failed_test.rb
@@ -436,6 +436,29 @@
end
end
end

describe '#preferences' do
describe '"mail_delivery_failed{,_data}" keys' do
before do
user.update(
preferences: {
mail_delivery_failed: true,
mail_delivery_failed_data: Time.current
}
)
end

it 'deletes "mail_delivery_failed"' do
expect { user.update(email: Faker::Internet.email) }
.to change { user.preferences.key?(:mail_delivery_failed) }.to(false)
end

it 'leaves "mail_delivery_failed_data" untouched' do
expect { user.update(email: Faker::Internet.email) }
.to not_change { user.preferences[:mail_delivery_failed_data] }
end
end
end
end

describe 'Associations:' do

This file was deleted.

Oops, something went wrong.

0 comments on commit 17ed0a1

Please sign in to comment.
You can’t perform that action at this time.