a little more testing

This commit is contained in:
Adam Cooke
2017-05-08 16:39:32 +01:00
parent 61e3bad83f
commit eee01c9e15
10 changed files with 257 additions and 4 deletions
@@ -0,0 +1,23 @@
require 'rails_helper'
describe OutgoingMessagePrototype do
it "should create a new message" do
with_global_server do |server|
domain = create(:domain, :owner => server)
prototype = OutgoingMessagePrototype.new(server, '127.0.0.1', 'TestSuite', {
:from => "test@#{domain.name}",
:to => "test@example.com",
:subject => "Test Message",
:plain_body => "A plain body!"
})
expect(prototype.valid?).to be true
message = prototype.create_message('test@example.com')
expect(message).to be_a Hash
expect(message[:id]).to be_a Integer
expect(message[:token]).to be_a String
end
end
end
+14
View File
@@ -0,0 +1,14 @@
require 'rails_helper'
describe Server do
context "model" do
subject(:server) { create(:server) }
it "should have a UUID" do
expect(server.uuid).to be_a String
expect(server.uuid.length).to eq 36
end
end
end