chore: rubocop
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
This commit is contained in:
parent
f6fb804bbe
commit
fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions
|
|
@ -4,30 +4,31 @@ class CreateUsers < ActiveRecord::Migration[4.2]
|
|||
|
||||
def self.up
|
||||
create_table :users do |t|
|
||||
t.column :nick, :string, :null => false
|
||||
t.column :password_hash, :string, :null => false
|
||||
t.column :password_salt, :string, :null => false
|
||||
t.column :first_name, :string, :null => false
|
||||
t.column :last_name, :string, :null => false
|
||||
t.column :email, :string, :null => false
|
||||
t.column :nick, :string, null: false
|
||||
t.column :password_hash, :string, null: false
|
||||
t.column :password_salt, :string, null: false
|
||||
t.column :first_name, :string, null: false
|
||||
t.column :last_name, :string, null: false
|
||||
t.column :email, :string, null: false
|
||||
t.column :phone, :string
|
||||
t.column :address, :string
|
||||
t.column :created_on, :timestamp, :null => false
|
||||
t.column :created_on, :timestamp, null: false
|
||||
end
|
||||
add_index(:users, :nick, :unique => true)
|
||||
add_index(:users, :email, :unique => true)
|
||||
add_index(:users, :nick, unique: true)
|
||||
add_index(:users, :email, unique: true)
|
||||
|
||||
# Create the default admin user...
|
||||
puts "Creating user #{USER_ADMIN} with password 'secret'..."
|
||||
user = User.new(:nick => USER_ADMIN, :first_name => "Anton", :last_name => "Administrator", :email => "admin@foo.test")
|
||||
user.password = "secret"
|
||||
raise "Failed!" unless user.save && User.find_by_nick(USER_ADMIN).has_password("secret")
|
||||
user = User.new(nick: USER_ADMIN, first_name: 'Anton', last_name: 'Administrator',
|
||||
email: 'admin@foo.test')
|
||||
user.password = 'secret'
|
||||
raise 'Failed!' unless user.save && User.find_by_nick(USER_ADMIN).has_password('secret')
|
||||
|
||||
# Create a normal user...
|
||||
puts "Creating user #{USER_TEST} with password 'foobar'..."
|
||||
user = User.new(:nick => USER_TEST, :first_name => "Tim", :last_name => "Tester", :email => "test@foo.test")
|
||||
user.password = "foobar"
|
||||
raise "Failed!" unless user.save && User.find_by_nick(USER_TEST).has_password("foobar")
|
||||
user = User.new(nick: USER_TEST, first_name: 'Tim', last_name: 'Tester', email: 'test@foo.test')
|
||||
user.password = 'foobar'
|
||||
raise 'Failed!' unless user.save && User.find_by_nick(USER_TEST).has_password('foobar')
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue