-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[65] Remove the registration feature (#67)
* Omit sign-up link from devise * Skip registration routes * Ignore .idea files * Replace sign-up spec with login
- Loading branch information
1 parent
48ac072
commit b409334
Showing
4 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ | |
|
||
# Ignore master key for decrypting credentials and more. | ||
/config/master.key | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%- if controller_name != 'sessions' %> | ||
<%= link_to "Log in", new_session_path(resource_name) %><br /> | ||
<% end %> | ||
|
||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> | ||
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br /> | ||
<% end %> | ||
|
||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> | ||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br /> | ||
<% end %> | ||
|
||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> | ||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> | ||
<% end %> | ||
|
||
<%- if devise_mapping.omniauthable? %> | ||
<%- resource_class.omniauth_providers.each do |provider| %> | ||
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br /> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Rails.application.routes.draw do | ||
devise_for :users | ||
devise_for :users, skip: :registrations | ||
|
||
root "home#index" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,16 @@ | |
end | ||
|
||
describe "sign up flow" do | ||
xit "works" do | ||
visit "/users/sign_up" | ||
let(:user) { FactoryBot.create(:user) } | ||
|
||
fill_in "Email", with: "[email protected]" | ||
fill_in "Password", with: "test123" | ||
fill_in "Password confirmation", with: "test123" | ||
it "works" do | ||
visit "/users/sign_in" | ||
|
||
expect { click_on "Sign up" }.to change(User, :count).by(1) | ||
fill_in "Email", with: user.email | ||
fill_in "Password", with: user.password | ||
click_on "Log in" | ||
|
||
expect(page.current_path).to eq(root_path) | ||
end | ||
end | ||
end |