rename username to email
This commit is contained in:
parent
7412853a3e
commit
cd40ef66c6
9 changed files with 18 additions and 13 deletions
|
@ -3,12 +3,12 @@ require 'rails_helper'
|
|||
RSpec.describe ApplicationController do
|
||||
describe 'current_user' do
|
||||
before(:all) do
|
||||
User.create(username: 'karol.selak@gmail.com', password: 'abcde')
|
||||
User.create(email: 'karol.selak@gmail.com', password: 'abcde')
|
||||
end
|
||||
context 'when a user is logged in' do
|
||||
it 'returns the user' do
|
||||
# TODO
|
||||
# expect(current_user.username).to eql('karol.selak@gmail.com')
|
||||
# expect(current_user.email).to eql('karol.selak@gmail.com')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,11 +12,11 @@ RSpec.describe UsersController do
|
|||
User.destroy_all
|
||||
end
|
||||
subject {
|
||||
get :create, params: {user: {username: 'karol.selak@gmail.com', password: 'abcde'}}
|
||||
get :create, params: {user: {email: 'karol.selak@gmail.com', password: 'abcde'}}
|
||||
}
|
||||
it 'creates a user' do
|
||||
subject
|
||||
expect(User.where(username: 'karol.selak@gmail.com').size).to eql(1)
|
||||
expect(User.where(email: 'karol.selak@gmail.com').size).to eql(1)
|
||||
end
|
||||
it 'redirects to /welcome' do
|
||||
subject
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue