mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
More fixed tests
This commit is contained in:
parent
efee4976b0
commit
149dbe7e27
4 changed files with 16 additions and 15 deletions
|
|
@ -18,7 +18,7 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
get :index
|
get :index
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal "TRACKS::Manage Users", assigns['page_title']
|
assert_equal "TRACKS::Manage Users", assigns['page_title']
|
||||||
assert_equal 4, assigns['total_users']
|
assert_equal 5, assigns['total_users']
|
||||||
assert_equal users_url, session['return-to']
|
assert_equal users_url, session['return-to']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
23
test/fixtures/users.yml
vendored
23
test/fixtures/users.yml
vendored
|
|
@ -19,17 +19,6 @@ other_user:
|
||||||
last_name: Doe
|
last_name: Doe
|
||||||
auth_type: database
|
auth_type: database
|
||||||
|
|
||||||
other_user_email:
|
|
||||||
id: 3
|
|
||||||
login: joe
|
|
||||||
crypted_password: <%= BCrypt::Password.create("open") %>
|
|
||||||
token: <%= Digest::SHA1.hexdigest("joeSun Feb 19 14:42:45 GMT 20060.408173979260027") %>
|
|
||||||
is_admin: false
|
|
||||||
first_name: Jane
|
|
||||||
last_name: Doe
|
|
||||||
email: joe@example.org
|
|
||||||
auth_type: database
|
|
||||||
|
|
||||||
ldap_user:
|
ldap_user:
|
||||||
id: 3
|
id: 3
|
||||||
login: john
|
login: john
|
||||||
|
|
@ -59,3 +48,15 @@ ldap_user:
|
||||||
first_name: International
|
first_name: International
|
||||||
last_name: Harvester
|
last_name: Harvester
|
||||||
auth_type: CAS
|
auth_type: CAS
|
||||||
|
|
||||||
|
other_user_email:
|
||||||
|
id: 6
|
||||||
|
login: joe
|
||||||
|
crypted_password: <%= BCrypt::Password.create("open") %>
|
||||||
|
token: <%= Digest::SHA1.hexdigest("joeSun Feb 19 14:42:45 GMT 20060.408173979260027") %>
|
||||||
|
is_admin: false
|
||||||
|
first_name: Jane
|
||||||
|
last_name: Doe
|
||||||
|
email: joe@example.org
|
||||||
|
auth_type: database
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class UsersXmlApiTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
barracuda1 = User.where(:login => 'barracuda').first
|
barracuda1 = User.where(:login => 'barracuda').first
|
||||||
assert_not_nil barracuda1, "expected user barracuda to be created"
|
assert_not_nil barracuda1, "expected user barracuda to be created"
|
||||||
johnny2 = User.authenticate('barracuda','johnny')
|
barracuda2 = User.authenticate('barracuda','johnny')
|
||||||
assert_not_nil barracuda2, "expected user barracuda to be authenticated"
|
assert_not_nil barracuda2, "expected user barracuda to be authenticated"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ class UsersXmlApiTest < ActionDispatch::IntegrationTest
|
||||||
get '/users.xml', params: {}, headers: basic_auth_headers()
|
get '/users.xml', params: {}, headers: basic_auth_headers()
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select 'users' do
|
assert_select 'users' do
|
||||||
assert_select 'user', count: 4
|
assert_select 'user', count: 5
|
||||||
end
|
end
|
||||||
assert_select 'password', false
|
assert_select 'password', false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class UserTest < ActiveSupport::TestCase
|
||||||
def test_validate_email_format
|
def test_validate_email_format
|
||||||
assert_no_difference 'User.count' do
|
assert_no_difference 'User.count' do
|
||||||
u = create_user :email=> 'test'
|
u = create_user :email=> 'test'
|
||||||
assert_equal "is not valid", u.errors[:email]
|
assert_equal ["is not valid"], u.errors[:email]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue