# -- they do not yet inherit this setting
fixtures :all
+ teardown do
+ Thread.current[:api_client_ip_address] = nil
+ Thread.current[:api_client_authorization] = nil
+ Thread.current[:api_client_uuid] = nil
+ Thread.current[:api_client] = nil
+ Thread.current[:user] = nil
+ end
+
def expect_json
self.request.headers["Accept"] = "text/json"
end
end
class ActionDispatch::IntegrationTest
+
+ teardown do
+ Thread.current[:api_client_ip_address] = nil
+ Thread.current[:api_client_authorization] = nil
+ Thread.current[:api_client_uuid] = nil
+ Thread.current[:api_client] = nil
+ Thread.current[:user] = nil
+ end
+
def jresponse
@jresponse ||= ActiveSupport::JSON.decode @response.body
end
+
def auth auth_fixture
{'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(auth_fixture).api_token}"}
end
end
test "full name should not contain spurious whitespace" do
+ Thread.current[:user] = @admin_user # set admin user as the current user
+
user = User.create ({uuid: 'zzzzz-tpzed-abcdefghijklmno', email: 'foo@example.com' })
assert_equal '', user.full_name