test/access/user_test.rb in access-2.0.46 vs test/access/user_test.rb in access-2.0.47
- old
+ new
@@ -77,9 +77,32 @@
refute_nil request.error
assert_kind_of Access::Error, request.error
end
end
+ def test_authenticate_member_key_success
+ VCR.use_cassette('member authenticate member_key success') do
+ request = Access::User.authenticate_by_member_key member_key: '226872', api_environment: 'stage'
+ assert request.success
+ assert_kind_of Access::UserResponse, request
+ assert_kind_of Array, request.users
+ assert_equal 1, request.users.count
+
+ assert_kind_of Access::Member, request.users.first
+ end
+ end
+
+ def test_authenticate_member_key_failure
+ VCR.use_cassette('member authenticate member_key failure') do
+ request = Access::User.authenticate_by_member_key member_key: 'thisisaverybadmember_keyman1234556badbadbad', api_environment: 'stage'
+ refute request.success
+ assert_equal 401, request.status
+ assert_kind_of Access::UserResponse, request
+ refute_nil request.error
+ assert_kind_of Access::Error, request.error
+ end
+ end
+
def registration_params
{
program_id: 2412,
first_name: 'RubyGem',
last_name: 'Test',