Modifies devise shared link to include organisations sometimes
This commit is contained in:
@@ -3,10 +3,16 @@
|
||||
<%= link_to t("devise_views.shared.links.login"), new_session_path(resource_name) %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.signup"), new_registration_path(resource_name) %><br>
|
||||
<%- if devise_mapping.registerable? &&
|
||||
controller_name != 'registrations' ||
|
||||
controller_path != 'users/registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.signup"), new_user_registration_path %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name == 'registrations' && controller_path != 'organizations/registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.organization_signup"), new_organization_registration_path %><br>
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
||||
<%= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name) %><br>
|
||||
<% end -%>
|
||||
@@ -24,4 +30,5 @@
|
||||
<%= link_to t("devise_views.shared.links.signin_with_provider", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) %><br>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -29,4 +29,17 @@ feature 'Organizations' do
|
||||
expect(page).to have_content "Password can't be blank"
|
||||
expect(page).to have_content "Organization name can't be blank"
|
||||
end
|
||||
|
||||
scenario 'Shared links' do
|
||||
visit new_user_registration_path
|
||||
expect(page).to have_link "Sign up as an organization"
|
||||
|
||||
visit new_organization_registration_path
|
||||
expect(page).to have_link "Sign up"
|
||||
|
||||
visit new_user_session_path
|
||||
|
||||
expect(page).to have_link "Sign up"
|
||||
expect(page).to_not have_link "Sign up as an organization"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user