-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuser_specs.rb
56 lines (44 loc) · 1.17 KB
/
user_specs.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
require 'app/models/user.rb'
describe User do
raw_password = 'password'
let(:user) do
User.create(email: 'admin@example.com',
password: raw_password,
password_confirmation: raw_password)
end
it 'has orders' do
expect(user.orders).not_to raise_error
expect(user.orders).to be
end
it 'has a secure password' do
expect(user.password).to raise_error
expect(user.encrypted_password).to be
end
it 'password is encrypted on creation' do
expect(user.encrypted_password).not_to be(raw_password)
end
it 'has a first name' do
expect(user.first_name).not_to raise_error
end
it 'has a last name' do
expect(user.last_name).not_to raise_error
end
it 'has a full address' do
expect(user.full_address).not_to raise_error
end
it 'has a street address' do
expect(user.address).not_to raise_error
end
it 'has a city' do
expect(user.city).not_to raise_error
end
it 'has a state' do
expect(user.state).not_to raise_error
end
it 'has a zipcode' do
expect(user.zipcode).not_to raise_error
end
it 'has a valid zipcode' do
expect(user.zipcode).not_to raise_error
end
end