mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fixes for tests
This commit is contained in:
parent
df78018547
commit
52c488a3d7
3 changed files with 7 additions and 6 deletions
|
@ -6,14 +6,14 @@ describe 'site/settings' do
|
|||
|
||||
before do
|
||||
EmailWorker.jobs.clear
|
||||
@email = "#{SecureRandom.uuid.gsub('-', '')}@example.com"
|
||||
@email = "#{SecureRandom.uuid.gsub('-', '')}@exampleedsdfdsf.com"
|
||||
@site = Fabricate :site, email: @email
|
||||
page.set_rack_session id: @site.id
|
||||
visit '/settings'
|
||||
end
|
||||
|
||||
it 'should change email' do
|
||||
@new_email = "#{SecureRandom.uuid.gsub('-', '')}@example.com"
|
||||
@new_email = "#{SecureRandom.uuid.gsub('-', '')}@exampleedsdfdsf.com"
|
||||
fill_in 'email', with: @new_email
|
||||
click_button 'Change Email'
|
||||
|
||||
|
@ -45,7 +45,7 @@ describe 'site/settings' do
|
|||
end
|
||||
|
||||
it 'should fail for existing email' do
|
||||
@existing_email = "#{SecureRandom.uuid.gsub('-', '')}@example.com"
|
||||
@existing_email = "#{SecureRandom.uuid.gsub('-', '')}@exampleedsdfdsf.com"
|
||||
@existing_site = Fabricate :site, email: @existing_email
|
||||
|
||||
fill_in 'email', with: @existing_email
|
||||
|
@ -77,7 +77,7 @@ describe 'site/settings' do
|
|||
include Capybara::DSL
|
||||
|
||||
before do
|
||||
@email = "#{SecureRandom.uuid.gsub('-', '')}@example.com"
|
||||
@email = "#{SecureRandom.uuid.gsub('-', '')}@exampleedsdfdsf.com"
|
||||
@site = Fabricate :site, email: @email
|
||||
EmailWorker.jobs.clear
|
||||
Mail::TestMailer.deliveries.clear
|
||||
|
|
|
@ -58,7 +58,8 @@ describe 'signup' do
|
|||
page.must_have_content /almost ready!/
|
||||
fill_in 'token', with: Site[username: @site[:username]].email_confirmation_token
|
||||
click_button 'Confirm Email'
|
||||
page.must_have_content /Thanks for joining the Neocities community/
|
||||
current_path.must_equal '/tutorial'
|
||||
page.must_have_content /Let's Get Started/
|
||||
|
||||
index_file_path = File.join Site::SITE_FILES_ROOT, @site[:username], 'index.html'
|
||||
File.exist?(index_file_path).must_equal true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Fabricator(:site) do
|
||||
username { SecureRandom.hex }
|
||||
password { 'abcde' }
|
||||
email { SecureRandom.uuid.gsub('-', '')+'@example.com' }
|
||||
email { SecureRandom.uuid.gsub('-', '')+'@examplesdlfjdslfj.com' }
|
||||
email_confirmed { true }
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue