def self.create(pattern)
mailgun.routes.create "Catch-all route for #{ENV['MAILGUN_ROUTE_DOMAIN']}",
DEFAULT_PRIORITY,
[:match_recipient, pattern],
[[:forward, endpoint_url], [:stop]]
end
# ...
describe '.create' do
let(:pattern) { '.*@.*.test.com' }
it 'creates a route' do
VCR.use_cassette :email_route_create do
EmailRoute.create pattern
expect(EmailRoute.existing_route(pattern)).to be_present
end
end
end
When I perform a
Mailgun().routes.create
orMailgun().routes.update
command, I get the following error:I debugged the problem and found that at https://github.com/HashNuke/mailgun/blob/master/lib/mailgun/base.rb#L71 RestClient is not recognizing the parameters hash passed to it and not posting parameters to Mailgun, even though it has data.
Here's my test code:
Here's a dump of my VCR cassette during a create: