test/access/member_test.rb in access-2.0.25 vs test/access/member_test.rb in access-2.0.26
- old
+ new
@@ -2,43 +2,43 @@
class MemberTest < Minitest::Test
def test_register_success
VCR.use_cassette('member register success') do
- request = Access::Member.register registration_params
+ request = Access::Member.register registration_params.merge(api_environment: 'stage')
assert request.success
assert_kind_of Access::MemberResponse, 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_register_failure
VCR.use_cassette('member register failure') do
- request = Access::Member.register registration_params.merge(email: nil)
+ request = Access::Member.register registration_params.merge(email: nil, api_environment: 'stage')
refute request.success
assert_equal 400, request.status
assert_kind_of Access::MemberResponse, request
refute_nil request.error
assert_kind_of Access::Error, request.error
end
end
def test_authenticate_success
VCR.use_cassette('member authenticate success') do
- request = Access::Member.authenticate email: 'ben@test.com', password: 'password'
+ request = Access::Member.authenticate email: 'ben@test.com', password: 'password', api_environment: 'stage'
assert request.success
assert_kind_of Access::MemberResponse, 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_failure
VCR.use_cassette('member authenticate failure') do
- request = Access::Member.authenticate email: 'ben@test.com', password: 'bad'
+ request = Access::Member.authenticate email: 'ben@test.com', password: 'bad', api_environment: 'stage'
refute request.success
assert_equal 401, request.status
assert_kind_of Access::MemberResponse, request
refute_nil request.error
assert_kind_of Access::Error, request.error