Fix class path

#611
This commit is contained in:
Artur Beljajev 2017-10-12 06:34:49 +03:00
parent 551d1799d1
commit 574113152a
2 changed files with 15 additions and 1 deletions

View file

@ -4,7 +4,7 @@ module Admin
# TODO: Refactor this
def create
if DNS::Zone.origins.include?(params[:origin])
if ::DNS::Zone.origins.include?(params[:origin])
@zonefile = ActiveRecord::Base.connection.execute(
"select generate_zonefile('#{params[:origin]}')"

View file

@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.describe 'Admin area zone file generation', settings: false do
let!(:zone) { create(:zone, origin: 'com') }
before do
sign_in_to_admin_area
end
it 'generates new' do
post admin_zonefiles_path(origin: 'com')
expect(response).to be_success
end
end