spec/lib/delivery/que_spec.rb in mail_room-0.10.0 vs spec/lib/delivery/que_spec.rb in mail_room-0.10.1
- old
+ new
@@ -16,30 +16,27 @@
let(:connection) {stub}
let(:options) {MailRoom::Delivery::Que::Options.new(mailbox)}
it 'stores the message in que_jobs table' do
- PG.stubs(:connect).returns(connection)
- connection.stubs(:exec)
-
- MailRoom::Delivery::Que.new(options).deliver('email')
-
- expect(PG).to have_received(:connect).with({
+ PG.expects(:connect).with({
host: 'localhost',
port: 5432,
dbname: 'delivery_test',
user: 'postgres',
password: ''
- })
+ }).returns(connection)
- expect(connection).to have_received(:exec).with(
+ connection.expects(:exec).with(
"INSERT INTO que_jobs (priority, job_class, queue, args) VALUES ($1, $2, $3, $4)",
[
5,
'ParseMailJob',
'default',
JSON.dump(['email'])
]
)
+
+ MailRoom::Delivery::Que.new(options).deliver('email')
end
end
end