Skip to content

Commit

Permalink
fix tests to account for passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
haruska committed Mar 4, 2023
1 parent fe8826b commit acaa823
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 26 deletions.
10 changes: 6 additions & 4 deletions app/assets/stylesheets/controllers/_devise.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
.sessions-controller, .passwords-controller {
.sessions-controller,
.passwords-controller {
p.notice {
text-align: left;
color: blue;
border: blue 1px solid;
padding: $gutter / 4;
padding: calc($gutter / 4);
background-color: lighten(blue, 45);
}

p.alert, #error_explanation {
p.alert,
#error_explanation {
text-align: left;
color: darkred;
border: darkred 1px solid;
padding: $gutter / 4;
padding: calc($gutter / 4);
background-color: lighten(darkred, 65);
}

Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20230304141342_adjust_authentication.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AdjustAuthentication < ActiveRecord::Migration[7.0]
def self.up
drop_table 'passwordless_sessions'
Expand Down
18 changes: 18 additions & 0 deletions db/migrate/20230304191548_remove_unused_devise_columns.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

class RemoveUnusedDeviseColumns < ActiveRecord::Migration[7.0]
def self.up
change_table :users, bulk: true do |t|
t.remove :confirmation_token
t.remove :confirmed_at
t.remove :confirmation_sent_at
t.remove :unconfirmed_email
t.remove :login_token
t.remove :login_token_valid_until
end
end

def self.down
raise ActiveRecord::IrreversibleMigration
end
end
10 changes: 1 addition & 9 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# ensure admin user
admin_name = ENV.fetch('ADMIN_NAME', nil)
admin_email = ENV.fetch('ADMIN_EMAIL', nil)
User.find_or_create_by!(name: admin_name, email: admin_email, admin: true)
admin_password = ENV.fetch('ADMIN_PASSWORD', nil)
User.create_with(password: admin_password).find_or_create_by!(name: admin_name, email: admin_email, admin: true)

# Find or create the tournament and update the tip off time
tip_off = Rails.env.test? ? 2.weeks.from_now : Time.parse('March 16, 2023 16:00 UTC').utc
Expand Down
1 change: 1 addition & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
factory :user do
name { Faker::Name.name }
email { Faker::Internet.email }
password { Faker::Internet.password }
end
end
5 changes: 0 additions & 5 deletions spec/mailers/previews/user_preview.rb

This file was deleted.

7 changes: 0 additions & 7 deletions spec/mailers/user_spec.rb

This file was deleted.

0 comments on commit acaa823

Please sign in to comment.