From e8984445447cb479dc1829f047959354070720bc Mon Sep 17 00:00:00 2001 From: Ahmad Tolba Date: Sat, 14 Jun 2025 21:37:30 +0200 Subject: [PATCH 1/2] Fix failing specs --- spec/system/create_site_spec.rb | 8 +++----- spec/system/public_form_spec.rb | 7 ++++--- spec/system/sign_up_spec.rb | 11 ++++------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/spec/system/create_site_spec.rb b/spec/system/create_site_spec.rb index 76ce52fd23..ab06d59e94 100644 --- a/spec/system/create_site_spec.rb +++ b/spec/system/create_site_spec.rb @@ -1,5 +1,4 @@ describe 'User creates a site' do - before do sign_in click_link 'Add a new site' @@ -11,12 +10,11 @@ expect(page).to have_content('Site was successfully created.') end - it 'with blank name' do + it 'with blank name' do fill_in 'Name', with: '' click_button 'Create' - message = page.find("#site_name").native.attribute("validationMessage") - expect(message).to eq "Please fill out this field." + message = page.find('#site_name').native.attribute('validationMessage') + expect(message).to eq 'Please fill in this field.' expect(page).not_to have_content('Site was successfully created.') end - end diff --git a/spec/system/public_form_spec.rb b/spec/system/public_form_spec.rb index e7510dfecd..a7a4694787 100644 --- a/spec/system/public_form_spec.rb +++ b/spec/system/public_form_spec.rb @@ -1,9 +1,11 @@ describe 'A site with a form content type' do + before do + create_full_site + end - before { create_full_site } + let(:entry) { @site.content_entries.last } describe 'it submits the form in HTML' do - before { preview_page 'contact' } it 'with valid inputs' do @@ -11,7 +13,6 @@ fill_in 'content[message]', with: 'Hello world' click_button 'Send' - entry = @site.content_entries.last expect(entry.name).to eq 'John Doe' expect(entry.message).to eq 'Hello world' diff --git a/spec/system/sign_up_spec.rb b/spec/system/sign_up_spec.rb index 1526d97dd3..82dc55821e 100644 --- a/spec/system/sign_up_spec.rb +++ b/spec/system/sign_up_spec.rb @@ -1,6 +1,5 @@ describe 'User signs up' do - - it 'with valid email and password' do + it 'with valid email and password' do sign_up_with 'John Doe', 'john@doe.net', 'password' expect(page).to have_content('My sites') expect(page).to have_content('You have signed up successfully.') @@ -9,15 +8,15 @@ it 'with invalid email' do sign_up_with 'John Doe', 'invalid_email', 'password' expect(page).to have_content('Already have an account?') - message = page.find("#locomotive_account_email").native.attribute("validationMessage") + message = page.find('#locomotive_account_email').native.attribute('validationMessage') expect(message).to eq "Please include an '@' in the email address. 'invalid_email' is missing an '@'." end it 'with blank password' do sign_up_with 'John Doe', 'valid@example.com', '' expect(page).to have_content('Already have an account?') - message = page.find("#locomotive_account_password").native.attribute("validationMessage") - expect(message).to eq "Please fill out this field." + message = page.find('#locomotive_account_password').native.attribute('validationMessage') + expect(message).to eq 'Please fill in this field.' end it 'with not matching passwords' do @@ -27,7 +26,6 @@ end context 'registration disabled' do - before { allow(Locomotive.config).to receive(:enable_registration).and_return(false) } it 'login screen does not show link to create account' do @@ -35,5 +33,4 @@ expect(page).to_not have_content('Do not have an account?') end end - end From a0950ee5c58dbfe7fe48b3169c84560358675201 Mon Sep 17 00:00:00 2001 From: Ahmad Tolba Date: Sat, 14 Jun 2025 21:38:10 +0200 Subject: [PATCH 2/2] Fix Gemfile.lock --- Gemfile.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 89a7b1016e..a97e6b80c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -354,6 +354,7 @@ GEM mime-types-data (3.2023.1003) mimetype-fu (0.1.2) mini_mime (1.1.5) + mini_portile2 (2.8.9) minitest (5.20.0) moneta (1.6.0) monetize (1.12.0) @@ -389,6 +390,9 @@ GEM net-smtp (0.4.0) net-protocol nio4r (2.6.0) + nokogiri (1.16.7) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) nokogiri (1.16.7-x86_64-darwin) racc (~> 1.4) origin (2.3.1) @@ -561,6 +565,7 @@ GEM zeitwerk (2.6.12) PLATFORMS + ruby x86_64-darwin-22 DEPENDENCIES