mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-30 18:58:39 -04:00
* Add authentication dialogs for sign in and sign up - Implemented AuthDialog component to manage sign in and sign up modals. - Created SignInModal and SignUpModal components for handling respective authentication processes. - Added AuthFields component for reusable form fields and error handling. - Updated various views to utilize the new authentication dialogs instead of traditional links. - Enhanced user experience by allowing sign in and sign up actions to occur without full page reloads. - Added feature specs for testing the functionality of the new dialogs. * Refactor modals and input fields for improved accessibility and styling; adjust button sizes and text formatting * Refactor authentication forms and modals for improved usability and accessibility; integrate reCAPTCHA handling and enhance error messaging * Refactor SignUpModal layout for improved responsiveness and accessibility; organize fields into rows and enhance styling * Refactor session view spec to streamline field checks; remove redundant test and retain essential content expectations
41 lines
1.4 KiB
Ruby
41 lines
1.4 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe "signup" do
|
|
it "sign up for new account from top menubar" do
|
|
visit crops_path # something other than front page, which has multiple signup links
|
|
click_link 'Join free'
|
|
fill_in 'Login name', with: 'person123'
|
|
fill_in 'Email', with: 'gardener@example.com'
|
|
fill_in 'Password', with: 'abc123'
|
|
fill_in 'Password confirmation', with: 'abc123'
|
|
check 'I agree to the Terms of Service'
|
|
click_button 'Sign up'
|
|
expect(page).to have_current_path root_path, ignore_query: true
|
|
end
|
|
|
|
it "sign up for new account with existing username" do
|
|
create(:member, login_name: 'person123')
|
|
visit new_member_registration_path
|
|
fill_in 'Login name', with: 'person123'
|
|
fill_in 'Email', with: 'gardener2@example.com'
|
|
fill_in 'Password', with: 'abc123'
|
|
fill_in 'Password confirmation', with: 'abc123'
|
|
check 'I agree to the Terms of Service'
|
|
click_button 'Sign up'
|
|
expect(page).to have_content 'has already been taken'
|
|
end
|
|
|
|
it "sign up for new account without accepting TOS" do
|
|
visit new_member_registration_path
|
|
fill_in 'Login name', with: 'person123'
|
|
fill_in 'Email', with: 'gardener@example.com'
|
|
fill_in 'Password', with: 'abc123'
|
|
fill_in 'Password confirmation', with: 'abc123'
|
|
# do not check 'I agree to the Terms of Service'
|
|
click_button 'Sign up'
|
|
expect(page).to have_current_path members_path, ignore_query: true
|
|
end
|
|
end
|