mirror of
https://github.com/neocities/neocities.git
synced 2025-08-05 01:01:30 +02:00
fix password change
This commit is contained in:
parent
5403d61ac2
commit
2dd3a34961
2 changed files with 24 additions and 2 deletions
|
@ -87,7 +87,6 @@ describe 'site/settings' do
|
|||
@domain = SecureRandom.uuid.gsub('-', '')+'.com'
|
||||
@site = Fabricate :site, domain: @domain
|
||||
page.set_rack_session id: @site.id
|
||||
|
||||
end
|
||||
|
||||
it 'fails without domain set' do
|
||||
|
@ -216,4 +215,27 @@ describe 'site/settings' do
|
|||
Site[username: ''].must_equal nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'change password' do
|
||||
include Capybara::DSL
|
||||
|
||||
before do
|
||||
@site = Fabricate :site, password: 'derpie'
|
||||
page.set_rack_session id: @site.id
|
||||
end
|
||||
|
||||
it 'should change correctly' do
|
||||
visit '/settings'
|
||||
|
||||
fill_in 'current_password', with: 'derpie'
|
||||
fill_in 'new_password', with: 'derpie2'
|
||||
fill_in 'new_password_confirm', with: 'derpie2'
|
||||
click_button 'Change Password'
|
||||
|
||||
page.must_have_content /successfully changed password/i
|
||||
@site.reload
|
||||
@site.valid_password?('derpie').must_equal false
|
||||
@site.valid_password?('derpie2').must_equal true
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue