mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 09:34:57 +02:00
fixes and cleanups for new auth model
This commit is contained in:
parent
21b0848030
commit
f44ce014d3
8 changed files with 63 additions and 32 deletions
|
@ -80,6 +80,29 @@ def generate_ssl_certs(opts={})
|
|||
end
|
||||
|
||||
describe 'site/settings' do
|
||||
describe 'permissions' do
|
||||
include Capybara::DSL
|
||||
|
||||
before do
|
||||
@parent_site = Fabricate :site
|
||||
@child_site = Fabricate :site, parent_site_id: @parent_site.id
|
||||
@other_site = Fabricate :site
|
||||
end
|
||||
|
||||
it 'fails without permissions' do
|
||||
page.set_rack_session id: @other_site.id
|
||||
|
||||
visit "/settings/#{@parent_site.username}"
|
||||
page.current_path.must_equal '/' # This could be better
|
||||
end
|
||||
|
||||
it 'allows child site editing from parent' do
|
||||
page.set_rack_session id: @parent_site.id
|
||||
visit "/settings/#{@child_site.username}"
|
||||
page.current_path.must_equal "/settings/#{@child_site.username}"
|
||||
end
|
||||
end
|
||||
|
||||
describe 'ssl' do
|
||||
include Capybara::DSL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue