Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -561,6 +565,7 @@ GEM
zeitwerk (2.6.12)

PLATFORMS
ruby
x86_64-darwin-22

DEPENDENCIES
Expand Down
8 changes: 3 additions & 5 deletions spec/system/create_site_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
describe 'User creates a site' do

before do
sign_in
click_link 'Add a new site'
Expand All @@ -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
7 changes: 4 additions & 3 deletions spec/system/public_form_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
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
fill_in 'content[name]', with: 'John Doe'
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'

Expand Down
11 changes: 4 additions & 7 deletions spec/system/sign_up_spec.rb
Original file line number Diff line number Diff line change
@@ -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', '[email protected]', 'password'
expect(page).to have_content('My sites')
expect(page).to have_content('You have signed up successfully.')
Expand All @@ -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', '[email protected]', ''
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
Expand All @@ -27,13 +26,11 @@
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
visit locomotive.sign_in_path
expect(page).to_not have_content('Do not have an account?')
end
end

end