diff --git a/app/views/devise/registrations/_registration_form.html.erb b/app/views/devise/registrations/_registration_form.html.erb
index fd1f9f4e3..97af77506 100644
--- a/app/views/devise/registrations/_registration_form.html.erb
+++ b/app/views/devise/registrations/_registration_form.html.erb
@@ -2,7 +2,7 @@
- <% if params[:state] == "new-user" && ForemInstance.private? %>
+ <% if params[:state] == "new-user" && ForemInstance.invitation_only? %>
<%= community_name %> is invite only.
<% else %>
Welcome to <%= community_name %>
diff --git a/app/views/shared/authentication/_providers_registration_form.html.erb b/app/views/shared/authentication/_providers_registration_form.html.erb
index 2a3404eca..b575aa7bf 100644
--- a/app/views/shared/authentication/_providers_registration_form.html.erb
+++ b/app/views/shared/authentication/_providers_registration_form.html.erb
@@ -8,7 +8,7 @@
<% end %>
<% end %>
<% end %>
- <% if params[:state] == "new-user" && Settings::Authentication.allow_email_password_registration && !ForemInstance.private? %>
+ <% if params[:state] == "new-user" && Settings::Authentication.allow_email_password_registration && !ForemInstance.invitation_only? %>
<%= link_to "#{inline_svg_tag('email.svg', aria_hidden: true, class: 'crayons-icon', title: 'email')}Sign up with Email".html_safe,
request.params.merge(state: "email_signup").except("i"),
class: "crayons-btn crayons-btn--l crayons-btn--brand-email crayons-btn--icon-left whitespace-nowrap",
diff --git a/cypress/integration/adminFlows/config/authenticationSection.spec.js b/cypress/integration/adminFlows/config/authenticationSection.spec.js
index e97275bd5..75d3f77e8 100644
--- a/cypress/integration/adminFlows/config/authenticationSection.spec.js
+++ b/cypress/integration/adminFlows/config/authenticationSection.spec.js
@@ -23,9 +23,11 @@ describe('Authentication Section', () => {
cy.visit('/admin/customization/config');
cy.findByTestId('authSectionForm').as('authSectionForm');
- cy.get('@authSectionForm').findByText('Authentication').click();
cy.get('@authSectionForm')
- .findByLabelText('Invite-only mode')
+ .findByRole('heading', { name: 'Authentication' })
+ .click();
+ cy.get('@authSectionForm')
+ .findByRole('checkbox', { name: 'Invite-only mode' })
.should('not.be.checked')
.check();
@@ -34,7 +36,9 @@ describe('Authentication Section', () => {
.type(
`My username is @${username} and this action is 100% safe and appropriate.`,
);
- cy.get('@authSectionForm').findByText('Update Settings').click();
+ cy.get('@authSectionForm')
+ .findByRole('button', { name: 'Update Settings' })
+ .click();
cy.url().should('contains', '/admin/customization/config');
@@ -43,10 +47,11 @@ describe('Authentication Section', () => {
cy.findByText('Successfully updated settings.').should('be.visible');
- cy.get('@authSectionForm').findByText('Authentication').click();
-
cy.get('@authSectionForm')
- .findByLabelText('Invite-only mode')
+ .findByRole('heading', { name: 'Authentication' })
+ .click();
+ cy.get('@authSectionForm')
+ .findByRole('checkbox', { name: 'Invite-only mode' })
.should('be.checked');
// Ensure that none of the authentication providers are enabled.
diff --git a/cypress/integration/adminFlows/pages/landingPage.spec.js b/cypress/integration/adminFlows/pages/landingPage.spec.js
index fe6280718..cde9d05f0 100644
--- a/cypress/integration/adminFlows/pages/landingPage.spec.js
+++ b/cypress/integration/adminFlows/pages/landingPage.spec.js
@@ -4,23 +4,27 @@ describe('Set a landing page from the admin portal', () => {
cy.fixture('users/adminUser.json').as('user');
cy.get('@user').then((user) => {
cy.loginAndVisit(user, '/admin/customization/config').then(() => {
+ cy.get('#new_settings_user_experience').as('userExperienceSectionForm');
// Ensure Forem instance is private
// NOTE: @citizen428 - We may need to find a better situation for this
// long-term.
- cy.findByTestId('authSectionForm').as('authSectionForm');
- cy.get('@authSectionForm').findByText('Authentication').click();
- cy.get('@authSectionForm')
- .findByLabelText('Invite-only mode')
- .should('not.be.checked')
- .check();
+ cy.get('@userExperienceSectionForm')
+ .findByRole('heading', { name: 'User Experience and Brand' })
+ .click();
+ cy.get('@userExperienceSectionForm')
+ .findByRole('checkbox', { name: 'Public' })
+ .should('be.checked')
+ .uncheck();
- cy.get('@authSectionForm')
+ cy.get('@userExperienceSectionForm')
.findByPlaceholderText('Confirmation text')
.type(
`My username is @${user.username} and this action is 100% safe and appropriate.`,
);
- cy.get('@authSectionForm').findByText('Update Settings').click();
+ cy.get('@userExperienceSectionForm')
+ .findByRole('button', { name: 'Update Settings' })
+ .click();
cy.visit('/admin/customization/pages');
});
diff --git a/spec/system/admin/admin_manages_pages_spec.rb b/spec/system/admin/admin_manages_pages_spec.rb
index f80547129..3e2245842 100644
--- a/spec/system/admin/admin_manages_pages_spec.rb
+++ b/spec/system/admin/admin_manages_pages_spec.rb
@@ -124,7 +124,7 @@ RSpec.describe "Admin manages pages", type: :system do
it "allows a landing page to be updated", :aggregate_failures do
visit edit_admin_page_path(current_landing_page.id)
- expect(page).to have_content("Use as 'Locked Screen")
+ expect(page).to have_content("Use as 'Locked Screen'")
uncheck "Use as 'Locked Screen'"
click_on("Update Page")
expect(page).to have_current_path(admin_pages_path)
@@ -132,7 +132,7 @@ RSpec.describe "Admin manages pages", type: :system do
it "allows an Admin to click through to the current landing page via the modal", :aggregate_failures do
visit edit_admin_page_path(new_landing_page.id)
- expect(page).to have_content("Use as 'Locked Screen")
+ expect(page).to have_content("Use as 'Locked Screen'")
check "Use as 'Locked Screen'"
expect(page).to have_link("Current Locked Screen: #{new_landing_page.title}")
click_on("Current Locked Screen")
@@ -142,7 +142,7 @@ RSpec.describe "Admin manages pages", type: :system do
it "allows an Admin to overwrite the current landing page via the checkbox and modal", :aggregate_failures do
visit edit_admin_page_path(new_landing_page.id)
- expect(page).to have_content("Use as 'Locked Screen")
+ expect(page).to have_content("Use as 'Locked Screen'")
check "Use as 'Locked Screen'"
expect(page).to have_link("Current Locked Screen: #{new_landing_page.title}")
click_on("Overwrite current locked screen")
@@ -155,7 +155,7 @@ RSpec.describe "Admin manages pages", type: :system do
it "does not give admins the option to set a lock screen" do
allow(ForemInstance).to receive(:private).and_return(false)
visit edit_admin_page_path(new_landing_page.id)
- expect(page).not_to have_content("Use as 'Locked Screen")
+ expect(page).not_to have_content("Use as 'Locked Screen'")
end
end
end
diff --git a/spec/system/authentication/user_logs_in_with_email_spec.rb b/spec/system/authentication/user_logs_in_with_email_spec.rb
index 29d952e88..b73449645 100644
--- a/spec/system/authentication/user_logs_in_with_email_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_email_spec.rb
@@ -114,9 +114,9 @@ RSpec.describe "Authenticating with Email" do
end
end
- context "when community is in invite only mode" do
+ context "when community is in invite-only mode" do
before do
- allow(ForemInstance).to receive(:private?).and_return(true)
+ allow(ForemInstance).to receive(:invitation_only?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_facebook_spec.rb b/spec/system/authentication/user_logs_in_with_facebook_spec.rb
index 15615f842..83246eeb7 100644
--- a/spec/system/authentication/user_logs_in_with_facebook_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_facebook_spec.rb
@@ -232,9 +232,9 @@ RSpec.describe "Authenticating with Facebook" do
end
end
- context "when community is in invite only mode" do
+ context "when community is in invite-only mode" do
before do
- allow(ForemInstance).to receive(:private?).and_return(true)
+ allow(ForemInstance).to receive(:invitation_only?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_github_spec.rb b/spec/system/authentication/user_logs_in_with_github_spec.rb
index 407390cbc..2d6cb2a6d 100644
--- a/spec/system/authentication/user_logs_in_with_github_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_github_spec.rb
@@ -198,9 +198,9 @@ RSpec.describe "Authenticating with GitHub" do
end
end
- context "when community is in invite only mode" do
+ context "when community is in invite-only mode" do
before do
- allow(ForemInstance).to receive(:private?).and_return(true)
+ allow(ForemInstance).to receive(:invitation_only?).and_return(true)
end
it "doesn't present the authentication option" do
diff --git a/spec/system/authentication/user_logs_in_with_twitter_spec.rb b/spec/system/authentication/user_logs_in_with_twitter_spec.rb
index 63d842152..c72b509cc 100644
--- a/spec/system/authentication/user_logs_in_with_twitter_spec.rb
+++ b/spec/system/authentication/user_logs_in_with_twitter_spec.rb
@@ -190,9 +190,9 @@ RSpec.describe "Authenticating with Twitter" do
end
end
- context "when community is in invite only mode" do
+ context "when community is in invite-only mode" do
before do
- allow(ForemInstance).to receive(:private?).and_return(true)
+ allow(ForemInstance).to receive(:invitation_only?).and_return(true)
end
it "doesn't present the authentication option" do