mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-06-26 02:30:22 +02:00
gem: allow config to contain users without any hosts
This commit is contained in:
@ -15,6 +15,9 @@ describe Dyndnsd::Daemon do
|
||||
'test' => {
|
||||
'password' => 'secret',
|
||||
'hosts' => ['foo.example.org', 'bar.example.org']
|
||||
},
|
||||
'test2' => {
|
||||
'password' => 'ihavenohosts'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,6 +102,14 @@ describe Dyndnsd::Daemon do
|
||||
expect(last_response.body).to eq('notfqdn')
|
||||
end
|
||||
|
||||
it 'rejects request if user does not own any hostnames' do
|
||||
authorize 'test2', 'ihavenohosts'
|
||||
|
||||
get '/nic/update?hostname=doesnotexisthost.example.org'
|
||||
expect(last_response).to be_ok
|
||||
expect(last_response.body).to eq('nohost')
|
||||
end
|
||||
|
||||
it 'rejects request if user does not own one hostname' do
|
||||
authorize 'test', 'secret'
|
||||
|
||||
|
Reference in New Issue
Block a user