mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 11:58:28 +02:00
add ability to restore deleted sites
This commit is contained in:
parent
c4e307fcf1
commit
c9ba1cf0f4
6 changed files with 96 additions and 10 deletions
|
@ -13,6 +13,23 @@ describe 'signin' do
|
|||
Capybara.reset_sessions!
|
||||
end
|
||||
|
||||
it 'restores a deleted site' do
|
||||
pass = SecureRandom.hex
|
||||
@site = Fabricate :site, password: pass
|
||||
@site.destroy
|
||||
Dir.exist?(@site.files_path).must_equal false
|
||||
Dir.exist?(@site.deleted_files_path).must_equal true
|
||||
visit '/signin'
|
||||
fill_in 'username', with: @site.username
|
||||
fill_in 'password', with: pass
|
||||
click_button 'Sign In'
|
||||
page.must_have_content 'Restore Site'
|
||||
click_button 'Restore Site'
|
||||
Dir.exist?(@site.deleted_files_path).must_equal false
|
||||
Dir.exist?(@site.files_path).must_equal true
|
||||
@site.reload.is_deleted.must_equal false
|
||||
end
|
||||
|
||||
it 'fails for invalid signin' do
|
||||
visit '/'
|
||||
click_link 'Sign In'
|
||||
|
@ -53,4 +70,4 @@ describe 'signin' do
|
|||
click_button 'Sign In'
|
||||
page.must_have_content 'Your Feed'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue