Commit ffc176ea authored by Michał "rysiek" Woźniak's avatar Michał "rysiek" Woźniak 🔒

let's see if we can figure out mail signing for tests

parent b9c363e2
Pipeline #31833 failed with stages
in 8 minutes and 23 seconds
......@@ -743,7 +743,7 @@ describe Schleuder::List do
teardown_list_and_mailer(list)
end
it "sends the message to all subscribers including the sender, if deliver_selfsent is true" do
it "sends the message to all subscribers including the sender, if deliver_selfsent is true and the mail is correctly signed" do
list = create(:list, send_encrypted_only: false, deliver_selfsent: true)
key_material = File.read("spec/fixtures/default_list_key.txt")
sub, msgs = list.subscribe("admin@example.org", nil, true, true, key_material)
......@@ -754,6 +754,12 @@ describe Schleuder::List do
mail.from = 'user1@example.org'
mail.subject = 'Something'
mail.body = "Some content"
gpg_opts = {
sign: true,
sign_as: 'C4D60F8833789C7CAA44496FD3FFA6613AB10ECE'
}
mail.gpg(gpg_opts)
Schleuder::Runner.new().run(mail, list.email)
messages = Mail::TestMailer.deliveries
......@@ -770,7 +776,7 @@ describe Schleuder::List do
teardown_list_and_mailer(list)
end
it "sends the message to all subscribers but not the sender, if deliver_selfsent is false" do
it "sends the message to all subscribers but not the sender, if deliver_selfsent is false and the mail is correctly signed" do
list = create(:list, send_encrypted_only: false, deliver_selfsent: false)
key_material = File.read("spec/fixtures/default_list_key.txt")
sub, msgs = list.subscribe("admin@example.org", nil, true, true, key_material)
......@@ -781,6 +787,11 @@ describe Schleuder::List do
mail.from = 'user1@example.org'
mail.subject = 'Something'
mail.body = "Some content"
gpg_opts = {
sign: true,
sign_as: 'C4D60F8833789C7CAA44496FD3FFA6613AB10ECE'
}
mail.gpg(gpg_opts)
Schleuder::Runner.new().run(mail, list.email)
messages = Mail::TestMailer.deliveries
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment