-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from anyone-oslo/remove-username
Remove username
- Loading branch information
Showing
10 changed files
with
60 additions
and
74 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
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
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
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
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
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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class RemoveUsername < ActiveRecord::Migration[7.0] | ||
def change | ||
remove_column :users, :username, :string | ||
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
before do | ||
perform_enqueued_jobs do | ||
post :create, params: { username: user.email } | ||
post :create, params: { email: user.email } | ||
end | ||
end | ||
|
||
|
@@ -50,7 +50,7 @@ | |
end | ||
|
||
context "with a non-existant user" do | ||
before { post :create, params: { username: "[email protected]" } } | ||
before { post :create, params: { email: "[email protected]" } } | ||
|
||
it { is_expected.to redirect_to(login_admin_users_url) } | ||
|
||
|
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
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
it { is_expected.to validate_presence_of(:email) } | ||
it { is_expected.to validate_presence_of(:name) } | ||
|
||
it { is_expected.to validate_uniqueness_of(:username).case_insensitive } | ||
it { is_expected.to validate_uniqueness_of(:email).case_insensitive } | ||
|
||
it { is_expected.to allow_value("[email protected]").for(:email) } | ||
|
@@ -25,12 +24,6 @@ | |
it { is_expected.to allow_value("long enough").for(:password) } | ||
it { is_expected.not_to allow_value("eep").for(:password) } | ||
|
||
context "when email is blank" do | ||
subject { build(:user, email: nil) } | ||
|
||
it { is_expected.to validate_presence_of(:username) } | ||
end | ||
|
||
describe "password validation" do | ||
subject { user.valid? } | ||
|
||
|
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